Meet Frontfriend.Your brand. Your rules. Your agents, connected.Explore what’s new

Table

A responsive table component.

Interactive preview

Rendered from the shared Frontfriend stories with React Base, the same preview Studio shows. Styling comes from your Design System; the code below is native to Reka UI.

Installation

Complete project setup first. Your configuration must select vue/reka and include your Design System ID.

pnpm exec frontfriend download table -f vue --primitive reka

Review dependencies reported by the downloader and keep your source changes in version control.

Usage

<script setup lang="ts">
import { Table } from "@/components/ui/table";
import { TableCaption } from "@/components/ui/table";
import { TableHeader } from "@/components/ui/table";
import { TableRow } from "@/components/ui/table";
import { TableHead } from "@/components/ui/table";
import { TableBody } from "@/components/ui/table";
import { TableCell } from "@/components/ui/table";
import * as UI from "@/components/ui/table";

const Component = UI.Table;

const args = {
  "caption": "Recent payments",
  "amount": "$250.00",
} satisfies Partial<
  InstanceType<typeof Component> extends { $props: infer Props } ? Props : {}
> &
  Record<string, unknown>;
</script>

<template>
  <Table
    ><TableCaption>{{ args.caption }}</TableCaption
    ><TableHeader
      ><TableRow
        ><TableHead>Invoice</TableHead><TableHead>Amount</TableHead></TableRow
      ></TableHeader
    ><TableBody
      ><TableRow
        ><TableCell>INV-001</TableCell
        ><TableCell>{{ args.amount }}</TableCell></TableRow
      ></TableBody
    ></Table
  >
</template>

Examples

Default

<script setup lang="ts">
import { Table } from "@/components/ui/table";
import { TableCaption } from "@/components/ui/table";
import { TableHeader } from "@/components/ui/table";
import { TableRow } from "@/components/ui/table";
import { TableHead } from "@/components/ui/table";
import { TableBody } from "@/components/ui/table";
import { TableCell } from "@/components/ui/table";
import * as UI from "@/components/ui/table";

const Component = UI.Table;

const args = {

} satisfies Partial<
  InstanceType<typeof Component> extends { $props: infer Props } ? Props : {}
> &
  Record<string, unknown>;
</script>

<template>
  <Table v-bind="args"
    ><TableCaption>A list of your recent invoices.</TableCaption
    ><TableHeader
      ><TableRow
        ><TableHead class="w-[100px]">Invoice</TableHead
        ><TableHead>Status</TableHead><TableHead>Method</TableHead
        ><TableHead class="text-right">Amount</TableHead></TableRow
      ></TableHeader
    ><TableBody
      ><TableRow
        ><TableCell class="font-medium">INV001</TableCell
        ><TableCell>Paid</TableCell><TableCell>Credit Card</TableCell
        ><TableCell class="text-right">$250.00</TableCell></TableRow
      ><TableRow
        ><TableCell class="font-medium">INV002</TableCell
        ><TableCell>Pending</TableCell><TableCell>PayPal</TableCell
        ><TableCell class="text-right">$150.00</TableCell></TableRow
      ></TableBody
    ></Table
  >
</template>

API reference

Frontfriend-owned props. Native HTML and inherited primitive props remain documented by Reka UI.

Table

Prop Type Default Description
class HTMLAttributes["class"] —
containerClass HTMLAttributes["class"] —

TableBody

Prop Type Default Description
class HTMLAttributes["class"] —

TableCaption

Prop Type Default Description
class HTMLAttributes["class"] —

TableCell

Prop Type Default Description
class HTMLAttributes["class"] —

TableEmpty

Prop Type Default Description
class HTMLAttributes["class"] —
colspan number —

TableFooter

Prop Type Default Description
class HTMLAttributes["class"] —

TableHead

Prop Type Default Description
class HTMLAttributes["class"] —

TableHeader

Prop Type Default Description
class HTMLAttributes["class"] —

TableRow

Prop Type Default Description
class HTMLAttributes["class"] —

Configuration determines the actual classes and available styling hooks. See Theming & component configuration before introducing a repeated local override.