<AdaptiveTable>
ts
interface AdaptiveTableRootProps<T> extends AtomProps {
table: DataTableContext<T>
fields: AdaptiveField<T>[]
mobileBreakpoint?: BreakpointName | number
mobileMode?: 'card' | 'list'
itemKey?: keyof T & string
selectable?: boolean
}| Prop | Type | Default | Description |
|---|---|---|---|
table | DataTableContext<T> | — | The instance returned by createDataTable. Required. |
fields | AdaptiveField<T>[] | — | Drives both the desktop columns and the mobile layout. Required. |
itemKey | keyof T & string | array index | Property used as the row/card/list-item key. |
selectable | boolean | false | Renders a checkbox column on desktop and per row on mobile. See Selection. |
mobileBreakpoint | BreakpointName | number | 'sm' | Breakpoint below which the mobile layout replaces the table. |
mobileMode | 'card' | 'list' | 'card' | Which mobile layout to render. See Mobile layout. |
as | string | Component | 'div' | Root element or component to render as (v0's Atom convention). |
renderless | boolean | false | Skips the root element entirely. |
A thin render layer over createAdaptiveTable. Renders a native <table> head/body wired to table.sort/table.selection above the mobile breakpoint, and either stacked cards or an expandable list below it.
Slots
| Slot | Signature | Description |
|---|---|---|
cell-{key} | (props: { item, field, value, formatted }) => any | Overrides a desktop cell for that field. |
card-{key} | (props: { item, field, value, formatted }) => any | Overrides how a field renders on mobile, in both card and list mode. |
actions | (props: { item, isMobile }) => any | Renders once per row in both modes. |
See Extension points for a worked example of all three.
No field/column feature is reachable only through props — anything a slot can't express is still reachable directly through the table context passed in, since it's the consumer's own instance.