@maxhealth.tech/prefab / auto / autoDetail
Function: autoDetail()
ts
function autoDetail(data, options?): ContainerComponent;Defined in: auto/index.ts:139
Auto-generate a detail Card from a data object.
Inspects value types and renders:
- Booleans → Badge (Yes/No)
- Status-like strings → Badge with variant
- Dates → Text with tabular-nums class
- Nested objects → sub-section
- Everything else → Text
Parameters
| Parameter | Type |
|---|---|
data | Record<string, unknown> |
options? | AutoDetailOptions |
Returns
ContainerComponent
Example
ts
autoDetail({ name: 'John', status: 'active', createdAt: '2024-01-01' })