Skip to content

ObjectsGrid

Overview

Renders a list of objects as either a table or a card grid depending on the current breakpoint. Supports skeleton loading rows, field-level slot overrides, and per-field class customization.

Theme entry: ObjectsGrid

Props

NameTypeRequiredDefaultDescription
iconOverrideObjectnullA partial icon registry ({ [componentName]: { [iconName]: { component, props } } }) merged with inherited and default icon entries; scopes icon overrides to this component and its descendants.
themeOverrideString|Object|ArraynullA partial theme object merged with the component's default theme; accepts a class string, class array, or theme object.
objectsInOrderarrayno[]Ordered array of row objects to render.
relatedObjectsobject{}Map of related object keys to their data, passed to each cell slot.
calculatedObjectsobject{}Map of calculated object keys to their data, passed to each cell slot.
fieldsarrayyesOrdered list of field names (or field descriptor objects) to render as columns.
fieldClassesobject{}Map of field names to CSS class(es) applied in both table and card layouts.
tableFieldClassesobject{}Map of field names to CSS class(es) applied only in table layout.
cardFieldClassesobject{}Map of field names to CSS class(es) applied only in card layout.
fieldPropsobject{}Extra props passed to each field slot via the slot binding.
headerClassesobject{}Map of field names to CSS class(es) applied to header cells in both layouts.
tableHeaderClassesobject{}Map of field names to CSS class(es) applied to header cells only in table layout.
cardHeaderClassesobject{}Map of field names to CSS class(es) applied to header cells only in card layout.
loadingbooleanundefinedWhen true, renders skeleton rows; when false, renders data rows; when undefined, inferred from objectsInOrder.
emptyTextstring"No records found."Text displayed when the grid has no rows to show. Pass null to suppress the empty-state row entirely.
emptyVariantstring"empty"Empty-state variant: empty (default), loading, error, or filtered. Drives data-variant on the empty content wrapper.
tableBreakpointstring"lg"Tailwind breakpoint at which the layout switches from card to table view.
pkKeystring"id"Name of the field used as the primary key for row identity.
evenColumnfunc() => nullFunction that returns a CSS class for alternating (even) columns, or null to disable.
skeletonRowsnumber25Number of skeleton rows to render while loading.
rowAttrsfunc() => nullFunction (obj, rowIndex) => attrs returning extra attributes (typically data-*) merged onto the body row element.
densitystring"default"Row-height density tier in table layout: default 32px, compact 28px, condensed 24px.

Slots

NameScopedDescription
header(fieldName)yesOverride the header label cell for a specific field column.
emptyyesReplaces the default empty-state body. Receives variant (the resolved emptyVariant). Compose icon (with data-slot="icon"), title, description, and actions.
field(fieldName)yesOverride the body cell content for a specific field column.
row-after-objectsyesContent appended after all data rows in the grid body.

Full slot reference

Events

update:isTable

Source

client/lib/objects-grid/ObjectsGrid.vue

Documents matching: server v3.0.0a1.post1client v3.0.0-alpha.2