Skip to content

    Browse components

    Table

    Data table with sortable headers (flipping chevron arrows), rows that glide into their new order, hover and selection states with animated checkboxes and a sticky blurred header.

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/table

    First time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.vercel.app/r/table.json

    Usage

    import { Table } from "@/components/ui/table";
    
    <Table
      maxHeight={320}
      rows={invoices}
      columns={[
        { key: "customer", header: "Customer", sortable: true },
        { key: "amount", header: "Amount", sortable: true, align: "right" },
      ]}
    />

    Props

    PropTypeDefaultDescription
    selectablebooleantrueCheckbox column with select-all.
    stickyHeaderbooleantrueKeep the header visible while scrolling (with maxHeight).
    columnsReactNode—{ key, header, sortable?, align?, cell?, sortValue? }[]
    rowsReactNode—Row objects; each needs a unique `id`.
    maxHeightReactNode—Scroll container height (number px or CSS length).
    defaultSortReactNode—{ key, direction: "asc" | "desc" } or null.
    selectedReactNode—Selected row ids (controlled, with onSelectionChange).
    classNamestring—Extra classes for the root element.