VibeUI
ComponentsDocs
VibeUI

Components with taste, that you own. Copy the source, retint the tokens, keep every line.

Library

  • All components
  • Signature pieces
  • Text effects
  • Footers

Docs

  • Introduction
  • Installation
  • Theming
  • CLI

Project

  • GitHub
  • Agents and MCP
  • Issues
  • MIT license
© 2026 VibeUI · MIT licensed
  1. Components
  2. Data & surfaces
  3. Table

Table

Data table with a quiet header and row hover.

Data & surfacesServer-safe6 exports
ComponentCategoryStatus
ButtonActionsStable
DialogOverlaysStable
DockSignatureNew

Install

bash
npx @agents-npm-packages/vibeui add table --dir ./src/components/ui

Import

tsx
import { Table, THead, TBody, TR, TH, TD } from "@/components/ui/table"

API

Generated from the component's TypeScript types, so it always matches the source. * marks a required prop.

<Table>

also accepts every TableHTMLAttributes<HTMLTableElement> attribute

No props of its own: it forwards native attributes to the element.

<THead>

also accepts every HTMLAttributes<HTMLTableSectionElement> attribute

No props of its own: it forwards native attributes to the element.

<TBody>

also accepts every HTMLAttributes<HTMLTableSectionElement> attribute

No props of its own: it forwards native attributes to the element.

<TR>

also accepts every HTMLAttributes<HTMLTableRowElement> attribute

No props of its own: it forwards native attributes to the element.

<TH>

also accepts every ThHTMLAttributes<HTMLTableCellElement> attribute

No props of its own: it forwards native attributes to the element.

<TD>

also accepts every TdHTMLAttributes<HTMLTableCellElement> attribute

No props of its own: it forwards native attributes to the element.

Source

src/components/ui/table.tsx
import { cn } from "@/lib/utils";

/** Data table with a quiet header and row hover. */
export function Table({
  className,
  ...props
}: React.TableHTMLAttributes<HTMLTableElement>) {
  return (
    <div className="w-full overflow-x-auto rounded-lg border border-line bg-surface shadow-quiet">
      <table className={cn("w-full text-left text-sm", className)} {...props} />
    </div>
  );
}

export function THead({
  className,
  ...props
}: React.HTMLAttributes<HTMLTableSectionElement>) {
  return (
    <thead
      className={cn("border-b border-line bg-surface-muted/60", className)}
      {...props}
    />
  );
}

export function TBody({
  className,
  ...props
}: React.HTMLAttributes<HTMLTableSectionElement>) {
  return <tbody className={cn("divide-y divide-line", className)} {...props} />;
}

export function TR({
  className,
  ...props
}: React.HTMLAttributes<HTMLTableRowElement>) {
  return (
    <tr
      className={cn("transition-colors hover:bg-surface-muted/50", className)}
      {...props}
    />
  );
}

export function TH({
  className,
  ...props
}: React.ThHTMLAttributes<HTMLTableCellElement>) {
  return (
    <th
      className={cn(
        "whitespace-nowrap px-4 py-3 text-xs font-medium text-muted",
        className,
      )}
      {...props}
    />
  );
}

export function TD({
  className,
  ...props
}: React.TdHTMLAttributes<HTMLTableCellElement>) {
  return (
    <td className={cn("px-4 py-3.5 text-ink-soft", className)} {...props} />
  );
}

Exports Table and 5 more. Peer dependencies: clsx, tailwind-merge.

PreviousStatNextCommand