Code & JSON
FreeShow a snippet people can copy, and let them search and walk through a data payload.
Install a component
bash
pnpm dlx caliper add table tree-view# adds the source under components/uiUse it in a page
tsx
import { SortableTable, FilterToolbar } from "@/components/ui";
type Account = { id: string; name: string; mrr: number };
const columns = [ { id: "name", header: "Account", cell: (r: Account) => r.name, sortValue: (r: Account) => r.name }, { id: "mrr", header: "MRR", align: "end" as const, cell: (r: Account) => `$${r.mrr}`, sortValue: (r: Account) => r.mrr },];
export function Accounts({ rows }: { rows: Account[] }) { const [query, setQuery] = useState(""); const visible = rows.filter((r) => r.name.toLowerCase().includes(query.toLowerCase()));
return ( <> <FilterToolbar label="Accounts" query={query} onQueryChange={setQuery} filters={[]} value={{}} onValueChange={() => {}} /> {/* Sorting, selection and empty states are handled by the table. */} <SortableTable caption="Accounts" columns={columns} rows={visible} getRowId={(r) => r.id} /> </> );}css
:root { --accent: #1f6f78; --duration-travel: 280ms; /* bounded movement */ --ease-showcase: cubic-bezier(0.22, 1, 0.36, 1);}
@media (prefers-reduced-motion: reduce) { [data-slot="tree-panel"] { transition: none; }}json
{ "ok": true, "items": [ 1, 2, 3 ], "next": null}Page appearance
Components #
Each component has its own page with a focused preview, installation, usage and API.