On this page

Table

Install, props and the parts Table is built from.

Install

Run this in the app, after shadcn-vue init and the Beehexa theme (Button › Code):

npx shadcn-vue@latest add https://beehexa.design/r/table.json

Use

<script setup lang="ts">
import { Badge } from '@/components/ui/badge'
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table'
</script>

<template>
  <Table>
    <TableHeader>
      <TableRow>
        <TableHead>Order</TableHead>
        <TableHead>ERP sync</TableHead>
      </TableRow>
    </TableHeader>
    <TableBody>
      <TableRow to="/orders/10482" link-label="Order 10482">
        <TableCell><a href="/orders/10482" class="relative z-1">#10482</a></TableCell>
        <TableCell><Badge variant="success">Synced</Badge></TableCell>
      </TableRow>
    </TableBody>
  </Table>
</template>

Props

Part Prop Values Notes
TableRow to string, or a route location when the app uses vue-router Makes the whole row a link. Each cell draws a transparent link over itself
TableRow linkLabel string Name of the row link, such as the record’s name
TableRow data-state selected Attribute. Selected fill and bar
TableEmpty colspan number The number of columns
every part class string Merged with the Beehexa classes. table-fixed on Table for long values

Content that must stay clickable inside a linked row needs class="relative z-1".

Built on

Native table elements with data-slot attributes, as control-center’s Table. Beehexa adds the styles, the selected bar, and an empty row that does not hover.

Differences from control-center

  • The row link uses RouterLink only when the app registers it (app.use(router)); otherwise it is a plain <a href>. The registry does not depend on vue-router.
  • utils.ts (valueUpdater for TanStack Table) is not included: it needs @tanstack/vue-table. Copy it from the shadcn-vue data table guide if you use TanStack.
  • Headers are sentence case, not upper case.