caliper uidocs

Code & JSON

Free

Show a snippet people can copy, and let them search and walk through a data payload.

Kind CompositionComponents 1

Install a component

bash
pnpm dlx caliper add table tree-view# adds the source under components/ui

Use it in a page

accounts.tsx
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} />    </>  );}

tokens.css
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;  }}

response.json
json
{  "ok": true,  "items": [    1,    2,    3  ],  "next": null}

Inspect a webhook payload

invoice.payment_succeeded
  • { 7 keys }
  • id"evt_1Q9x"
  • object"event"
  • livemodefalse
  • created1790000000
  • type"invoice.payment_succeeded"
$

Page appearance

Components #

Each component has its own page with a focused preview, installation, usage and API.