Skip to content

<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
}
PropTypeDefaultDescription
tableDataTableContext<T>—The instance returned by createDataTable. Required.
fieldsAdaptiveField<T>[]—Drives both the desktop columns and the mobile layout. Required.
itemKeykeyof T & stringarray indexProperty used as the row/card/list-item key.
selectablebooleanfalseRenders a checkbox column on desktop and per row on mobile. See Selection.
mobileBreakpointBreakpointName | number'sm'Breakpoint below which the mobile layout replaces the table.
mobileMode'card' | 'list''card'Which mobile layout to render. See Mobile layout.
asstring | Component'div'Root element or component to render as (v0's Atom convention).
renderlessbooleanfalseSkips 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 ​

SlotSignatureDescription
cell-{key}(props: { item, field, value, formatted }) => anyOverrides a desktop cell for that field.
card-{key}(props: { item, field, value, formatted }) => anyOverrides how a field renders on mobile, in both card and list mode.
actions(props: { item, isMobile }) => anyRenders 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.