@vuecs/table
v1.6.1
Published
Compound table for vuecs (Table / Header / Body / Footer / Row / Cell / HeadCell / Empty / Loading / ExpandTrigger / RowExpansion) + columns/data driver with sortable headers, row-meta variants, row keyboard navigation, and expandable-row panels.
Maintainers
Readme
@vuecs/table
The compound table of vuecs — semantic HTML for entity-list pages. Drive it with :columns + :data for the terse path, or compose the parts by hand for layouts the driver can't express. Both shapes mix freely.
✨ What's inside
- 🧾 Columns/data driver — pass
:columns(or let them auto-derive fromdata[0]) and the table renders header + body for you;#cell-<key>/#header-<key>slots override per column. Column shape is a near-superset of bootstrap-vue-next'sTableField, withaccessor(dot-paths or functions) +formatter. - 🔼 Sorting — controlled
v-model:sort(SortDescriptor[]), multi-column via Shift-click or the<VCTableSortIndicators>chip row, optionalclient-sortwith per-column comparators (sortFn,sortByFormatted,nullsFirst). - ☑️ Row selection —
selection-mode="single|multi"with the W3C ARIA grid pattern: roving tabindex, Shift-ranges, Ctrl-toggles, and anisSelectorcheckbox/radio column with select-all. - 📂 Expandable rows —
:expandable+#expansionslot for inline detail panels; ResizeObserver-measured height animation, disclosure-pattern ARIA, single (accordion) or multi mode. - 📱 Stacked responsive mode —
:responsivecollapses to per-row cards below 640 px, labels read fromdata-label. - 🎨 Row/cell tinting —
_rowVariant/_cellVariantsrow-meta keys color rows and individual cells without function props. - 🔤 Typed rows —
<VCTable>/<VCTableLite>are generic over their row type, so:data/:columnsdrive typed slot props (#cell-<key>="{ row }",#header-<key>,#default) — noascast.<VCTable>also types its#expansionslot and the@row-click/getRowKeycallbacks. - 🪶
<VCTableLite>— same driver, theme wiring, and auto-render, minus sort/selection state — perfect under tanstack-table. - 🦴
<VCTablePlaceholder>— matching skeleton for loading states.
📦 Installation
npm install @vuecs/table⚡ Usage
Driver shape (recommended):
<VCTable
:columns="[
{ key: 'name', label: 'Name', sortable: true, isRowHeader: true },
{ key: 'email', label: 'Email' },
]"
:data="users"
v-model:sort="sort"
:busy="loading"
multi-sort
client-sort
>
<template #cell-email="{ value }">
<a :href="`mailto:${value}`">{{ value }}</a>
</template>
<VCTableEmpty>No users yet.</VCTableEmpty>
</VCTable>Compound shape (escape hatch):
<VCTable :data="orders">
<VCTableHeader>
<VCTableRow>
<VCTableHeadCell>Order</VCTableHeadCell>
<VCTableHeadCell>Customer</VCTableHeadCell>
</VCTableRow>
</VCTableHeader>
<VCTableBody>
<template #row="{ row }">
<VCTableRow>
<VCTableCell>#{{ row.id }}</VCTableCell>
<VCTableCell>{{ row.customer }}</VCTableCell>
</VCTableRow>
</template>
</VCTableBody>
</VCTable>📚 Documentation
Full reference — sorting, selection, expansion, theming: vuecs.dev/components/table
License
Made with 💚
Published under Apache 2.0 License.
