# Create your first app (/docs/create-your-first-app) ```bash npx create-signet-app@latest my-app --template full cd my-app npm install npm run dev ``` ```bash pnpm create signet-app my-app --template full cd my-app pnpm install pnpm run dev ``` ```bash bunx create-signet-app my-app --template full cd my-app bun install bun run dev ``` `full` needs [Bun](https://bun.sh) 1.3+ installed, even when npm or pnpm installs it: `run dev` is a Bun script. ### Scaffold [#scaffold] The first command above makes `my-app` with the `editorial` theme. The directory must not exist or be empty. ### Install and run [#install-and-run] `install`, then `run dev`. The API and Vite start together. ### Open the app [#open-the-app] Open `http://localhost:5173`. Sign in with any phone number; the code prints in your terminal. ### Make your first edit [#make-your-first-edit] Change the `CardTitle` on line 17 (it starts as `Hello`). The page reloads on save. ```tsx title="src/routes/_app/index.tsx" import { CardTitle } from "@dapplelight/signet-ui/components/card" Welcome to my app ``` # Deploy (/docs/deploy) | Target | Command | Docs | | --- | --- | --- | | `full` | `bun run build`, then `bun run start` | [Project structure](/docs/project-structure) | | `api --target cloudflare` | `wrangler deploy` | [API targets](/docs/packages/create-signet-app/flags#api-targets) | | `api --target vercel` | `vercel deploy` | [API targets](/docs/packages/create-signet-app/flags#api-targets) | | `api --target bun` | `docker build -t my-api .` | [API targets](/docs/packages/create-signet-app/flags#api-targets) | | `api --target node` | `bun run start` | [API targets](/docs/packages/create-signet-app/flags#api-targets) | `docker run -p 3000:3000 my-api` runs the Bun image. Before production, `full` needs `APP_ENV=production`, `SESSION_SECRET`, `OTP_SECRET` and `ADMIN_PHONES` set on the host, a volume for `DATABASE_PATH`, and a real SMS sender in `api/services.ts`. # First API route (/docs/first-api-route) ### Add the route [#add-the-route] Chain it next to `/api/health`. Chaining is what types the client. ```ts title="api/app.ts" import { Hono } from "hono" const base = new Hono() const app = base .get("/api/health", (c) => c.json({ ok: true })) .get("/api/hello", (c) => c.json({ message: "Hello" })) ``` ### Call it [#call-it] `src/lib/api.ts` already exports the client. The path and response type come from the route. ```tsx title="src/routes/_app/index.tsx" import { useQuery } from "@tanstack/react-query" import { api } from "../../lib/api" const hello = useQuery({ queryKey: ["hello"], queryFn: async () => (await api.hello.$get()).json(), }) //

{hello.data?.message}

```
### Check it [#check-it] Save. The page shows `Hello`. Rename the field in the route and `bun run typecheck` fails in the page.
# First component (/docs/first-component) ### Import it [#import-it] ```tsx title="src/routes/_app/index.tsx" import { Badge } from "@dapplelight/signet-ui/components/badge" ``` ### Use it [#use-it] ```tsx title="src/routes/_app/index.tsx" import { CardTitle } from "@dapplelight/signet-ui/components/card" import { useQuery } from "@tanstack/react-query" import { meQuery } from "../../lib/api" function Home() { const me = useQuery(meQuery).data return ( Hello {me?.plan ?? "free"} ) } ``` The page reloads with a badge in the title. ### Try a variant [#try-a-variant] ```tsx import { Badge } from "@dapplelight/signet-ui/components/badge" Beta ``` Variants and props: [Badge](/docs/components/badge). # Introduction (/docs) Signet is a design system and backend kit for React apps. Your app holds only its own business logic. Vite + React + Tailwind v4 on the front, Hono on Cloudflare Workers behind. - Install packages to get updates. - Run `signet add` to copy source you own. ## How it fits [#how-it-fits] | Layer | Packages | You get | | --- | --- | --- | | Frontend | `@dapplelight/signet-ui`, `@dapplelight/signet-tokens`, `@dapplelight/signet-lib` | Components, themes, API client, forms | | Backend | `@dapplelight/signet-server`, `@dapplelight/signet-db`, `@dapplelight/signet-payments`, `@dapplelight/signet-ai` | Auth, middleware, tables, billing, models | | Tooling | `create-signet-app`, `@dapplelight/signet-cli`, `@dapplelight/signet-mcp`, `@dapplelight/signet-config`, `@dapplelight/signet-test` | Scaffold, copy-in, agents, presets, fakes | ## Example [#example] ```tsx title="src/routes/index.tsx" import { createApiClient } from "@dapplelight/signet-lib/api" import { Button } from "@dapplelight/signet-ui/components/button" import { useState } from "react" const api = createApiClient({ baseUrl: "/api" }) export function Home() { const [text, setText] = useState("Say hello") const load = async () => setText((await api.get<{ text: string }>("/hello")).text) return } ``` ```ts title="api/index.ts" import { errorHandler } from "@dapplelight/signet-server/http" import { requestId, secureHeaders } from "@dapplelight/signet-server/middleware" import { Hono } from "hono" const app = new Hono() app.use(requestId(), secureHeaders()) app.onError(errorHandler({ isProduction: true })) app.get("/api/hello", (c) => c.json({ text: "Hello from Workers" })) export default app ``` ### Frontend [#frontend] ### Backend [#backend] ### Tooling [#tooling] ## 60-second start [#60-second-start] ```bash npx create-signet-app@latest my-app --template full cd my-app npm install npm run dev ``` ```bash pnpm create signet-app my-app --template full cd my-app pnpm install pnpm run dev ``` ```bash bunx create-signet-app my-app --template full cd my-app bun install bun run dev ``` Open `http://localhost:5173`. `full` needs [Bun](https://bun.sh) 1.3+ installed, even when npm or pnpm installs it: `run dev` is a Bun script. It is a web app and an API with sign-in, billing, admin and privacy already wired. ## For agents [#for-agents] # Installation (/docs/installation) | Path | Use it when | Start | | --- | --- | --- | | Scaffold | New project | [Create your first app](/docs/create-your-first-app) | | Existing React app | You have Vite, React 19 and Tailwind v4 | Steps below | ## Prerequisites [#prerequisites] | Need | Version | Why | | --- | --- | --- | | Node.js | 22+ | Signet's CI tests 22 and 24; `--target node` needs 22.18+ | | Bun | 1.3+ | `full` runs its API, tests and CI under Bun, whatever installs it | | React | 19+ | Peer of `signet-ui` | | Tailwind CSS | 4+ | The themes are Tailwind v4 CSS | ## Add to an existing React app [#add-to-an-existing-react-app] ### Install [#install] ```bash npm i @dapplelight/signet-ui @dapplelight/signet-tokens npm i @dapplelight/signet-lib npm i @base-ui/react class-variance-authority clsx npm i tailwind-merge lucide-react ``` ```bash pnpm add @dapplelight/signet-ui @dapplelight/signet-tokens pnpm add @dapplelight/signet-lib pnpm add @base-ui/react class-variance-authority clsx pnpm add tailwind-merge lucide-react ``` ```bash bun add @dapplelight/signet-ui @dapplelight/signet-tokens bun add @dapplelight/signet-lib bun add @base-ui/react class-variance-authority clsx bun add tailwind-merge lucide-react ``` ### Import the theme [#import-the-theme] ```css title="src/app.css" @import "tailwindcss"; @import "@dapplelight/signet-tokens/editorial.css"; @import "@dapplelight/signet-tokens/base.css"; /* Tailwind does not scan node_modules, and @dapplelight/signet-ui ships compiled JS whose class names must be seen or every component renders unstyled. The theme cannot declare this: a package does not know where it is installed. Must come after the @import rules: CSS requires imports first. */ @source "../node_modules/@dapplelight/signet-ui/dist"; ``` Other themes: [Themes](/docs/packages/tokens/themes). Your own: [Make a Theme](/docs/guides/add-theme). ### Add the Tailwind plugin [#add-the-tailwind-plugin] ```bash npm i -D tailwindcss @tailwindcss/vite ``` ```bash pnpm add -D tailwindcss @tailwindcss/vite ``` ```bash bun add -D tailwindcss @tailwindcss/vite ``` ```ts title="vite.config.ts" import tailwindcss from "@tailwindcss/vite" import react from "@vitejs/plugin-react" import { defineConfig } from "vite" export default defineConfig({ plugins: [react(), tailwindcss()] }) ``` ### Wrap the app in ThemeProvider [#wrap-the-app-in-themeprovider] ```tsx title="src/main.tsx" import { ThemeProvider } from "@dapplelight/signet-ui/components/theme-provider" import { StrictMode } from "react" import { createRoot } from "react-dom/client" import { App } from "./App" import "./app.css" createRoot(document.getElementById("root")!).render( , ) ``` ### Render a Button [#render-a-button] ```tsx title="src/App.tsx" import { Button } from "@dapplelight/signet-ui/components/button" export function App() { return } ``` # Project structure (/docs/project-structure) | Path | Purpose | | --- | --- | | `api/` | `full`: Hono API, env, plans, services, SQLite schema | | `api/app.ts` | `full`: every route, mounted under `/api` | | `drizzle/` | `full`: SQL migrations | | `src/` | The web app: Vite, React, TanStack Router | | `src/routes/` | One file per page | | `src/lib/api.ts` | The typed client for the API | | `test/`, `e2e/` | API tests and the Playwright smoke test | | `.github/workflows/` | CI: lint, typecheck, test | The generated env file gets fresh `SESSION_SECRET` and `OTP_SECRET` values in the `full` template. Templates ship `_gitignore` and `_github`, renamed to `.gitignore` and `.github` on scaffold. Other templates: [Flags and templates](/docs/packages/create-signet-app/flags). # Abuse Screens (/docs/components/abuse-screens) ```tsx import { CaptchaWidget } from "@dapplelight/signet-ui/screens/abuse-screens" import { useState } from "react" export function CaptchaWidgetDemo() { const [token, setToken] = useState(null) return (
{token ?? "no token yet"}
) } ```
## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add abuse-screens ``` ## Usage [#usage] ```tsx import { CaptchaWidget, AiSpendAdmin } from "@dapplelight/signet-ui/screens/abuse-screens" import { useState } from "react" const [token, setToken] = useState(null) ``` The demo uses `provider="test"`, so no script is loaded. Switch to `turnstile` or `hcaptcha` with a site key in production. ## Examples [#examples] ### CaptchaWidget [#captchawidget] ```tsx import { CaptchaWidget } from "@dapplelight/signet-ui/screens/abuse-screens" import { useState } from "react" export function CaptchaWidgetDemo() { const [token, setToken] = useState(null) return (
{token ?? "no token yet"}
) } ```
### AiSpendAdmin [#aispendadmin] ```tsx import { type AiSpendCap, AiSpendAdmin, type AiSpendOverview, UNITS_PER_USD } from "@dapplelight/signet-ui/screens/abuse-screens" import { useState } from "react" const initialCaps: AiSpendCap[] = [ { id: "c1", scope: "global", subject: "*", period: "month", units: usd(1000) }, { id: "c2", scope: "user", subject: "usr_9a3f", period: "day", units: usd(10) }, ] const usd = (n: number) => Math.round(n * UNITS_PER_USD) const overview: AiSpendOverview = { global: { scope: "global", subject: "*", day: { used: usd(18.42), cap: usd(50), remaining: usd(31.58) }, month: { used: usd(412.6), cap: usd(1000), remaining: usd(587.4) }, }, top: { users: [ { subject: "usr_9a3f", used: usd(64.2), cap: usd(100) }, { subject: "usr_41cc", used: usd(41.75), cap: null }, ], orgs: [{ subject: "org_northwind", used: usd(188.1), cap: usd(300) }], }, } export function AiSpendAdminDemo() { const [caps, setCaps] = useState(initialCaps) return (
{ setCaps((cs) => [ ...cs.filter((c) => !(c.scope === input.scope && c.subject === input.subject && c.period === input.period)), { id: `${input.scope}-${input.subject}-${input.period}`, ...input }, ]) }} onRemoveCap={(cap) => setCaps((cs) => cs.filter((c) => c.id !== cap.id))} />
) } ```
### AiSpendAdmin, read only [#aispendadmin-read-only] ```tsx import { type AiSpendCap, AiSpendAdmin, type AiSpendOverview, UNITS_PER_USD } from "@dapplelight/signet-ui/screens/abuse-screens" const initialCaps: AiSpendCap[] = [ { id: "c1", scope: "global", subject: "*", period: "month", units: usd(1000) }, { id: "c2", scope: "user", subject: "usr_9a3f", period: "day", units: usd(10) }, ] const usd = (n: number) => Math.round(n * UNITS_PER_USD) const overview: AiSpendOverview = { global: { scope: "global", subject: "*", day: { used: usd(18.42), cap: usd(50), remaining: usd(31.58) }, month: { used: usd(412.6), cap: usd(1000), remaining: usd(587.4) }, }, top: { users: [ { subject: "usr_9a3f", used: usd(64.2), cap: usd(100) }, { subject: "usr_41cc", used: usd(41.75), cap: null }, ], orgs: [{ subject: "org_northwind", used: usd(188.1), cap: usd(300) }], }, } export function AiSpendAdminReadOnlyDemo() { return (
) } ```
## API Reference [#api-reference] ### CaptchaWidget [#captchawidget-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `provider` | `"turnstile" \| "hcaptcha" \| "test"` | — | `test` loads nothing and reports the test token at once. | | `siteKey` | `string` | — | The provider's public site key. Not needed in test mode. | | `onToken` | `(token: string \| null) => void` | — | The token to send with the form; null when it expires. | | `onError` | `(error: unknown) => void` | — | Called when the script or widget fails. | | `theme` | `"light" \| "dark" \| "auto"` | — | Widget theme. | | `action` | `string` | — | Turnstile: the action the server's verifier expects. | | `scriptSrc` | `string` | — | Load the script from here instead, for a self-hosted copy. | | `labels` | `Partial` | — | Every string, in English by default. Spread `DEFAULT_CAPTCHA_LABELS` to translate. | ### AiSpendAdmin [#aispendadmin-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `overview` | `AiSpendOverview` | — | `GET /usage`: global day and month usage, top users and orgs. | | `caps` | `readonly AiSpendCap[]` | — | Rows of `GET /caps`. | | `onSetCap` | `(input: AiSpendCapInput) => unknown` | — | `PUT /caps`. Without it the screen is read-only. Return false or throw to show a failure. | | `onRemoveCap` | `(cap: AiSpendCap) => unknown` | — | `DELETE /caps/:scope/:subject/:period`. | | `format` | `(units: number) => string` | `formatUnits` | How cost units read. Default US dollars. | | `labels` | `Partial` | — | Every string, in English by default. Spread `DEFAULT_AI_SPEND_LABELS` to translate. | # Account Screens (/docs/components/account-screens) ```tsx import { Button } from "@dapplelight/signet-ui/components/button" import { ProfileCard } from "@dapplelight/signet-ui/screens/account-screens" import { useState } from "react" export function ProfileCardDemo() { const [name, setName] = useState("Asha Verma") return (
setName(patch.name)} action={} />
) } ```
## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add account-screens ``` ## Usage [#usage] ```tsx import { ProfileCard, SessionsList, SessionItem, ApiKeysManager, ApiKeyReveal, AccountSection, AccountSectionHeader } from "@dapplelight/signet-ui/screens/account-screens" import { sessions, revoke, revokeOthers } from "./sessions" ``` ## Examples [#examples] ### ProfileCard [#profilecard] ```tsx import { Button } from "@dapplelight/signet-ui/components/button" import { ProfileCard } from "@dapplelight/signet-ui/screens/account-screens" import { useState } from "react" export function ProfileCardDemo() { const [name, setName] = useState("Asha Verma") return (
setName(patch.name)} action={} />
) } ```
### SessionsList [#sessionslist] ```tsx import { type SessionRow, SessionsList } from "@dapplelight/signet-ui/screens/account-screens" import { useState } from "react" const hoursAgo = (h: number) => Date.now() - h * 3600_000 const initialSessions: SessionRow[] = [ { id: "s1", device: "Chrome on macOS", ip: "103.21.4.18", lastSeenAt: Date.now(), current: true }, { id: "s2", device: "Safari on iPhone", ip: "49.36.12.7", lastSeenAt: hoursAgo(3) }, { id: "s3", device: "Firefox on Windows", ip: "122.172.9.40", lastSeenAt: hoursAgo(72) }, ] export function SessionsListDemo() { const [sessions, setSessions] = useState(initialSessions) return (
setSessions((list) => list.filter((x) => x.id !== s.id))} onRevokeOthers={() => setSessions((list) => list.filter((x) => x.current))} />
) } ```
### SessionItem [#sessionitem] ```tsx import { SessionItem, type SessionRow } from "@dapplelight/signet-ui/screens/account-screens" const hoursAgo = (h: number) => Date.now() - h * 3600_000 const initialSessions: SessionRow[] = [ { id: "s1", device: "Chrome on macOS", ip: "103.21.4.18", lastSeenAt: Date.now(), current: true }, { id: "s2", device: "Safari on iPhone", ip: "49.36.12.7", lastSeenAt: hoursAgo(3) }, { id: "s3", device: "Firefox on Windows", ip: "122.172.9.40", lastSeenAt: hoursAgo(72) }, ] export function SessionItemDemo() { return (
    undefined} />
) } ```
### ApiKeysManager [#apikeysmanager] ```tsx import { type ApiKeyRow, ApiKeysManager } from "@dapplelight/signet-ui/screens/account-screens" import { useState } from "react" const hoursAgo = (h: number) => Date.now() - h * 3600_000 const initialKeys: ApiKeyRow[] = [ { id: "k1", name: "CI deploy", start: "app_1a2b3c", createdAt: hoursAgo(24 * 30), lastUsedAt: hoursAgo(2) }, { id: "k2", name: "Analytics export", start: "app_9f8e7d", createdAt: hoursAgo(24 * 90), lastUsedAt: null }, ] export function ApiKeysManagerDemo() { const [keys, setKeys] = useState(initialKeys) return (
{ const token = `app_${Math.random().toString(36).slice(2, 10)}${Math.random().toString(36).slice(2, 18)}` setKeys((list) => [ ...list, { id: token, name, start: token.slice(0, 10), createdAt: Date.now(), lastUsedAt: null }, ]) return { token } }} onRevoke={(key) => setKeys((list) => list.filter((k) => k.id !== key.id))} />
) } ```
### ApiKeyReveal [#apikeyreveal] ```tsx import { ApiKeyReveal } from "@dapplelight/signet-ui/screens/account-screens" export function ApiKeyRevealDemo() { return (
) } ```
### AccountSection and AccountSectionHeader [#accountsection-and-accountsectionheader] ```tsx import { Button } from "@dapplelight/signet-ui/components/button" import { AccountSection, AccountSectionHeader } from "@dapplelight/signet-ui/screens/account-screens" export function AccountSectionDemo() { return (
Edit} />

Weekly digest and billing emails go to asha@acme.example.

) } ```
## API Reference [#api-reference] ### ProfileCard [#profilecard-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `profile` | `Profile` | — | `name`, `email`, `phone`, `image`. | | `onSave` | `(patch: { name: string }) => unknown` | — | Save a new name. Without it the name is read-only. | | `action` | `ReactNode` | — | Shown beside the details, e.g. a Change photo button. | | `labels` | `Partial` | — | Every string, in English by default. Spread `DEFAULT_ACCOUNT_LABELS` to translate. | | `className` | `string` | — | Class for the root. | | `classNames` | `Partial>` | — | Classes per part. | ### SessionsList [#sessionslist-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `sessions` | `readonly SessionRow[]` | — | Rows of `sessionRoutes` GET; `current` marks this device. | | `onRevoke` | `(session: SessionRow) => unknown` | — | Sign out one device. | | `onRevokeOthers` | `() => unknown` | — | Sign out everywhere else. Confirms first. | | `locale` | `string` | `browser` | For relative times. | | `labels` | `Partial` | — | Every string, in English by default. Spread `DEFAULT_ACCOUNT_LABELS` to translate. | | `classNames` | `Partial>` | — | Classes per part. | ### SessionItem [#sessionitem-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `session` | `SessionRow` | — | The device row. | | `onRevoke` | `(session: SessionRow) => unknown` | — | Shows a sign-out button. | | `locale` | `string` | `browser` | For relative times. | | `labels` | `Partial` | — | Every string, in English by default. Spread `DEFAULT_ACCOUNT_LABELS` to translate. | ### ApiKeysManager [#apikeysmanager-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `keys` | `readonly ApiKeyRow[]` | — | Keys without their secrets. | | `onCreate` | `(input: { name: string }) => Promise<{ token: string }> \| { token: string }` | — | Mint a key. The token is shown once, then dropped. | | `onRevoke` | `(key: ApiKeyRow) => unknown` | — | Revoke a key. Confirms first. | | `locale` | `string` | `browser` | For relative times. | | `labels` | `Partial` | — | Every string, in English by default. Spread `DEFAULT_ACCOUNT_LABELS` to translate. | | `classNames` | `Partial>` | — | Classes per part. | ### ApiKeyReveal [#apikeyreveal-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `token` | `string` | — | The new key: read-only, selected on focus, with a copy button. | | `labels` | `Partial` | — | Every string, in English by default. Spread `DEFAULT_ACCOUNT_LABELS` to translate. | ### AccountSection [#accountsection] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `render` | `ReactElement \| (props, state) => ReactElement` | — | Swaps the `
` element. | | `className` | `string` | — | Merged over the card styles. | ### AccountSectionHeader [#accountsectionheader] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `title` | `ReactNode` | — | The section heading. | | `action` | `ReactNode` | — | Shown on the right. | | `id` | `string` | — | Id of the heading, for `aria-labelledby`. | # Action Row (/docs/components/action-row) ```tsx import { ActionRow } from "@dapplelight/signet-ui/components/action-row" import { Button } from "@dapplelight/signet-ui/components/button" import { GitMergeIcon } from "lucide-react" export function Demo() { return ( } title="Merge PR #482" description="CI passed and two people approved. Merging adds 3 commits to main." actions={ <> } /> ) } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add action-row ``` ## Usage [#usage] ```tsx import { ActionRow } from "@dapplelight/signet-ui/components/action-row" Approve} /> ``` On a screen narrower than `sm` the buttons move under the text, full width, and every Signet `Button` in the row is at least 44px tall. The row is a `group` named by its title. Keyboard focus is the Button's own ring. ## Examples [#examples] ### Answer a question [#answer-a-question] ```tsx import { ActionRow } from "@dapplelight/signet-ui/components/action-row" import { Button } from "@dapplelight/signet-ui/components/button" import { MessageCircleQuestionIcon } from "lucide-react" } title="Which database should the new service use?" description="The agent paused the setup and is waiting for your pick." actions={ <> } /> ``` ### Approve a deploy [#approve-a-deploy] ```tsx import { ActionRow } from "@dapplelight/signet-ui/components/action-row" import { Button } from "@dapplelight/signet-ui/components/button" import { RocketIcon } from "lucide-react" } title="Approve deploy to production" description="Build 9f3c2e1 failed one smoke test in staging. Approving ships it anyway." actions={ <> } /> ``` ## Customising [#customising] Five levels, use the lowest that does the job. 1. **Tokens.** The row reads `--color-bg-surface`, `--color-border-subtle`, `--color-primary` (ask) and `--color-accent-amber` (warn), plus `--radius-xl`. A theme changes it everywhere. 2. **Props and text.** `tone` (`neutral`, `ask`, `warn`), `icon`, `title`, `description`, `actions`. Every string is yours; there is no built-in copy. `warn` is amber, never red: red means destructive. 3. **className and data-\* hooks.** `className` and any `data-*` or `aria-*` prop go on the root. `classNames={{ icon, body, title, description, actions }}` styles one part. Style from CSS with `[data-slot=action-row]`, `[data-tone=warn]` and `[data-slot=action-row-title]`. 4. **Parts.** Build your own layout from `ActionRowRoot`, `ActionRowIcon`, `ActionRowBody`, `ActionRowTitle`, `ActionRowDescription` and `ActionRowActions`. 5. **Copy-in.** `signet add action-row` copies the file into your app to edit. ```tsx import { ActionRowActions, ActionRowBody, ActionRowDescription, ActionRowRoot, ActionRowTitle, } from "@dapplelight/signet-ui/components/action-row" Approve deploy Build 9f3c2e1 is ready. ``` ## API Reference [#api-reference] ### ActionRow [#actionrow] | Prop | Type | Default | Description | | --- | --- | --- | --- | | tone | `"neutral" \| "ask" \| "warn"` | `"neutral"` | `ask`: the app needs an answer. `warn`: needs a look, amber. | | icon | `ReactNode` | - | Leading icon. Decorative, hidden from screen readers. | | title | `ReactNode` | - | What waits on the user. | | description | `ReactNode` | - | One plain sentence under the title. | | actions | `ReactNode` | - | The buttons. Stack under the text on narrow screens. | | classNames | `{ icon?; body?; title?; description?; actions? }` | - | Class per part. | # Admin Screens (/docs/components/admin-screens) ```tsx import { createAdminApi, AdminScreen } from "@dapplelight/signet-ui/screens/admin-screens" const api = createAdminApi({ baseUrl: "/admin" }) export function AdminScreenDemo() { return } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add admin-screens ``` ## Usage [#usage] ```tsx import { AdminHeader, AdminMain, AdminNav, AdminPager, AdminPanel, AdminScreen, AdminTable, AdminToolbar, createAdminApi, } from "@dapplelight/signet-ui/screens/admin-screens" ``` The demos run on an in-memory `AdminApi`; in an app, use `createAdminApi({ baseUrl })` against signet-server's `adminRoutes`. Parts other than `AdminPanel` must sit inside it. ## Examples [#examples] ### AdminScreen [#adminscreen] ```tsx import { createAdminApi, AdminScreen } from "@dapplelight/signet-ui/screens/admin-screens" const api = createAdminApi({ baseUrl: "/admin" }) export function AdminScreenDemo() { return } ``` ### AdminPanel [#adminpanel] ```tsx import { createAdminApi, AdminHeader, AdminMain, AdminNav, AdminPager, AdminPanel, AdminTable, AdminToolbar } from "@dapplelight/signet-ui/screens/admin-screens" const api = createAdminApi({ baseUrl: "/admin" }) export function AdminPanelDemo() { return ( ) } ``` ### AdminToolbar [#admintoolbar] ```tsx import { createAdminApi, AdminPanel, AdminToolbar } from "@dapplelight/signet-ui/screens/admin-screens" const api = createAdminApi({ baseUrl: "/admin" }) export function AdminToolbarDemo() { return ( ) } ``` ### AdminFilterButton [#adminfilterbutton] ```tsx import { createAdminApi, AdminFilterButton, AdminPanel } from "@dapplelight/signet-ui/screens/admin-screens" const api = createAdminApi({ baseUrl: "/admin" }) export function AdminFilterButtonDemo() { return ( ) } ``` ### AdminRowActions [#adminrowactions] ```tsx import { createAdminApi, AdminPanel, AdminRowActions, useAdmin } from "@dapplelight/signet-ui/screens/admin-screens" const api = createAdminApi({ baseUrl: "/admin" }) function FirstRowActions() { const { page } = useAdmin() const row = page.rows[0] return row ? : null } export function AdminRowActionsDemo() { return ( ) } ``` ### AdminRecordForm [#adminrecordform] ```tsx import { createAdminApi, AdminPanel, AdminRecordForm } from "@dapplelight/signet-ui/screens/admin-screens" const api = createAdminApi({ baseUrl: "/admin" }) export function AdminRecordFormDemo() { return ( ) } ``` ### AdminAuditTrail [#adminaudittrail] ```tsx import { createAdminApi, AdminAuditTrail, AdminPanel } from "@dapplelight/signet-ui/screens/admin-screens" const api = createAdminApi({ baseUrl: "/admin" }) export function AdminAuditTrailDemo() { return ( ) } ``` ### AdminRecordSheet [#adminrecordsheet] ```tsx import { Button } from "@dapplelight/signet-ui/components/button" import { AdminPanel, AdminRecordSheet, type AdminRecordTarget, createAdminApi } from "@dapplelight/signet-ui/screens/admin-screens" import { useState } from "react" const api = createAdminApi({ baseUrl: "/admin" }) export function AdminRecordSheetDemo() { const [record, setRecord] = useState(null) return ( ) } ``` ## API Reference [#api-reference] ### AdminScreen [#adminscreen-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `api` | `AdminApi` | — | What the panel calls. `createAdminApi` implements it over HTTP. | | `meta` | `AdminMeta` | — | Metadata you already have; otherwise `api.meta()` is fetched. | | `table` | `string` | — | The open table (controlled). | | `defaultTable` | `string` | `first listable table` | Initial table. | | `onTableChange` | `(table: string) => void` | — | Called when the table changes. | | `record` | `AdminRecordTarget` | — | The open record (controlled): `{ id }`, `{ id: null }` for a new row, or `null`. | | `defaultRecord` | `AdminRecordTarget` | `null` | Initial record. | | `onRecordChange` | `(record: AdminRecordTarget) => void` | — | Called when a record opens or closes. | | `pageSize` | `number` | `25` | Rows per page. | | `labels` | `Partial` | — | Every string, in English by default. Spread `DEFAULT_ADMIN_LABELS` to translate. | | `renderCell` | `(args: { value; column; row }) => ReactNode` | — | Replaces a cell's rendering. Return undefined to keep the default. | | `renderField` | `(args: { column; value; onChange; id }) => ReactNode` | — | Replaces one field's control in the form. | | `classNames` | `Partial>` | — | Classes per part. | | `render` | `ReactElement` | — | Replaces the root element. | ### AdminPanel [#adminpanel-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `api` | `AdminApi` | — | What the panel calls. | | `meta` | `AdminMeta` | — | Metadata you already have. | | `table, defaultTable, onTableChange` | `string` | — | The open table, controlled or not. | | `record, defaultRecord, onRecordChange` | `AdminRecordTarget` | — | The open record, controlled or not. | | `pageSize` | `number` | `25` | Rows per page. | | `labels` | `Partial` | — | Every string. | | `children` | `ReactNode` | — | The parts, rendered inside a grid. Use `useAdmin()` in a custom part for the state. | ### AdminRecordForm [#adminrecordform-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `row` | `AdminRow` | — | The row being edited. Absent means create. | | `onSaved` | `(row: AdminRow) => void` | — | Called with the saved row. | | `renderField` | `(args: { column; value; onChange; id }) => ReactNode` | — | Replaces one field's control. | | `className` | `string` | — | Class for the form. | ### AdminAuditTrail [#adminaudittrail-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `table` | `string` | — | Table name of the row. | | `id` | `string` | — | Row id. | | `className` | `string` | — | Class for the list. | ### AdminRowActions [#adminrowactions-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `row` | `AdminRow` | — | The row the menu acts on. | | `className` | `string` | — | Class for the trigger. | ### AdminRecordSheet [#adminrecordsheet-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `renderField` | `(args: { column; value; onChange; id }) => ReactNode` | — | Replaces one field's control in the form. | | `className` | `string` | — | Class for the sheet. | ### AdminTable [#admintable] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `renderCell` | `(args: { value; column; row }) => ReactNode` | — | Replaces a cell's rendering. | | `render` | `ReactElement` | — | Replaces the root element. | ### AdminNav, AdminMain, AdminHeader, AdminToolbar, AdminPager, AdminFilterButton [#adminnav-adminmain-adminheader-admintoolbar-adminpager-adminfilterbutton] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `className` | `string` | — | Merged over the defaults. Except AdminFilterButton, each also takes `render`. | # Alert Dialog (/docs/components/alert-dialog) ```tsx import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from "@dapplelight/signet-ui/components/alert-dialog" import { Button } from "@dapplelight/signet-ui/components/button" export function Demo() { return ( }>Delete project Delete "Q4 Planning"? This permanently removes the project and its 38 tasks. This cannot be undone. Cancel Delete ) } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add alert-dialog ``` ## Usage [#usage] ```tsx import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from "@dapplelight/signet-ui/components/alert-dialog" import { Button } from "@dapplelight/signet-ui/components/button" }>Open Are you sure? This cannot be undone. Cancel Continue ``` ## Examples [#examples] ### Controlled [#controlled] ```tsx import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from "@dapplelight/signet-ui/components/alert-dialog" import { Button } from "@dapplelight/signet-ui/components/button" import { useState } from "react" const [open, setOpen] = useState(false) const [status, setStatus] = useState("Subscription active") { setOpen(next) if (!next && details.returnValue === "confirm") setStatus("Subscription cancelled") }} > }>Cancel subscription Cancel your Pro plan? You keep access until 30 Nov 2026. Keep plan Cancel plan ``` ### Async action [#async-action] ```tsx import { AlertDialogAction } from "@dapplelight/signet-ui/components/alert-dialog" import { refundOrders } from "./actions" { await refundOrders() }} > Refund ``` ## API Reference [#api-reference] ### AlertDialog [#alertdialog] Takes the options of the underlying alert dialog. It is always modal and an outside press never closes it. | Prop | Type | Default | Description | | --- | --- | --- | --- | | `open` | `boolean` | - | Controlled open state. | | `defaultOpen` | `boolean` | `false` | Initial state when uncontrolled. | | `onOpenChange` | `(open, details) => void` | - | `details.reason` says why, `details.returnValue` is the `value` of the button that closed it (`"confirm"` or `"cancel"`). | | `dismissible` | `boolean` | `true` | Whether Escape and Android's back gesture can close it. An outside press never does. | | `onDismissAttempt` | `(details) => void` | - | Runs when a dismissal was refused. | | `onOpenChangeComplete` | `(open: boolean) => void` | - | Runs after the open or close animation ends. | | `pendingAnnouncement` | `string` | `"Loading"` | What screen readers hear once an action has been pending for a second. | | `persistentElements` | `(Element \| string)[]` | - | Elements that stay usable while the page is inert. | | `controller` | `AlertDialogController` | - | Open, close and inspect it from anywhere (`createAlertDialogController()`). | ### AlertDialogTrigger [#alertdialogtrigger] Renders a `button`. Pass `render` to use your own element, such as a `Button`. Also takes `payload`, `shortcut` and `disabled`. ### AlertDialogContent [#alertdialogcontent] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `className` | `string` | - | Merged onto the dialog surface. | | `backdropClassName` | `string` | - | Merged onto the backdrop. | | `initialFocus` | `"auto" \| "content" \| "none" \| selector \| element \| function` | `"auto"` | Where focus goes on open. `"auto"` picks the first Close part, the safe answer. | | `finalFocus` | `"trigger" \| "none" \| selector \| element \| function` | `"trigger"` | Where focus returns on close. | | `keepMounted` | `boolean` | `false` | Keep it in the page, hidden, while closed. | ### AlertDialogHeader, AlertDialogFooter [#alertdialogheader-alertdialogfooter] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `className` | `string` | - | Merged last. | Plus every `div` prop. The footer stacks on phones and right-aligns from `sm` up. ### AlertDialogTitle, AlertDialogDescription [#alertdialogtitle-alertdialogdescription] Render an `h2` and a `p`. They name and describe the dialog for screen readers. ### AlertDialogAction [#alertdialogaction] The agreeing answer. Closes with `returnValue` `"confirm"`. | Prop | Type | Default | Description | | --- | --- | --- | --- | | `variant` | `default` \| `outline` \| `secondary` \| `ghost` \| `destructive` \| `link` | `default` | Button variant. | | `size` | Button size | - | Button size. | | `action` | `(event, details) => unknown` | - | Runs before closing. Return a Promise to keep the dialog open and the button pending until it settles. | | `value` | `string` | `"confirm"` | Reported as `returnValue`. | ### AlertDialogCancel [#alertdialogcancel] The safe answer. Put it first: it takes focus when the dialog opens. Closes with `returnValue` `"cancel"`. | Prop | Type | Default | Description | | --- | --- | --- | --- | | `variant` | Button variant | `outline` | Button variant. | | `size` | Button size | - | Button size. | | `action` | `(event, details) => unknown` | - | Runs before closing. | # Alert (/docs/components/alert) ```tsx import { Alert, AlertDescription, AlertTitle } from "@dapplelight/signet-ui/components/alert" import { InfoIcon } from "lucide-react" export function Demo() { return ( Invoice INV-2041 sent Acme Corp was emailed a payment link for $4,200.00. ) } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add alert ``` ## Usage [#usage] ```tsx import { Alert, AlertDescription, AlertTitle } from "@dapplelight/signet-ui/components/alert" Heads up Something worth reading. ``` ## Examples [#examples] ### Destructive [#destructive] ```tsx import { Alert, AlertDescription, AlertTitle } from "@dapplelight/signet-ui/components/alert" import { CircleAlertIcon } from "lucide-react" Payment failed The card ending 4242 was declined. Update it to keep your plan. ``` ### Warning [#warning] ```tsx import { Alert, AlertDescription, AlertTitle } from "@dapplelight/signet-ui/components/alert" import { AlertTriangleIcon } from "lucide-react" Usage at 92% You have used 9,200 of 10,000 API calls this month. ``` ### Without an icon [#without-an-icon] ```tsx import { Alert, AlertDescription, AlertTitle } from "@dapplelight/signet-ui/components/alert" Scheduled maintenance Reports will be unavailable on Sunday from 02:00 to 03:00 UTC. ``` ## Composition [#composition] ```tsx import { Alert, AlertDescription, AlertTitle } from "@dapplelight/signet-ui/components/alert" export function DeployAlerts() { return (
Deploy succeeded production · 41s · commit 9f3c2e1 Card declined Ask the customer for another payment method.
) } ```
## API Reference [#api-reference] ### Alert [#alert] | Prop | Type | Default | Required | Description | | --- | --- | --- | --- | --- | | `variant` | `"default" \| "destructive" \| "warning"` | `"default"` | No | Colour of the border, background and icon. | | `className` | `string` | — | No | Merged last. | Plus every native [`
`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div) attribute. Renders with `role="alert"`. A direct child `svg` is placed at the start and the text indents past it. ### AlertTitle [#alerttitle] | Prop | Type | Default | Required | Description | | --- | --- | --- | --- | --- | | `className` | `string` | — | No | Merged last. | Plus every native [`
`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements) attribute. ### AlertDescription [#alertdescription] | Prop | Type | Default | Required | Description | | --- | --- | --- | --- | --- | | `className` | `string` | — | No | Merged last. | Plus every native [`
`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div) attribute. # Amount (/docs/components/amount) ```tsx import { Amount } from "@dapplelight/signet-ui/domain/amount" export function AmountDemo() { return (
Revenue this month
) } ```
## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add amount ``` ## Usage [#usage] ```tsx import { Amount, formatAmount } from "@dapplelight/signet-ui/domain/amount" ``` ## Examples [#examples] ### Compact [#compact] ```tsx import { Amount } from "@dapplelight/signet-ui/domain/amount" export function AmountDemo() { return (
Revenue this month
) } ```
### Locales [#locales] ```tsx import { Amount } from "@dapplelight/signet-ui/domain/amount" export function AmountLocaleDemo() { return (
) } ```
### Tone [#tone] ```tsx import { Amount } from "@dapplelight/signet-ui/domain/amount" export function AmountToneDemo() { return (
) } ```
### Minor units [#minor-units] ```tsx import { Amount } from "@dapplelight/signet-ui/domain/amount" export function AmountMinorUnitsDemo() { return (
) } ```
### Lakh and crore [#lakh-and-crore] ```tsx import { Amount } from "@dapplelight/signet-ui/domain/amount" export function AmountCompactDemo() { return (
) } ```
### Parts [#parts] ```tsx import { Amount } from "@dapplelight/signet-ui/domain/amount" export function AmountPartsDemo() { return ( ) } ``` ## API Reference [#api-reference] ### Amount [#amount] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `value` | `number \| string \| bigint` | — | The amount. Use a bigint for exact minor units. | | `currency` | `string` | `"INR"` | ISO 4217 code. | | `locale` | `string` | `"en-IN"` | Indian locales group by lakh and crore. | | `minorUnits` | `boolean` | `false` | `value` is in paise or cents: 12345 INR is ₹123.45. | | `notation` | `"standard" \| "whole" \| "compact"` | `"standard"` | Standard shows the currency's decimals, whole none, compact shortens (₹12.5L, $1.3M). | | `decimals` | `number` | — | Overrides the number of decimals. In compact notation it is the maximum (default 1). | | `tone` | `"credit" \| "debit" \| "transfer" \| "auto"` | — | Colour from the theme's money slots. `auto` picks credit or debit from the sign. | | `signDisplay` | `Intl.NumberFormatOptions["signDisplay"]` | `"auto"` | Defaults to `exceptZero` when `tone` is `auto`, so the sign is never shown by colour alone. | | `classNames` | `Partial>` | — | Classes per part: `sign`, `currency`, `integer`, `fraction`, `compact`. | | `render` | `React.ReactElement` | — | Replaces the `` element, keeping props and parts. | | `title` | `string` | — | Compact amounts default to the full amount on hover. | ### formatAmount [#formatamount] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `value` | `AmountValue` | — | The amount to format. | | `options` | `Pick` | `{}` | Same options as the component. Returns `{ parts, major, sign }`, for table cells and chart labels. | # Answer Headline (/docs/components/answer-headline) ```tsx import { AnswerHeadline, type AnswerHeadlineData } from "@dapplelight/signet-ui/components/answer-headline" const onTrack: AnswerHeadlineData = { question: "Are we on track this month?", sentence: ["Yes. Revenue is ", { value: 48200 }, ", ", { value: 12 }, "% ahead of plan."], detail: ["Last month closed at ", { value: 43000 }, "."], tone: "good", } export function Demo() { return n.toLocaleString()} /> } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add answer-headline ``` ## Usage [#usage] ```tsx import { AnswerHeadline } from "@dapplelight/signet-ui/components/answer-headline" ``` ## Examples [#examples] ### Warn tone [#warn-tone] ```tsx import { AnswerHeadline, AnswerHeadlineData, } from "@dapplelight/signet-ui/components/answer-headline" const atRisk: AnswerHeadlineData = { question: "Can we cover payroll?", sentence: ["Cash covers payroll for ", { value: 5 }, " more weeks."], detail: ["Runway shortens if the Acme renewal slips past 30 Nov."], tone: "warn", } ``` ### Neutral tone [#neutral-tone] ```tsx import { AnswerHeadline } from "@dapplelight/signet-ui/components/answer-headline" ``` ### Custom value rendering [#custom-value-rendering] ```tsx import { AnswerHeadline } from "@dapplelight/signet-ui/components/answer-headline" import { onTrack } from "./headlines" `$${n.toLocaleString()}`} /> ``` ### With controls [#with-controls] ```tsx import { AnswerHeadline } from "@dapplelight/signet-ui/components/answer-headline" import { Button } from "@dapplelight/signet-ui/components/button" import { plain } from "./headlines"
```
## API Reference [#api-reference] ### AnswerHeadline [#answerheadline] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `headline` | `AnswerHeadlineData` | required | The question, sentence, optional detail and tone. | | `renderValue` | `(value: number) => ReactNode` | locale number, `••••••` when masked | Renders each `{ value }` segment. A custom one must mask itself. | | `className` | `string` | - | Merged last. | | `children` | `ReactNode` | - | Extra controls under the sentence, such as period pills or a link. | ### AnswerHeadlineData [#answerheadlinedata] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `question` | `string` | required | Small muted line above the sentence. Also the section's `aria-label`. | | `sentence` | `AnswerSegment[]` | required | Text, or `{ value: number }` rendered bold by `renderValue`. | | `detail` | `AnswerSegment[]` | - | Optional supporting line. | | `tone` | `neutral` \| `good` \| `warn` | required | `warn` renders amber. Never red, which means destructive. | Under the privacy mask, percentages in the text become `••%`. ### answerText [#answertext] `answerText(segments, format?)` returns the plain text of a sentence for aria-labels, notifications and tests. `format` defaults to the locale number format. # API Screens (/docs/components/api-screens) ```tsx import { ApiReference, type ApiSpec } from "@dapplelight/signet-ui/screens/api-screens" const spec: ApiSpec = { info: { title: "Orders API", version: "1.0.0" }, components: { securitySchemes: { bearer: { type: "http", scheme: "bearer" } } }, paths: { "/orders": { get: { operationId: "listOrders", summary: "List orders", tags: ["Orders"], security: [{ bearer: [] }], parameters: [ { name: "status", in: "query", description: "Filter by status", schema: { type: "string", enum: ["open", "paid", "refunded"] } }, { name: "limit", in: "query", schema: { type: "integer" } }, ], responses: { "200": { description: "A page of orders" } }, }, post: { operationId: "createOrder", summary: "Create an order", tags: ["Orders"], security: [{ bearer: [] }], requestBody: { content: { "application/json": { schema: { type: "object", properties: { customerId: { type: "string" }, amount: { type: "integer" } }, required: ["customerId", "amount"] }, }, }, }, responses: { "201": { description: "The new order" }, "422": { description: "Validation failed" } }, }, }, "/health": { get: { operationId: "health", summary: "Health check", tags: ["Status"], security: [], responses: { "200": { description: "OK" } } }, }, }, } export function ApiReferenceDemo() { return (
) } ```
## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add api-screens ``` ## Usage [#usage] ```tsx import { ApiReference, WebhookDeliveryLog } from "@dapplelight/signet-ui/screens/api-screens" import { spec } from "./spec" ``` ## Examples [#examples] ### ApiReference [#apireference] ```tsx import { ApiReference, type ApiSpec } from "@dapplelight/signet-ui/screens/api-screens" const spec: ApiSpec = { info: { title: "Orders API", version: "1.0.0" }, components: { securitySchemes: { bearer: { type: "http", scheme: "bearer" } } }, paths: { "/orders": { get: { operationId: "listOrders", summary: "List orders", tags: ["Orders"], security: [{ bearer: [] }], parameters: [ { name: "status", in: "query", description: "Filter by status", schema: { type: "string", enum: ["open", "paid", "refunded"] } }, { name: "limit", in: "query", schema: { type: "integer" } }, ], responses: { "200": { description: "A page of orders" } }, }, post: { operationId: "createOrder", summary: "Create an order", tags: ["Orders"], security: [{ bearer: [] }], requestBody: { content: { "application/json": { schema: { type: "object", properties: { customerId: { type: "string" }, amount: { type: "integer" } }, required: ["customerId", "amount"] }, }, }, }, responses: { "201": { description: "The new order" }, "422": { description: "Validation failed" } }, }, }, "/health": { get: { operationId: "health", summary: "Health check", tags: ["Status"], security: [], responses: { "200": { description: "OK" } } }, }, }, } export function ApiReferenceDemo() { return (
) } ```
### WebhookDeliveryLog [#webhookdeliverylog] ```tsx import { WebhookDeliveryLog, type WebhookStatusFilter } from "@dapplelight/signet-ui/screens/api-screens" import { useState } from "react" import { deliveries } from "./deliveries" export function WebhookDeliveryLogDemo() { const [status, setStatus] = useState("all") const shown = status === "all" ? deliveries : deliveries.filter((d) => d.status === status) return (
new Promise((r) => setTimeout(r, 500))} />
) } ```
## API Reference [#api-reference] ### ApiReference [#apireference-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `spec` | `ApiSpec` | — | The parts of an OpenAPI 3.1 document the reference reads. | | `defaultOpen` | `string[]` | `[]` | Operations whose `operationId` is here start open. | | `labels` | `Partial` | — | Every string, in English by default. Spread `DEFAULT_API_LABELS` to translate. | ### WebhookDeliveryLog [#webhookdeliverylog-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `deliveries` | `WebhookDeliveryEntry[]` | — | Rows of signet-db's webhook delivery log. | | `endpoints` | `Record` | `{}` | Endpoint id to URL, to show where each went. | | `status` | `WebhookStatusFilter` | — | Controlled filter: `all`, `failed`, `retrying` or `delivered`. | | `defaultStatus` | `WebhookStatusFilter` | `"all"` | Initial filter when uncontrolled. | | `onStatusChange` | `(status: WebhookStatusFilter) => void` | — | Called on a filter change, e.g. to refetch. | | `onRedeliver` | `(delivery: WebhookDeliveryEntry) => unknown \| Promise` | — | Shown on failed, retrying and skipped deliveries. | | `onLoadMore` | `() => void` | — | Called by the Load more button. | | `hasMore` | `boolean` | — | Shows the Load more button. | | `formatTime` | `(d: Date) => string` | `toLocaleString` | Format a timestamp. | | `labels` | `Partial` | — | Every string, in English by default. Spread `DEFAULT_API_LABELS` to translate. | # Auth Screens (/docs/components/auth-screens) ```tsx import { AuthScreen } from "@dapplelight/signet-ui/screens/auth-screens" const wait = (ms: number) => new Promise((r) => setTimeout(r, ms)) const providers = [{ id: "google", label: "Google" }] export function AuthScreenDemo() { return ( wait(500)} onRequestCode={() => wait(500)} onVerify={async ({ code }) => { await wait(400) if (code !== "123456") throw new Error("That code is wrong. Try 123456.") }} footer={

By continuing you accept the terms.

} /> ) } ```
## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add auth-screens ``` ## Usage [#usage] ```tsx import { AuthScreen, VerifyCodeScreen, SessionExpiredScreen } from "@dapplelight/signet-ui/screens/auth-screens" import { sendCode, verify } from "./auth" ``` ## Examples [#examples] ### AuthScreen [#authscreen] ```tsx import { AuthScreen } from "@dapplelight/signet-ui/screens/auth-screens" const wait = (ms: number) => new Promise((r) => setTimeout(r, ms)) const providers = [{ id: "google", label: "Google" }] export function AuthScreenDemo() { return ( wait(500)} onRequestCode={() => wait(500)} onVerify={async ({ code }) => { await wait(400) if (code !== "123456") throw new Error("That code is wrong. Try 123456.") }} footer={

By continuing you accept the terms.

} /> ) } ```
### VerifyCodeScreen [#verifycodescreen] ```tsx import { VerifyCodeScreen } from "@dapplelight/signet-ui/screens/auth-screens" const wait = (ms: number) => new Promise((r) => setTimeout(r, ms)) const providers = [{ id: "google", label: "Google" }] export function VerifyCodeScreenDemo() { return ( undefined} onVerify={async (code) => { await wait(400) if (code !== "123456") throw new Error("That code is wrong. Try 123456.") }} onResend={() => wait(300)} resendAfterSeconds={10} /> ) } ``` ### SessionExpiredScreen [#sessionexpiredscreen] ```tsx import { SessionExpiredScreen } from "@dapplelight/signet-ui/screens/auth-screens" import { useState } from "react" export function SessionExpiredScreenDemo() { const [clicks, setClicks] = useState(0) return (
setClicks((n) => n + 1)} />

Sign-in requested {clicks} times

) } ```
### CodeRequestForm [#coderequestform] ```tsx import { CodeRequestForm } from "@dapplelight/signet-ui/screens/auth-screens" const wait = (ms: number) => new Promise((r) => setTimeout(r, ms)) const providers = [{ id: "google", label: "Google" }] export function CodeRequestFormDemo() { return (
wait(500)} />
) } ```
### VerifyCodeForm [#verifycodeform] ```tsx import { VerifyCodeForm } from "@dapplelight/signet-ui/screens/auth-screens" const wait = (ms: number) => new Promise((r) => setTimeout(r, ms)) const providers = [{ id: "google", label: "Google" }] export function VerifyCodeFormDemo() { return (
{ await wait(300) if (code !== "1234") throw new Error("Try 1234.") }} onResend={() => wait(300)} />
) } ```
### OAuthButtons [#oauthbuttons] ```tsx import { OAuthButtons } from "@dapplelight/signet-ui/screens/auth-screens" const wait = (ms: number) => new Promise((r) => setTimeout(r, ms)) const providers = [{ id: "google", label: "Google" }] export function OAuthButtonsDemo() { return (
wait(800)} />
) } ```
### AuthCard, AuthHeader, AuthDivider and AuthError [#authcard-authheader-authdivider-and-autherror] ```tsx import { Button } from "@dapplelight/signet-ui/components/button" import { AuthCard, AuthDivider, AuthError, AuthHeader } from "@dapplelight/signet-ui/screens/auth-screens" export function AuthPartsDemo() { return ( or That email is already registered. ) } ``` ## API Reference [#api-reference] ### AuthScreen [#authscreen-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `mode` | `"sign-in" \| "sign-up"` | — | Controlled mode. | | `defaultMode` | `"sign-in" \| "sign-up"` | `"sign-in"` | Initial mode. | | `onModeChange` | `(mode: AuthMode) => void` | — | Called when the mode changes. | | `channels` | `readonly AuthChannel[]` | `["email", "phone"]` | Code channels to offer, in order. Empty for OAuth only. | | `channel` | `"email" \| "phone"` | — | Selected channel, controlled. | | `defaultChannel` | `"email" \| "phone"` | `first channel` | Initial channel. | | `onChannelChange` | `(channel: AuthChannel) => void` | — | Called when the channel changes. | | `onRequestCode` | `(request: CodeRequest) => unknown` | — | Send a code. Throw to show an error. | | `onVerify` | `(request: CodeRequest & { code: string }) => unknown` | — | Check the code and start the session. | | `providers` | `readonly OAuthProvider[]` | `[]` | OAuth buttons: `id`, `label`, `icon`. | | `onOAuth` | `(provider: OAuthProvider, mode: AuthMode) => unknown` | — | Start the OAuth flow. | | `logo` | `ReactNode` | — | Shown above the title. | | `footer` | `ReactNode` | — | Under the form: terms, a privacy link. | | `codeLength` | `number` | `6` | Digits in the code. | | `resendAfterSeconds` | `number` | `30` | Seconds before Resend unlocks. | | `hideModeSwitch` | `boolean` | — | Hide the New here / Have an account switch. | | `labels` | `Partial` | — | Every string, in English by default. Spread `DEFAULT_AUTH_LABELS` to translate. | | `classNames` | `Partial>` | — | Classes per part. | ### VerifyCodeScreen [#verifycodescreen-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `channel` | `"email" \| "phone"` | `"email"` | Picks the icon and title. | | `to` | `string` | — | Where the code went, shown as you pass it (mask it first). | | `onBack` | `() => void` | — | Shows a Change link back to the previous step. | | `logo` | `ReactNode` | — | Replaces the icon. | | `onVerify` | `(code: string) => unknown` | — | Check the code. | | `onResend` | `() => unknown` | — | Resend the code. | | `length` | `number` | `6` | Digits in the code. | | `resendAfterSeconds` | `number` | `30` | Seconds before Resend unlocks; 0 unlocks at once. | | `labels` | `Partial` | — | Every string, in English by default. Spread `DEFAULT_AUTH_LABELS` to translate. | ### SessionExpiredScreen [#sessionexpiredscreen-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `onSignIn` | `() => unknown` | — | Called by the Sign in again button. | | `logo` | `ReactNode` | — | Replaces the clock icon. | | `labels` | `Partial` | — | Every string, in English by default. Spread `DEFAULT_AUTH_LABELS` to translate. | ### CodeRequestForm [#coderequestform-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `channel` | `"email" \| "phone"` | — | Which field to show. | | `onSubmit` | `(to: string) => unknown` | — | Send the code. | | `defaultValue` | `string` | — | Initial address. | | `labels` | `Partial` | — | Every string, in English by default. Spread `DEFAULT_AUTH_LABELS` to translate. | ### VerifyCodeForm [#verifycodeform-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `onVerify` | `(code: string) => unknown` | — | Called when the code is full or submitted. | | `onResend` | `() => unknown` | — | Resend the code. | | `length` | `number` | `6` | Digits in the code. | | `resendAfterSeconds` | `number` | `30` | Seconds before Resend unlocks. | | `labels` | `Partial` | — | Every string, in English by default. Spread `DEFAULT_AUTH_LABELS` to translate. | ### OAuthButtons [#oauthbuttons-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `providers` | `readonly OAuthProvider[]` | — | One button each. | | `onSelect` | `(provider: OAuthProvider) => unknown` | — | May redirect away; a returned Promise keeps the button pending. | | `labels` | `Partial` | — | Every string, in English by default. Spread `DEFAULT_AUTH_LABELS` to translate. | ### AuthHeader [#authheader] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `title` | `ReactNode` | — | The heading. | | `description` | `ReactNode` | — | Text under the heading. | | `icon` | `ReactNode` | — | An icon or your logo, above the title. | ### AuthCard, AuthDivider, AuthError [#authcard-authdivider-autherror] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `className` | `string` | — | Merged over the defaults. AuthCard also takes `render` to swap its element. | # Avatar (/docs/components/avatar) ```tsx import { Avatar, AvatarFallback, AvatarImage } from "@dapplelight/signet-ui/components/avatar" export function Demo() { return ( PN ) } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add avatar ``` ## Usage [#usage] ```tsx import { Avatar, AvatarFallback, AvatarImage } from "@dapplelight/signet-ui/components/avatar" PN ``` ## Examples [#examples] ### Size [#size] ```tsx import { Avatar, AvatarFallback } from "@dapplelight/signet-ui/components/avatar" PN PN PN ``` ### Initials [#initials] ```tsx import { Avatar, AvatarFallback, initials } from "@dapplelight/signet-ui/components/avatar" {["Priya Nair", "Marcus Chen", "Sofia Alvarez"].map((name) => ( {initials(name)} ))} ``` ### Group [#group] ```tsx import { Avatar, AvatarFallback } from "@dapplelight/signet-ui/components/avatar" import { team, initials } from "./team"
{team.map((name) => ( {initials(name)} ))}
```
## API Reference [#api-reference] ### Avatar [#avatar] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `size` | `sm` \| `default` \| `lg` | `default` | 24px, 32px or 40px. | | `className` | `string` | - | Merged last. | ### AvatarImage [#avatarimage] A real `img` the browser can fetch before hydration. Takes every `img` prop. The fallback shows until it loads, or if it fails. ### AvatarFallback [#avatarfallback] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `className` | `string` | - | Merged last. | ### initials [#initials-1] `initials(name: string): string` turns `"Ada Lovelace"` into `"AL"` and `"grace"` into `"G"`. At most two letters. `avatarVariants` is exported too, for styling your own element like an avatar. # Badge (/docs/components/badge) ```tsx import { Badge } from "@dapplelight/signet-ui/components/badge" export function Demo() { return Paid } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add badge ``` ## Usage [#usage] ```tsx import { Badge } from "@dapplelight/signet-ui/components/badge" Draft ``` ## Examples [#examples] ### Variants [#variants] ```tsx import { Badge } from "@dapplelight/signet-ui/components/badge" Default Secondary Overdue Draft Ghost Link ``` ### With icon [#with-icon] ```tsx import { Badge } from "@dapplelight/signet-ui/components/badge" import { CheckIcon } from "lucide-react" Verified ``` ### As a link [#as-a-link] ```tsx import { Badge } from "@dapplelight/signet-ui/components/badge" }>12 open invoices ``` ## API Reference [#api-reference] ### Badge [#badge] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `variant` | `default` \| `secondary` \| `destructive` \| `outline` \| `ghost` \| `link` | `default` | Visual style. | | `render` | `ReactElement \| function` | - | Render as another element, such as a link. | | `className` | `string` | - | Merged last. | Renders a `span` and accepts every `span` prop. Set `data-icon="inline-start"` or `"inline-end"` on an icon to tighten the padding on that side. `badgeVariants` is exported for styling your own element. # Billing Screens (/docs/components/billing-screens) ```tsx import { type BillingInvoice, type BillingPlan, BillingScreen, type BillingSubscription, type BillingUsage } from "@dapplelight/signet-ui/screens/billing-screens" const invoices: BillingInvoice[] = [ { id: "i3", number: "INV-2026-0003", date: new Date(Date.now() - 5 * 86400_000), total: 49900, currency: "INR", status: "paid", href: "#" }, { id: "i2", number: "INV-2026-0002", date: new Date(Date.now() - 35 * 86400_000), total: 49900, currency: "INR", status: "paid", href: "#" }, { id: "i1", number: "INV-2026-0001", date: new Date(Date.now() - 65 * 86400_000), total: 49900, currency: "INR", status: "refunded", href: "#" }, ] const usage: BillingUsage[] = [ { key: "projects", period: "total", used: 41, limit: 50, remaining: 9 }, { key: "seats", period: "total", used: 4, limit: 10, remaining: 6 }, { key: "api_calls", period: "month", used: 9400, limit: 10000, remaining: 600 }, ] const subscription: BillingSubscription = { plan: "pro", status: "active", currentPeriodEnd: new Date(Date.now() + 18 * 86400_000), source: { gateway: "web" }, } const plans: BillingPlan[] = [ { key: "free", name: "Free", description: "For trying things out", features: ["basic_reports"], limits: { projects: 3 }, prices: { month: { amount: 0, currency: "INR" } }, }, { key: "pro", name: "Pro", description: "For growing teams", badge: "Popular", features: ["basic_reports", "priority_support"], limits: { projects: 50, seats: 10 }, prices: { month: { amount: 49900, currency: "INR" }, year: { amount: 499000, currency: "INR" } }, }, { key: "business", name: "Business", description: "For the whole company", features: ["basic_reports", "priority_support", "sso"], limits: { projects: null, seats: null }, prices: { month: { amount: 149900, currency: "INR" }, year: { amount: 1499000, currency: "INR" } }, }, ] const wait = (ms: number) => new Promise((r) => setTimeout(r, ms)) export function BillingScreenDemo() { return (
undefined }} onSubscribe={() => wait(800)} onManage={() => undefined} />
) } ```
## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add billing-screens ``` ## Usage [#usage] ```tsx import { BillingScreen, PlanPicker, CurrentPlanCard, UsageMeters, InvoiceList, WalletCard, Paywall, RestorePurchasesButton } from "@dapplelight/signet-ui/screens/billing-screens" import { plans, subscription, usage, invoices, checkout } from "./billing" ``` `plansFromEntitlements(plans, display)` builds the plan list from a `definePlans` object, and `formatMoney(amount, currency)` formats minor units. ## Examples [#examples] ### BillingScreen [#billingscreen] ```tsx import { type BillingInvoice, type BillingPlan, BillingScreen, type BillingSubscription, type BillingUsage } from "@dapplelight/signet-ui/screens/billing-screens" const invoices: BillingInvoice[] = [ { id: "i3", number: "INV-2026-0003", date: new Date(Date.now() - 5 * 86400_000), total: 49900, currency: "INR", status: "paid", href: "#" }, { id: "i2", number: "INV-2026-0002", date: new Date(Date.now() - 35 * 86400_000), total: 49900, currency: "INR", status: "paid", href: "#" }, { id: "i1", number: "INV-2026-0001", date: new Date(Date.now() - 65 * 86400_000), total: 49900, currency: "INR", status: "refunded", href: "#" }, ] const usage: BillingUsage[] = [ { key: "projects", period: "total", used: 41, limit: 50, remaining: 9 }, { key: "seats", period: "total", used: 4, limit: 10, remaining: 6 }, { key: "api_calls", period: "month", used: 9400, limit: 10000, remaining: 600 }, ] const subscription: BillingSubscription = { plan: "pro", status: "active", currentPeriodEnd: new Date(Date.now() + 18 * 86400_000), source: { gateway: "web" }, } const plans: BillingPlan[] = [ { key: "free", name: "Free", description: "For trying things out", features: ["basic_reports"], limits: { projects: 3 }, prices: { month: { amount: 0, currency: "INR" } }, }, { key: "pro", name: "Pro", description: "For growing teams", badge: "Popular", features: ["basic_reports", "priority_support"], limits: { projects: 50, seats: 10 }, prices: { month: { amount: 49900, currency: "INR" }, year: { amount: 499000, currency: "INR" } }, }, { key: "business", name: "Business", description: "For the whole company", features: ["basic_reports", "priority_support", "sso"], limits: { projects: null, seats: null }, prices: { month: { amount: 149900, currency: "INR" }, year: { amount: 1499000, currency: "INR" } }, }, ] const wait = (ms: number) => new Promise((r) => setTimeout(r, ms)) export function BillingScreenDemo() { return (
undefined }} onSubscribe={() => wait(800)} onManage={() => undefined} />
) } ```
### PlanPicker [#planpicker] ```tsx import { type BillingPlan, PlanPicker } from "@dapplelight/signet-ui/screens/billing-screens" const plans: BillingPlan[] = [ { key: "free", name: "Free", description: "For trying things out", features: ["basic_reports"], limits: { projects: 3 }, prices: { month: { amount: 0, currency: "INR" } }, }, { key: "pro", name: "Pro", description: "For growing teams", badge: "Popular", features: ["basic_reports", "priority_support"], limits: { projects: 50, seats: 10 }, prices: { month: { amount: 49900, currency: "INR" }, year: { amount: 499000, currency: "INR" } }, }, { key: "business", name: "Business", description: "For the whole company", features: ["basic_reports", "priority_support", "sso"], limits: { projects: null, seats: null }, prices: { month: { amount: 149900, currency: "INR" }, year: { amount: 1499000, currency: "INR" } }, }, ] const wait = (ms: number) => new Promise((r) => setTimeout(r, ms)) export function PlanPickerDemo() { return (
wait(800)} />
) } ```
### CurrentPlanCard [#currentplancard] ```tsx import { type BillingPlan, type BillingSubscription, CurrentPlanCard } from "@dapplelight/signet-ui/screens/billing-screens" const subscription: BillingSubscription = { plan: "pro", status: "active", currentPeriodEnd: new Date(Date.now() + 18 * 86400_000), source: { gateway: "web" }, } const plans: BillingPlan[] = [ { key: "free", name: "Free", description: "For trying things out", features: ["basic_reports"], limits: { projects: 3 }, prices: { month: { amount: 0, currency: "INR" } }, }, { key: "pro", name: "Pro", description: "For growing teams", badge: "Popular", features: ["basic_reports", "priority_support"], limits: { projects: 50, seats: 10 }, prices: { month: { amount: 49900, currency: "INR" }, year: { amount: 499000, currency: "INR" } }, }, { key: "business", name: "Business", description: "For the whole company", features: ["basic_reports", "priority_support", "sso"], limits: { projects: null, seats: null }, prices: { month: { amount: 149900, currency: "INR" }, year: { amount: 1499000, currency: "INR" } }, }, ] export function CurrentPlanCardDemo() { return (
undefined} />
) } ```
### UsageMeters [#usagemeters] ```tsx import { type BillingUsage, UsageMeters } from "@dapplelight/signet-ui/screens/billing-screens" const usage: BillingUsage[] = [ { key: "projects", period: "total", used: 41, limit: 50, remaining: 9 }, { key: "seats", period: "total", used: 4, limit: 10, remaining: 6 }, { key: "api_calls", period: "month", used: 9400, limit: 10000, remaining: 600 }, ] export function UsageMetersDemo() { return (
) } ```
### InvoiceList [#invoicelist] ```tsx import { type BillingInvoice, InvoiceList } from "@dapplelight/signet-ui/screens/billing-screens" const invoices: BillingInvoice[] = [ { id: "i3", number: "INV-2026-0003", date: new Date(Date.now() - 5 * 86400_000), total: 49900, currency: "INR", status: "paid", href: "#" }, { id: "i2", number: "INV-2026-0002", date: new Date(Date.now() - 35 * 86400_000), total: 49900, currency: "INR", status: "paid", href: "#" }, { id: "i1", number: "INV-2026-0001", date: new Date(Date.now() - 65 * 86400_000), total: 49900, currency: "INR", status: "refunded", href: "#" }, ] export function InvoiceListDemo() { return (
) } ```
### WalletCard [#walletcard] ```tsx import { WalletCard } from "@dapplelight/signet-ui/screens/billing-screens" export function WalletCardDemo() { return (
undefined} />
) } ```
### Paywall [#paywall] ```tsx import { type BillingPlan, Paywall } from "@dapplelight/signet-ui/screens/billing-screens" const plans: BillingPlan[] = [ { key: "free", name: "Free", description: "For trying things out", features: ["basic_reports"], limits: { projects: 3 }, prices: { month: { amount: 0, currency: "INR" } }, }, { key: "pro", name: "Pro", description: "For growing teams", badge: "Popular", features: ["basic_reports", "priority_support"], limits: { projects: 50, seats: 10 }, prices: { month: { amount: 49900, currency: "INR" }, year: { amount: 499000, currency: "INR" } }, }, { key: "business", name: "Business", description: "For the whole company", features: ["basic_reports", "priority_support", "sso"], limits: { projects: null, seats: null }, prices: { month: { amount: 149900, currency: "INR" }, year: { amount: 1499000, currency: "INR" } }, }, ] const wait = (ms: number) => new Promise((r) => setTimeout(r, ms)) export function PaywallDemo() { return (
wait(800)} />
) } ```
### RestorePurchasesButton [#restorepurchasesbutton] ```tsx import { RestorePurchasesButton } from "@dapplelight/signet-ui/screens/billing-screens" const wait = (ms: number) => new Promise((r) => setTimeout(r, ms)) export function RestorePurchasesButtonDemo() { return wait(800)} /> } ``` ## API Reference [#api-reference] ### BillingScreen [#billingscreen-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `plans` | `readonly BillingPlan[]` | — | Plans to show. Build them with `plansFromEntitlements`. | | `subscription` | `BillingSubscription` | — | Pass `ent.resolve(subject)` as it is. | | `usage` | `readonly BillingUsage[]` | — | One meter per limit. | | `invoices` | `readonly BillingInvoice[]` | — | Invoices, newest first. | | `wallet` | `{ balance: number; currency: string; onTopUp?: () => void }` | — | Shows a wallet card. | | `source` | `BillingSource` | `"web"` | Where the app runs. Plans not sold there are hidden. | | `onSubscribe` | `(plan: BillingPlan, interval: BillingInterval) => unknown` | — | Start checkout or the store purchase. | | `onManage` | `() => void` | — | Shows a Manage button. | | `onRestore` | `() => Promise \| unknown` | — | Restore store purchases. | | `labels` | `Partial` | — | Every string, in English by default. Spread `DEFAULT_BILLING_LABELS` to translate. | | `classNames` | `Partial>` | — | Classes per part. | ### PlanPicker [#planpicker-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `plans` | `readonly BillingPlan[]` | — | Plan cards: `key`, `name`, `description`, `features`, `limits`, `prices`, `badge`, `sources`. | | `value` | `string` | — | Selected plan key (controlled). | | `defaultValue` | `string` | — | Initial plan key. | | `onValueChange` | `(plan: string) => void` | — | Called when the selection changes. | | `interval` | `"month" \| "year" \| "once"` | — | Billing interval (controlled). | | `defaultInterval` | `BillingInterval` | — | Initial interval. | | `onIntervalChange` | `(interval: BillingInterval) => void` | — | Called when the interval changes. | | `currentPlan` | `string` | — | The subscriber's plan key: marked, and its button is disabled. | | `source` | `BillingSource` | `"web"` | Where this purchase happens. Plans not sold there are hidden. | | `onSubscribe` | `(plan: BillingPlan, interval: BillingInterval) => unknown` | — | A returned Promise keeps the button pending. | | `labels` | `Partial` | — | Every string, in English by default. Spread `DEFAULT_BILLING_LABELS` to translate. | | `classNames` | `Partial>` | — | Classes per part. | ### CurrentPlanCard [#currentplancard-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `subscription` | `BillingSubscription` | — | `plan`, `status`, `currentPeriodEnd`, `graceUntil`, `source`. | | `plans` | `readonly BillingPlan[]` | `[]` | Used to show the plan's name. | | `onManage` | `() => void` | — | Shows a Manage button. | | `onRestore` | `() => Promise \| unknown` | — | Shown when the subscription came from a store. | | `source` | `BillingSource` | — | Where the app runs. A store here shows Restore even without a subscription. | | `labels` | `Partial` | — | Every string, in English by default. Spread `DEFAULT_BILLING_LABELS` to translate. | ### UsageMeters [#usagemeters-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `usage` | `readonly BillingUsage[]` | — | One bar per limit; amber at 75%, red at 90%. | | `labels` | `Partial` | — | Every string, in English by default. Spread `DEFAULT_BILLING_LABELS` to translate. | ### InvoiceList [#invoicelist-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `invoices` | `readonly BillingInvoice[]` | — | Each opens its GST HTML invoice in a new tab. | | `labels` | `Partial` | — | Every string, in English by default. Spread `DEFAULT_BILLING_LABELS` to translate. | ### WalletCard [#walletcard-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `balance` | `number` | — | In minor units. | | `currency` | `string` | — | ISO 4217 code. | | `onTopUp` | `() => void` | — | Shows a top-up button. | | `labels` | `Partial` | — | Every string, in English by default. Spread `DEFAULT_BILLING_LABELS` to translate. | ### Paywall [#paywall-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `title` | `ReactNode` | `labels.paywallTitle` | Headline. | | `subtitle` | `ReactNode` | `labels.paywallSubtitle` | Text under the headline. | | `onRestore` | `() => Promise \| unknown` | — | In a store build (`source` is `appstore` or `googleplay`), shows Restore. | | `...PlanPickerProps` | `PlanPickerProps` | — | Every PlanPicker prop is passed through. | ### RestorePurchasesButton [#restorepurchasesbutton-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `onRestore` | `() => Promise \| unknown` | — | Ask the store and re-apply purchases. Resolve false when nothing was found. | | `labels` | `Partial` | — | Every string, in English by default. Spread `DEFAULT_BILLING_LABELS` to translate. | # Breadcrumb (/docs/components/breadcrumb) ```tsx import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from "@dapplelight/signet-ui/components/breadcrumb" export function Demo() { return ( Home Invoices INV-2041 ) } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add breadcrumb ``` ## Usage [#usage] ```tsx import { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from "@dapplelight/signet-ui/components/breadcrumb" Home Invoices ``` ## Examples [#examples] ### Custom separator [#custom-separator] ```tsx import { BreadcrumbSeparator } from "@dapplelight/signet-ui/components/breadcrumb" import { SlashIcon } from "lucide-react" ``` ### Collapsed [#collapsed] ```tsx import { BreadcrumbEllipsis, BreadcrumbItem } from "@dapplelight/signet-ui/components/breadcrumb" ``` ## API Reference [#api-reference] ### Breadcrumb [#breadcrumb] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `aria-label` | `string` | `"Breadcrumb"` | Name of the nav landmark. | Renders a `nav`. ### BreadcrumbList, BreadcrumbItem [#breadcrumblist-breadcrumbitem] Render an `ol` and an `li`. Both take `className` and every element prop. ### BreadcrumbLink [#breadcrumblink] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `render` | `ReactElement` | - | Use the router's link element instead of an `a`. Its props are merged in. | | `className` | `string` | - | Merged last. | Plus every `a` prop. ### BreadcrumbPage [#breadcrumbpage] The current page. A `span` with `aria-current="page"`, not a link. ### BreadcrumbSeparator [#breadcrumbseparator] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `children` | `ReactNode` | chevron icon | Replaces the separator icon. | Renders an `li` hidden from assistive tech. ### BreadcrumbEllipsis [#breadcrumbellipsis] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `label` | `string` | `"More"` | Screen reader text. | # Button (/docs/components/button) ```tsx import { Button } from "@dapplelight/signet-ui/components/button" export function Demo() { return ( <> ) } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add button ``` ## Usage [#usage] ```tsx import { Button } from "@dapplelight/signet-ui/components/button" ``` ## Examples [#examples] ### Default [#default] ```tsx import { Button } from "@dapplelight/signet-ui/components/button" ``` ### Outline [#outline] ```tsx import { Button } from "@dapplelight/signet-ui/components/button" ``` ### Secondary [#secondary] ```tsx import { Button } from "@dapplelight/signet-ui/components/button" ``` ### Ghost [#ghost] ```tsx import { Button } from "@dapplelight/signet-ui/components/button" ``` ### Destructive [#destructive] ```tsx import { Button } from "@dapplelight/signet-ui/components/button" ``` ### Link [#link] ```tsx import { Button } from "@dapplelight/signet-ui/components/button" ``` ### Size [#size] ```tsx import { Button } from "@dapplelight/signet-ui/components/button" ``` ### Disabled [#disabled] ```tsx import { Button } from "@dapplelight/signet-ui/components/button" ``` ## Composition [#composition] ```tsx import { Button } from "@dapplelight/signet-ui/components/button" import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@dapplelight/signet-ui/components/card" import { Input } from "@dapplelight/signet-ui/components/input" import { Label } from "@dapplelight/signet-ui/components/label" export function SignUpCard() { return ( Create your account Sign in with a magic link. No password. ) } ``` ## API Reference [#api-reference] | Prop | Type | Default | Required | Description | | --- | --- | --- | --- | --- | | `variant` | `"default" \| "outline" \| "secondary" \| "ghost" \| "destructive" \| "link"` | `"default"` | No | Colour and emphasis. | | `size` | `"default" \| "xs" \| "sm" \| "lg" \| "touch" \| "icon" \| "icon-xs" \| "icon-sm" \| "icon-lg" \| "icon-touch"` | `"default"` | No | Height and padding. `touch` sizes are 44px for phones. Icon-only sizes need `aria-label`. | | `className` | `string` | — | No | Merged last. | Plus every native [`

Priya Nair, Marcus Chen, Sofia Alvarez and 5 others.

``` ### Footer [#footer] ```tsx import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from "@dapplelight/signet-ui/components/card" import { Button } from "@dapplelight/signet-ui/components/button" Invoice INV-2041 Acme Corp, due 30 Nov 2026

$4,200.00

```
### Small [#small] ```tsx import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@dapplelight/signet-ui/components/card" Open tickets Support queue

17

```
## Composition [#composition] ```tsx import { Badge } from "@dapplelight/signet-ui/components/badge" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@dapplelight/signet-ui/components/card" import { Progress } from "@dapplelight/signet-ui/components/progress" export function RevenueCard() { return ( Monthly revenue October 2026
₹4,82,15,300
+12.4% 1,284 subscriptions

72% of the quarterly target

) } ```
## API Reference [#api-reference] ### Card [#card] | Prop | Type | Default | Required | Description | | --- | --- | --- | --- | --- | | `size` | `"default" \| "sm"` | `"default"` | No | `sm` tightens the padding and gaps. | | `className` | `string` | — | No | Merged last. A first-child `img` runs edge to edge. | Plus every native [`
`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div) attribute. ### CardHeader, CardTitle, CardDescription, CardAction, CardContent, CardFooter [#cardheader-cardtitle-carddescription-cardaction-cardcontent-cardfooter] | Prop | Type | Default | Required | Description | | --- | --- | --- | --- | --- | | `className` | `string` | — | No | Merged last. | Plus every native [`
`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div) attribute. `CardAction` sits at the top right of `CardHeader`. `CardFooter` has a top border and a tinted background. # Chart (/docs/components/chart) ```tsx import { type ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent, } from "@dapplelight/signet-ui/components/chart" import { Bar, BarChart, CartesianGrid, XAxis } from "recharts" const data = [ { month: "Jun", revenue: 31200, expenses: 24100 }, { month: "Jul", revenue: 35800, expenses: 25300 }, { month: "Aug", revenue: 33900, expenses: 26800 }, { month: "Sep", revenue: 40100, expenses: 27200 }, { month: "Oct", revenue: 43000, expenses: 28900 }, { month: "Nov", revenue: 48200, expenses: 29400 }, ] const config = { revenue: { label: "Revenue" }, expenses: { label: "Expenses" }, } satisfies ChartConfig export function Demo() { return ( } /> ) } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add chart ``` ## Usage [#usage] ```tsx import { type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent, } from "@dapplelight/signet-ui/components/chart" import { Bar, BarChart, XAxis } from "recharts" import { config, data } from "./revenue" } /> ``` ## Examples [#examples] ### Line [#line] ```tsx import { ChartContainer, ChartTooltip, ChartTooltipContent, } from "@dapplelight/signet-ui/components/chart" import { CartesianGrid, Line, LineChart, XAxis } from "recharts" import { config, data } from "./revenue" } /> ``` ### Area [#area] ```tsx import { ChartContainer, ChartTooltip, ChartTooltipContent, } from "@dapplelight/signet-ui/components/chart" import { Area, AreaChart, CartesianGrid, XAxis } from "recharts" import { config, data } from "./revenue" } /> ``` ### Legend [#legend] ```tsx import { ChartLegend, ChartLegendContent } from "@dapplelight/signet-ui/components/chart" } /> ``` ### Pace [#pace] `PaceChart` shows usage against an even pace and a limit: the even-pace line (dashed, grey), what is used so far (solid), a projection from Now to where use would hit the limit (dashed, amber), a Now marker and the limit point. Segments are straight, gridlines are horizontal, and the card header takes any node in `slot`, here Day, Week and Month tabs. ```tsx import { PaceChart } from "@dapplelight/signet-ui/components/chart" import { Tabs, TabsList, TabsTrigger } from "@dapplelight/signet-ui/components/tabs" const week = [ { label: "Mon", name: "Monday", used: 60 }, { label: "Tue", name: "Tuesday", used: 130 }, { label: "Wed", name: "Wednesday", used: 220 }, { label: "Thu", name: "Thursday", used: 320 }, { label: "Fri", name: "Friday" }, { label: "Sat", name: "Saturday" }, { label: "Sun", name: "Sunday" }, ] Day Week Month } /> ``` Use is assumed to continue at its average rate so far, and even pace is `limit` divided evenly over the periods. Below the chart a visually hidden list gives one sentence per part (for example "Projected: reaches 500 on Saturday."), and the chart itself carries them as its `aria-label`. Without a `limit` there is no pace line, projection or limit point. Once use is over the limit there is no projection and the limit point stays at the end. With nothing used there is no Now marker. ## API Reference [#api-reference] Import from `@dapplelight/signet-ui/components/chart` only. It is not in the barrel because `recharts` (version 3.8 up to 4) is an optional peer dependency. Colours come from the theme's optional `--chart-1` to `--chart-6`, each falling back to a core token. ### ChartContainer [#chartcontainer] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `config` | `ChartConfig` | required | Maps each series key to a `label`, an optional `icon`, and a `color` or per-theme `theme`. Defines the `--color-` variable. | | `children` | recharts chart | required | One recharts chart, such as `BarChart`. | | `id` | `string` | generated | Stable id for the generated style block. | | `className` | `string` | - | Merged last. Default is `aspect-video`. | A series with neither `color` nor `theme` takes the palette entry at its position, wrapping after six. ### PaceChart [#pacechart] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `data` | `{ label: string; name?: string; used?: number \| null }[]` | `[]` | One point per period, with the running total in `used` up to Now. `label` is the axis tick, `name` is what a screen reader says (default `label`). | | `limit` | `number` | - | The cap. Without it, only the used line and Now show. | | `now` | `string` | last period with `used` | The `label` of the Now period. | | `title` | `ReactNode` | - | Card title. | | `slot` | `ReactNode` | - | Any node, right of the title; below it on phones. | | `yAxisTitle` | `string` | - | Title of the Y axis. | | `format` | `(n: number) => string` | `toLocaleString` | Formats axis ticks, the limit label and the descriptions. | | `state` | `ready` \| `loading` \| `error` | `ready` | Loading shows a skeleton; the header and slot stay. Empty `data` shows an empty state. | | `onRetry` | `() => void` | - | Retry button of the error state. | | `labels` | `Partial` | English | Text of each part (`pace`, `used`, `projected`, `now`, `limit`) and of the states. The limit label reads ` `. | | `colors` | `Partial>` | theme tokens | A CSS colour per part. | | `hide` | `Partial>` | - | Hide a part. | | `descriptions` | `Partial>` | - | Replace the screen-reader sentence of a part. | | `classNames` | `Partial>` | - | className per part, the header and the chart area. | | `className` | `string` | - | On the card. | `part` is one of `pace`, `used`, `projected`, `now`, `limit`. `paceModel(data, limit, now)` returns the numbers behind the chart. ### ChartConfig [#chartconfig] `Record` ### ChartTooltipContent [#charttooltipcontent] Pass as `content` of `ChartTooltip`, which is recharts' `Tooltip`. | Prop | Type | Default | Description | | --- | --- | --- | --- | | `indicator` | `dot` \| `line` \| `dashed` | `dot` | Shape of the series marker. | | `hideLabel` | `boolean` | `false` | Hide the heading. | | `hideIndicator` | `boolean` | `false` | Hide the marker. | | `nameKey` | `string` | - | Payload key used to look up the series label. | | `labelKey` | `string` | - | Payload key used to look up the heading. | | `labelFormatter` | `(value, payload) => ReactNode` | - | Format the heading. | | `formatter` | recharts formatter | - | Replace each row. | | `color` | `string` | - | Override the marker colour. | | `className` | `string` | - | Merged last. | ### ChartLegendContent [#chartlegendcontent] Pass as `content` of `ChartLegend`, which is recharts' `Legend`. | Prop | Type | Default | Description | | --- | --- | --- | --- | | `hideIcon` | `boolean` | `false` | Use a swatch instead of the config `icon`. | | `nameKey` | `string` | - | Payload key used to look up the series label. | | `verticalAlign` | `top` \| `bottom` | `bottom` | Spacing side. Set by recharts. | | `className` | `string` | - | Merged last. | ### Other exports [#other-exports] `ChartTooltip` and `ChartLegend` re-export recharts' `Tooltip` and `Legend`. `CHART_COLORS` is the default palette and `ChartStyle` writes the colour variables. # Checkbox (/docs/components/checkbox) ```tsx import { Checkbox } from "@dapplelight/signet-ui/components/checkbox" export function Demo() { return (
) } ```
## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add checkbox ``` ## Usage [#usage] ```tsx import { Checkbox } from "@dapplelight/signet-ui/components/checkbox" ``` ## Examples [#examples] ### Checked [#checked] ```tsx import { Checkbox } from "@dapplelight/signet-ui/components/checkbox" ``` ### Disabled [#disabled] ```tsx import { Checkbox } from "@dapplelight/signet-ui/components/checkbox" ``` ### Controlled [#controlled] ```tsx import * as React from "react" import { Checkbox } from "@dapplelight/signet-ui/components/checkbox" import { invoices, toggle } from "./invoices" const [selected, setSelected] = React.useState(["INV-2041"]) {invoices.map((id) => (
toggle(id, v === true)} />
))} ```
## API Reference [#api-reference] ### Checkbox [#checkbox] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `checked` | `boolean \| "indeterminate"` | - | Controlled state. | | `defaultChecked` | `boolean \| "indeterminate"` | - | Initial state when uncontrolled. | | `onCheckedChange` | `(checked: boolean \| "indeterminate") => void` | - | Runs when the state changes. | | `disabled` | `boolean` | `false` | Prevents interaction. | | `required` | `boolean` | `false` | Marks it required in a form. | | `name` | `string` | - | Form field name. | | `value` | `string` | `"on"` | Form value when checked. | | `className` | `string` | - | Merged last. | Built on a Radix checkbox, so it takes every `button` prop. Pair it with a `label` using `id` and `htmlFor`. # Collab Screens (/docs/components/collab-screens) ```tsx import { useState } from "react" import { CommentThreads, type CollabThread, type CollabPerson } from "@dapplelight/signet-ui/screens/collab-screens" function CommentThreadsDemo() { const people: CollabPerson[] = [ { id: "u1", name: "Asha Rao" }, { id: "u2", name: "Marcus Lee" }, { id: "u3", name: "Priya Nair" }, ] const [threads, setThreads] = useState([ { id: "c1", author: people[0], body: "Invoice INV-2041 looks right. @[Marcus Lee](user:u2) can you confirm the tax line?", createdAt: "2026-11-10T09:30:00Z", replies: [ { id: "c2", parentId: "c1", author: people[1], body: "Confirmed, GST is 18%.", createdAt: "2026-11-10T10:05:00Z", }, ], }, ]) return ( people.filter((p) => p.name.toLowerCase().includes(q.toLowerCase()))} onAdd={({ body, parentId }) => { const c = { id: `c${Date.now()}`, parentId, author: people[0], body, createdAt: new Date().toISOString() } setThreads((t) => parentId ? t.map((x) => (x.id === parentId ? { ...x, replies: [...x.replies, c] } : x)) : [...t, { ...c, replies: [] }], ) }} onEdit={(comment, body) => setThreads((t) => t.map((x) => ({ ...x, body: x.id === comment.id ? body : x.body, replies: x.replies.map((r) => (r.id === comment.id ? { ...r, body } : r)), })), ) } onDelete={(comment) => setThreads((t) => t.filter((x) => x.id !== comment.id))} /> ) } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add collab-screens ``` ## Usage [#usage] ```tsx import { CommentThreads, ActivityFeed, VersionHistory, } from "@dapplelight/signet-ui/screens/collab-screens" ``` Data goes in as props shaped like signet-db's `createCollab` results (or the JSON from `collabRoutes`); actions come out as callbacks. ```tsx import { CommentThreads } from "@dapplelight/signet-ui/screens/collab-screens" import { addComment, searchPeople, threads } from "./collab" ``` ## Examples [#examples] ### CommentThreads [#commentthreads] ```tsx import { useState } from "react" import { CommentThreads, type CollabThread, type CollabPerson } from "@dapplelight/signet-ui/screens/collab-screens" function CommentThreadsDemo() { const people: CollabPerson[] = [ { id: "u1", name: "Asha Rao" }, { id: "u2", name: "Marcus Lee" }, { id: "u3", name: "Priya Nair" }, ] const [threads, setThreads] = useState([ { id: "c1", author: people[0], body: "Invoice INV-2041 looks right. @[Marcus Lee](user:u2) can you confirm the tax line?", createdAt: "2026-11-10T09:30:00Z", replies: [ { id: "c2", parentId: "c1", author: people[1], body: "Confirmed, GST is 18%.", createdAt: "2026-11-10T10:05:00Z", }, ], }, ]) return ( people.filter((p) => p.name.toLowerCase().includes(q.toLowerCase()))} onAdd={({ body, parentId }) => { const c = { id: `c${Date.now()}`, parentId, author: people[0], body, createdAt: new Date().toISOString() } setThreads((t) => parentId ? t.map((x) => (x.id === parentId ? { ...x, replies: [...x.replies, c] } : x)) : [...t, { ...c, replies: [] }], ) }} onEdit={(comment, body) => setThreads((t) => t.map((x) => ({ ...x, body: x.id === comment.id ? body : x.body, replies: x.replies.map((r) => (r.id === comment.id ? { ...r, body } : r)), })), ) } onDelete={(comment) => setThreads((t) => t.filter((x) => x.id !== comment.id))} /> ) } ``` ### MentionTextarea [#mentiontextarea] ```tsx import { useState } from "react" import { MentionTextarea, CommentBody, type CollabPerson } from "@dapplelight/signet-ui/screens/collab-screens" function MentionTextareaDemo() { const [value, setValue] = useState("Thanks @[Asha Rao](user:u1), shipping Friday.") const people: CollabPerson[] = [ { id: "u1", name: "Asha Rao" }, { id: "u2", name: "Marcus Lee" }, { id: "u3", name: "Priya Nair" }, ] return (
people.filter((p) => p.name.toLowerCase().includes(q.toLowerCase()))} placeholder="Write a comment. Type @ to mention someone." />
) } ```
### ActivityFeed [#activityfeed] ```tsx import { ActivityFeed, type CollabTimelineItem } from "@dapplelight/signet-ui/screens/collab-screens" function ActivityFeedDemo() { const items: CollabTimelineItem[] = [ { kind: "change", id: "a1", at: "2026-11-12T14:20:00Z", actor: { id: "u2", name: "Marcus Lee" }, summary: "Marcus Lee changed status to Paid", action: "update", changes: [{ field: "status", from: "sent", to: "paid" }], }, { kind: "comment", id: "a2", at: "2026-11-11T09:00:00Z", actor: { id: "u1", name: "Asha Rao" }, summary: "Asha Rao commented", comment: { id: "c1", author: { id: "u1", name: "Asha Rao" }, body: "Sent the reminder to the client.", createdAt: "2026-11-11T09:00:00Z", }, }, { kind: "change", id: "a3", at: "2026-11-10T08:00:00Z", actor: { id: "u1", name: "Asha Rao" }, summary: "Asha Rao created the invoice", action: "insert", }, ] return } ``` ### VersionHistory [#versionhistory] ```tsx import { VersionHistory } from "@dapplelight/signet-ui/screens/collab-screens" import { versions } from "./collab" function VersionHistoryDemo() { return ( ({ version: versions.length + 1 + v.version })} onUndo={() => undefined} /> ) } ``` ### VersionDiff [#versiondiff] ```tsx import { VersionDiff } from "@dapplelight/signet-ui/screens/collab-screens" import { versions } from "./collab" function VersionDiffDemo() { return } ``` ## API Reference [#api-reference] ### CommentThreads [#commentthreads-1] Also accepts `section` props. | Prop | Type | Default | Description | | --- | --- | --- | --- | | `threads` | `CollabThread[]` | required | Comments with their `replies`. | | `currentUserId` | `string` | - | Shows Edit and Delete on this user's own comments. | | `canModerate` | `boolean` | - | Shows Delete on everyone's comments. | | `onAdd` | `(input: { body: string; parentId?: string }) => Promise \| unknown` | required | Called for a new comment or reply. A throw keeps the text and shows a retry message. | | `onEdit` | `(comment: CollabComment, body: string) => Promise \| unknown` | - | Called when a comment is edited. | | `onDelete` | `(comment: CollabComment) => Promise \| unknown` | - | Called when a comment is deleted. | | `onSearchPeople` | `(query: string) => Promise \| CollabPerson[]` | required | Members matching the `@` query. | | `title` | `ReactNode` | - | Heading override. | | `labels` | `Partial` | `DEFAULT_COLLAB_LABELS` | Override any string. | ### MentionTextarea [#mentiontextarea-1] Also accepts `textarea` props except `onChange` and `defaultValue`. | Prop | Type | Default | Description | | --- | --- | --- | --- | | `value` | `string` | required | Body with mentions as `@[Name](user:)`. | | `onValueChange` | `(body: string) => void` | required | Called with the stored form of the body. | | `onSearch` | `(query: string) => Promise \| CollabPerson[]` | required | Members matching the query. | | `labels` | `Partial` | `DEFAULT_COLLAB_LABELS` | Override any string. | ### ActivityFeed [#activityfeed-1] Also accepts `section` props. | Prop | Type | Default | Description | | --- | --- | --- | --- | | `items` | `CollabTimelineItem[]` | required | Timeline entries, newest first. | | `onLoadMore` | `() => Promise \| unknown` | - | Shows Load more when set. | | `hasMore` | `boolean` | - | Whether more entries exist. | | `title` | `ReactNode` | - | Heading override. | | `labels` | `Partial` | `DEFAULT_COLLAB_LABELS` | Override any string. | ### VersionHistory [#versionhistory-1] Also accepts `section` props. | Prop | Type | Default | Description | | --- | --- | --- | --- | | `versions` | `CollabVersion[]` | required | Versions, newest first. | | `onRestore` | `(version: CollabVersion) => Promise \| unknown` | - | Restore the selected version. A throw shows its message. | | `onUndo` | `(latest: CollabVersion) => Promise \| unknown` | - | Undo the latest change. | | `defaultSelected` | `number` | latest | The version shown first. | | `title` | `ReactNode` | - | Heading override. | | `labels` | `Partial` | `DEFAULT_COLLAB_LABELS` | Override any string. | ### VersionDiff [#versiondiff-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `changes` | `CollabFieldChange[]` | required | Field, `from` and `to` values. | | `labels` | `Partial` | `DEFAULT_COLLAB_LABELS` | Override any string. | | `className` | `string` | - | Class on the table. | ### CommentBody [#commentbody] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `body` | `string` | required | Text with stored mentions, rendered as chips. | | `className` | `string` | - | Extra classes. | # Combobox (/docs/components/combobox) ```tsx import { Combobox, ComboboxContent, ComboboxEmpty, ComboboxInput, ComboboxItem, ComboboxList, } from "@dapplelight/signet-ui/components/combobox" const customers = ["Acme Corp", "Globex", "Initech", "Umbrella Ltd", "Wayne Enterprises", "Stark Industries"] export function Demo() { return ( No customers found. {(item) => ( {item} )} ) } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add combobox ``` ## Usage [#usage] ```tsx import { Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxContent, ComboboxEmpty, ComboboxInput, ComboboxItem, ComboboxList, ComboboxValue, useComboboxAnchor, } from "@dapplelight/signet-ui/components/combobox" const items = ["Acme Corp", "Globex", "Initech"] No results. {(item) => {item}} ``` ## Examples [#examples] ### Clear button [#clear-button] ```tsx import { Combobox, ComboboxInput } from "@dapplelight/signet-ui/components/combobox" const customers = ["Acme Corp", "Globex", "Initech"] ... ``` ### Multiple [#multiple] ```tsx import { Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxContent, ComboboxValue, useComboboxAnchor, } from "@dapplelight/signet-ui/components/combobox" const customers = ["Acme Corp", "Globex", "Initech"] const anchor = useComboboxAnchor() {(values: string[]) => ( <> {values.map((value) => ( {value} ))} )} ... ``` ### Controlled [#controlled] ```tsx import * as React from "react" import { Combobox } from "@dapplelight/signet-ui/components/combobox" const customers = ["Acme Corp", "Globex", "Umbrella Ltd"] const [value, setValue] = React.useState("Umbrella Ltd") ... ``` ## API Reference [#api-reference] Built on the Base UI combobox. `Combobox` is the Base UI `Combobox.Root`, so it takes its props. ### Combobox [#combobox] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `items` | `T[]` or groups | - | The options. Filtering is done for you. | | `filter` | `null \| (item, query, itemToString?) => boolean` | built-in | Custom match; `null` turns filtering off (for server-side search). | | `inputValue` / `onInputValueChange` | `string` / `(value, details) => void` | - | Control the typed text. | | `autoHighlight` | `boolean` | `false` | Highlight the first match while typing. | | `value` | `T \| T[] \| null` | - | Controlled value. | | `defaultValue` | `T \| T[] \| null` | - | Initial value when uncontrolled. | | `onValueChange` | `(value, details) => void` | - | Runs when the selection changes. | | `multiple` | `boolean` | `false` | Allow several values. Value becomes an array. | | `open` / `onOpenChange` | `boolean` / `(open) => void` | - | Control the popup. | | `disabled` / `readOnly` / `required` | `boolean` | `false` | Field state. | | `name` | `string` | - | Form field name. | ### ComboboxInput [#comboboxinput] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `showTrigger` | `boolean` | `true` | Show the chevron button. | | `showClear` | `boolean` | `false` | Show a clear button. | | `disabled` | `boolean` | `false` | Disable the input and its buttons. | | `className` | `string` | - | Merged onto the input group. | Plus every Base UI combobox input prop, such as `placeholder`. ### ComboboxContent [#comboboxcontent] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `side` | `top` \| `bottom` \| `left` \| `right` \| `inline-start` \| `inline-end` | `bottom` | Side of the anchor. | | `align` | `start` \| `center` \| `end` | `start` | Alignment on that side. | | `sideOffset` | `number` | `6` | Gap from the anchor. | | `alignOffset` | `number` | `0` | Shift along the alignment axis. | | `anchor` | element or ref | - | Anchor to position against. Use `useComboboxAnchor()` with chips. | ### ComboboxList, ComboboxItem, ComboboxEmpty [#comboboxlist-comboboxitem-comboboxempty] `ComboboxList` takes a render function of each item. `ComboboxItem` takes `value` and shows a check when selected. `ComboboxEmpty` shows only when nothing matches. ### ComboboxGroup, ComboboxLabel, ComboboxCollection, ComboboxSeparator [#comboboxgroup-comboboxlabel-comboboxcollection-comboboxseparator] For grouped lists: a group, its label, the group's item collection and a divider. ### ComboboxChips, ComboboxChip, ComboboxChipsInput [#comboboxchips-comboboxchip-comboboxchipsinput] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `showRemove` (`ComboboxChip`) | `boolean` | `true` | Show the remove button on a chip. | `ComboboxChips` is the field for multiple selection, `ComboboxChip` one selected value and `ComboboxChipsInput` the typing area. ### ComboboxValue, ComboboxTrigger [#comboboxvalue-comboboxtrigger] `ComboboxValue` renders the selected value, or a render function of it. `ComboboxTrigger` is the chevron button, for building your own field. ### useComboboxAnchor [#usecomboboxanchor] Returns a ref to place on `ComboboxChips`, then pass to `ComboboxContent` as `anchor`. # Command (/docs/components/command) ```tsx import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, } from "@dapplelight/signet-ui/components/command" import { CreditCardIcon, FileTextIcon, PlusIcon, SettingsIcon, UserIcon } from "lucide-react" export function Demo() { return ( No results found. New invoice View invoices Profile Billing Settings ) } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add command ``` ## Usage [#usage] ```tsx import { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, } from "@dapplelight/signet-ui/components/command" import { run } from "./commands" run(value)}> No results. New invoice ``` ## Examples [#examples] ### Shortcuts [#shortcuts] ```tsx import { CommandItem, CommandShortcut } from "@dapplelight/signet-ui/components/command" import { UserIcon } from "lucide-react" Profile ``` ### Dialog [#dialog] ```tsx import { CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, } from "@dapplelight/signet-ui/components/command" import { FileTextIcon, PlusIcon } from "lucide-react" import * as React from "react" import { run } from "./commands" const [open, setOpen] = React.useState(false) run(value)}> No results found. New invoice View invoices ``` ## API Reference [#api-reference] ### Command [#command] Typing filters and ranks, arrow keys move the highlight while focus stays in the input, Enter runs. | Prop | Type | Default | Description | | --- | --- | --- | --- | | `onAction` | `(value, details) => unknown` | - | Runs when a command runs. Return a Promise to mark it pending. | | `filter` | `fuzzy` \| `contains` \| `startsWith` \| function \| `false` | `fuzzy` | How typing narrows the list. | | `query` / `onQueryChange` | `string` / `(query, details) => void` | - | Control the search text. | | `value` / `onValueChange` | `string \| null` / `(value, details) => void` | - | Control the highlighted command. | | `defaultQuery` / `defaultValue` | `string` / `string \| null` | - | Initial search text and highlighted command when uncontrolled. | | `autoHighlight` | `boolean` | `true` | Highlight the first or best-matching command so Enter runs it. | | `loop` | `boolean` | `true` | Wrap arrow keys at the ends. | | `items` | `CommandData` | - | Commands as data instead of children. | | `emptyItems` | `CommandData` | - | Shown instead of `items` while the search is empty, such as recent commands. Needs `items`. | | `status` | `"idle" \| "loading" \| "error"` | `"idle"` | Whether results are loading or failed. | | `onLoadMore` | `() => void` | - | Runs when the highlight reaches the last command. | | `pendingAnnouncement` | `string` | `"Loading"` | What screen readers hear when an action stays pending. | | `className` | `string` | - | Merged last. | ### CommandDialog [#commanddialog] A `Command` inside a `Dialog`, toggled with Cmd+K or Ctrl+K. Takes every `Command` prop plus: | Prop | Type | Default | Description | | --- | --- | --- | --- | | `open` | `boolean` | - | Controlled open state. | | `defaultOpen` | `boolean` | `false` | Initial state when uncontrolled. | | `onOpenChange` | `(open: boolean) => void` | - | Runs when it opens or closes. | | `shortcut` | `string \| null` | `"mod+k"` | Toggles it from anywhere on the page. `null` turns it off. | | `title` | `ReactNode` | `"Command palette"` | Name for screen readers. | | `description` | `ReactNode` | `"Search for a command to run."` | Description for screen readers. | | `closeOnAction` | `boolean` | `true` | Close once a command runs. | | `contentClassName` | `string` | - | Classes for the dialog surface. | On a phone it becomes a bottom sheet. ### CommandInput [#commandinput] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `icon` | `ReactNode` | search icon | Replaces the icon. `null` hides it. | | `wrapperClassName` | `string` | - | Classes for the row around the input. | | `className` | `string` | - | Merged onto the input. | ### CommandItem [#commanditem] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `value` | `string` | generated | Passed to `onAction`. Identifies the command. | | `label` | `string` | - | Text the search matches when the content is not plain text. | | `keywords` | `string[]` | - | Extra words the search matches. | | `shortcut` | `string` | - | Keys such as `"mod+p"` that run it while it is mounted. | | `disabled` | `boolean` | `false` | Keeps it from running. | | `onSelect` | `(event) => unknown` | - | Runs before `onAction`. `preventDefault()` skips it. | ### CommandGroup [#commandgroup] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `heading` | `ReactNode` | - | Label shown above the group. | ### CommandList, CommandEmpty, CommandSeparator, CommandShortcut [#commandlist-commandempty-commandseparator-commandshortcut] `CommandList` holds the items and scrolls. `CommandEmpty` shows only when nothing matches. `CommandShortcut` shows its item's `shortcut` as `Cmd+P` on Apple platforms and `Ctrl+P` elsewhere. All take `className`. # Cost Dashboard (/docs/components/cost-dashboard) ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ## Usage [#usage] ```tsx import { DEFAULT_COST_LABELS, CostDashboard } from "@dapplelight/signet-ui/screens/cost-dashboard" // CostDashboard({ data: dataProp = null, fetcher, days: daysProp, onDaysChange, loading: loadingProp = false, error: errorProp = false, onRetry, labels: labelsProp, className, ...props }: CostDashboardProps) ``` ## API Reference [#api-reference] | Export | Props | | --- | --- | | `CostSeriesRow` | — | | `CostModelRow` | — | | `CostSubjectRow` | — | | `CostCapUsage` | — | | `CostDashboardData` | — | | `DEFAULT_COST_LABELS` | — | | `CostLabels` | — | | `CostDashboardProps` | — | | `CostDashboard` | `{ data: dataProp = null, fetcher, days: daysProp, onDaysChange, loading: loadingProp = false, error: errorProp = false, onRetry, labels: labelsProp, className, ...props }: CostDashboardProps` | # CSV Import (/docs/components/csv-import) ```tsx import { CsvImport, type CsvField } from "@dapplelight/signet-ui/domain/csv-import" import { useState } from "react" const schema = { safeParse(value: unknown) { const v = value as Record if (v.email && /^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(v.email)) { return { success: true as const, data: v } } return { success: false as const, error: { issues: [{ path: ["email"], message: "Not a valid email" }] }, } }, } const fields: CsvField[] = [ { key: "name", label: "Customer", aliases: ["Full name"], required: true }, { key: "email", label: "Email", aliases: ["E-mail", "Email address"], required: true }, { key: "plan", label: "Plan" }, ] export function CsvImportDemo() { const [, setImported] = useState(0) return (
{ setImported(rows.length) await new Promise((r) => setTimeout(r, 600)) return { inserted: rows.length } }} />
) } ```
## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add csv-import ``` ## Usage [#usage] ```tsx import { CsvImport, type CsvField } from "@dapplelight/signet-ui/domain/csv-import" import { fields, save } from "./contacts" save(rows)} /> ``` The helpers `parseCsv`, `toCsv`, `detectDelimiter`, `csvField`, `autoMatch` and `validateRows` are exported too. ## Examples [#examples] ### With a schema [#with-a-schema] ```tsx import { CsvImport, type CsvField } from "@dapplelight/signet-ui/domain/csv-import" import { useState } from "react" const schema = { safeParse(value: unknown) { const v = value as Record if (v.email && /^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(v.email)) { return { success: true as const, data: v } } return { success: false as const, error: { issues: [{ path: ["email"], message: "Not a valid email" }] }, } }, } const fields: CsvField[] = [ { key: "name", label: "Customer", aliases: ["Full name"], required: true }, { key: "email", label: "Email", aliases: ["E-mail", "Email address"], required: true }, { key: "plan", label: "Plan" }, ] export function CsvImportDemo() { const [, setImported] = useState(0) return (
{ setImported(rows.length) await new Promise((r) => setTimeout(r, 600)) return { inserted: rows.length } }} />
) } ```
### Server errors [#server-errors] ```tsx import { CsvImport, type CsvField } from "@dapplelight/signet-ui/domain/csv-import" const sample = `Full name,E-mail,Plan Asha Verma,asha@acme.example,Pro Rohan Iyer,rohan@acme.example,Starter Meera Nair,not-an-email,Pro Dev Patel,dev@acme.example,Team` const fields: CsvField[] = [ { key: "name", label: "Customer", aliases: ["Full name"], required: true }, { key: "email", label: "Email", aliases: ["E-mail", "Email address"], required: true }, { key: "plan", label: "Plan" }, ] export function CsvImportServerErrorsDemo() { return (
{ await new Promise((r) => setTimeout(r, 600)) return { inserted: rows.length - 1, errors: [{ row: 0, field: "email", message: "Already registered" }], } }} />

Paste this to try it:

{sample}
) } ```
### Labels [#labels] ```tsx import { CsvImport, type CsvField } from "@dapplelight/signet-ui/domain/csv-import" const fields: CsvField[] = [ { key: "name", label: "Customer", aliases: ["Full name"], required: true }, { key: "email", label: "Email", aliases: ["E-mail", "Email address"], required: true }, { key: "plan", label: "Plan" }, ] export function CsvImportLabelsDemo() { return (
undefined} labels={{ title: "Import customers", paste: "Or paste rows from your spreadsheet", next: "Next", import: (n) => `Add ${n} customers`, }} />
) } ```
## API Reference [#api-reference] ### CsvImport [#csvimport] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `fields` | `readonly CsvField[]` | — | The fields rows are imported into: `key`, `label`, `aliases`, `required`. | | `schema` | `CsvSchema` | — | Anything with `safeParse` (zod works). Without it rows are the mapped strings. | | `onImport` | `(rows: T[]) => Promise \| CsvImportReport \| undefined` | — | Gets the valid rows. Return a report to show server errors per row. | | `delimiter` | `string` | `detected` | Separator; detected from the first line when left out. | | `previewRows` | `number` | `100` | Rows shown in the review table. | | `maxBytes` | `number` | `10485760` | Largest file read, in bytes. | | `labels` | `Partial` | — | Every string, in English by default. Spread `DEFAULT_CSV_IMPORT_LABELS` to translate. | | `classNames` | `Partial>` | — | Parts: `root`, `title`, `source`, `mapping`, `review`, `table`, `cell`, `error`, `actions`, `status`. | ### CsvField [#csvfield] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `key` | `string` | — | The key in each imported row. | | `label` | `string` | `key` | Shown in the mapping step and the preview. | | `aliases` | `string[]` | — | Other header names that match this field. | | `required` | `boolean` | — | Mapping cannot continue until this field has a column. | # Data Grid (/docs/components/data-grid) ```tsx import { useState } from "react" import { DataGrid, type DataGridColumn } from "@dapplelight/signet-ui/components/data-grid" type Invoice = { id: string customer: string amount: number status: string due: string paid: boolean } const invoices: Invoice[] = [ { id: "INV-1042", customer: "Northwind Traders", amount: 12400, status: "paid", due: "2026-10-04", paid: true }, { id: "INV-1043", customer: "Globex Corporation", amount: 8250, status: "open", due: "2026-11-18", paid: false }, { id: "INV-1044", customer: "Initech", amount: 3120, status: "overdue", due: "2026-10-29", paid: false }, { id: "INV-1045", customer: "Umbrella Health", amount: 21900, status: "paid", due: "2026-10-12", paid: true }, { id: "INV-1046", customer: "Hooli", amount: 5600, status: "open", due: "2026-11-25", paid: false }, { id: "INV-1047", customer: "Stark Logistics", amount: 18750, status: "paid", due: "2026-10-20", paid: true }, { id: "INV-1048", customer: "Wayne Freight", amount: 940, status: "draft", due: "2026-12-02", paid: false }, { id: "INV-1049", customer: "Acme Supplies", amount: 7300, status: "overdue", due: "2026-10-15", paid: false }, { id: "INV-1050", customer: "Soylent Foods", amount: 15200, status: "open", due: "2026-11-30", paid: false }, { id: "INV-1051", customer: "Cyberdyne Systems", amount: 2680, status: "paid", due: "2026-10-08", paid: true }, ] const columns: DataGridColumn[] = [ { id: "id", header: "Invoice", editable: false, width: 110 }, { id: "customer", header: "Customer", width: 200 }, { id: "amount", header: "Amount", type: "number", width: 120, format: (v) => `$${Number(v).toLocaleString()}`, }, { id: "status", header: "Status", type: "select", width: 120, options: [ { value: "draft", label: "Draft" }, { value: "open", label: "Open" }, { value: "paid", label: "Paid" }, { value: "overdue", label: "Overdue" }, ], }, { id: "due", header: "Due", type: "date", width: 130 }, { id: "paid", header: "Paid", type: "checkbox", width: 80 }, ] export function Demo() { const [rows, setRows] = useState(invoices) return (
r.id} onChange={(changes) => { setRows((prev) => prev.map((r) => { const mine = changes.filter((c) => c.rowId === r.id) return mine.length ? { ...r, ...Object.fromEntries(mine.map((c) => [c.columnId, c.value])) } : r }), ) }} />
) } ```
## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add data-grid ``` ## Usage [#usage] ```tsx import { DataGrid } from "@dapplelight/signet-ui/components/data-grid" import { invoices } from "./invoices" import { save } from "./actions" row.id} onChange={save} /> ``` ## Examples [#examples] ### Row selection [#row-selection] ```tsx import { useState } from "react" import { DataGrid } from "@dapplelight/signet-ui/components/data-grid" import { invoices, columns } from "./invoices" // uses the invoices and columns from the first example export function Demo() { const [selected, setSelected] = useState(["INV-1043"]) return (
r.id} />

{selected.length} selected

) } ```
### Validation [#validation] ```tsx import { useState } from "react" import { DataGrid, type DataGridColumn } from "@dapplelight/signet-ui/components/data-grid" import { invoices, type Invoice } from "./invoices" // uses the invoices and columns from the first example export function Demo() { const [rows, setRows] = useState(invoices) const cols: DataGridColumn[] = [ { id: "id", header: "Invoice", editable: false, width: 110 }, { id: "customer", header: "Customer", width: 200 }, { id: "amount", header: "Amount", type: "number", width: 140, validate: (v) => (typeof v === "number" && v < 0 ? "Amount can't be negative." : undefined), }, ] return (
r.id} onChange={(changes) => { setRows((prev) => prev.map((r) => { const mine = changes.filter((c) => c.rowId === r.id) return mine.length ? { ...r, ...Object.fromEntries(mine.map((c) => [c.columnId, c.value])) } : r }), ) }} />
) } ```
### Read only [#read-only] ```tsx import { DataGrid } from "@dapplelight/signet-ui/components/data-grid" import { invoices, columns } from "./invoices" // uses the invoices and columns from the first example export function Demo() { return (
({ ...c, editable: false }))} rows={invoices} height={300} getRowId={(r) => r.id} />
) } ```
## API Reference [#api-reference] ### DataGrid [#datagrid] Click a header to sort, drag its edge to resize. Rows are virtualised and one line tall, and the grid has no pagination. Arrow keys move, Enter edits, and ranges copy and paste as TSV. | Prop | Type | Default | Description | | --- | --- | --- | --- | | `columns` | `DataGridColumn[]` | required | Column definitions, see below. | | `rows` | `T[]` | required | The data. Apply saved changes back to it. | | `getRowId` | `(row: T, index: number) => string` | required | Stable id for each row. | | `onChange` | `(changes: DataGridChange[]) => Promise \| DataGridFailure[] \| undefined` | none | Edits, pastes and clears, as a batch. The grid shows new values at once; a throw reverts them with an error on each cell, and returned failures do so for just those cells. | | `selectable` | `boolean` | `false` | Adds a checkbox column and Shift+Space row selection. | | `selectedRowIds` | `readonly string[]` | none | Controlled selection. | | `onSelectedRowIdsChange` | `(ids: string[]) => void` | none | Called when selection changes. | | `rowHeight` | `number` | `36` | Row height in px. | | `height` | `number \| string` | `480` | Height of the scrolling body. | | `overscan` | `number` | `8` | Extra rows rendered outside the viewport. | | `aria-label` | `string` | none | Accessible name. | | `aria-labelledby` | `string` | none | Id of the element that names the grid. | | `labels` | `Partial` | `DEFAULT_DATA_GRID_LABELS` | Override the grid's strings. | | `className` | `string` | none | Class for the root. | | `classNames` | `Partial>` | `{}` | Class per part. | ### DataGridColumn [#datagridcolumn] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `id` | `keyof T` | required | The row key this column reads and writes. | | `header` | `string` | required | Header text. | | `type` | `"text" \| "number" \| "select" \| "date" \| "checkbox"` | `"text"` | Editor and paste parsing. Dates are `YYYY-MM-DD` strings. | | `options` | `{ value: string; label: string }[]` | none | Choices for `type: "select"`. | | `editable` | `boolean` | `true` | Allow editing. | | `sortable` | `boolean` | `true` | Allow sorting. | | `width` | `number` | `160` | Starting width in px. | | `minWidth` | `number` | `40` | Smallest width when resizing. | | `format` | `(value: unknown, row: T) => ReactNode` | none | How the value shows when not editing. | | `parse` | `(text: string, row: T) => { value: unknown } \| { error: string }` | by `type` | Text (typed or pasted) to a value. | | `validate` | `(value: unknown, row: T) => string \| undefined` | none | Return a message to refuse a value before it is saved. | # Data Table (/docs/components/data-table) ```tsx import { Badge } from "@dapplelight/signet-ui/components/badge" import { DataTable, type DataTableProps } from "@dapplelight/signet-ui/components/data-table" type Invoice = { id: string customer: string amount: number status: "paid" | "open" | "overdue" | "draft" due: string } const invoices: Invoice[] = [ { id: "INV-1042", customer: "Northwind Traders", amount: 12400, status: "paid", due: "2026-10-04" }, { id: "INV-1043", customer: "Globex Corporation", amount: 8250, status: "open", due: "2026-11-18" }, { id: "INV-1044", customer: "Initech", amount: 3120, status: "overdue", due: "2026-10-29" }, { id: "INV-1045", customer: "Umbrella Health", amount: 21900, status: "paid", due: "2026-10-12" }, { id: "INV-1046", customer: "Hooli", amount: 5600, status: "open", due: "2026-11-25" }, { id: "INV-1047", customer: "Stark Logistics", amount: 18750, status: "paid", due: "2026-10-20" }, { id: "INV-1048", customer: "Wayne Freight", amount: 940, status: "draft", due: "2026-12-02" }, { id: "INV-1049", customer: "Acme Supplies", amount: 7300, status: "overdue", due: "2026-10-15" }, { id: "INV-1050", customer: "Soylent Foods", amount: 15200, status: "open", due: "2026-11-30" }, { id: "INV-1051", customer: "Cyberdyne Systems", amount: 2680, status: "paid", due: "2026-10-08" }, ] const statusVariant = { paid: "default", open: "secondary", overdue: "destructive", draft: "outline", } as const const columns: DataTableProps["columns"] = [ { accessorKey: "id", header: "Invoice" }, { accessorKey: "customer", header: "Customer" }, { accessorKey: "amount", header: "Amount", cell: ({ row }) => `$${row.original.amount.toLocaleString()}`, }, { accessorKey: "status", header: "Status", meta: { filter: "facet" }, cell: ({ row }) => ( {row.original.status} ), }, { accessorKey: "due", header: "Due" }, ] export function Demo() { return (
r.id} />
) } ```
## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add data-table ``` ## Usage [#usage] ```tsx import { DataTable } from "@dapplelight/signet-ui/components/data-table" import { columns, invoices } from "./invoices" row.id} sortable /> ``` ## Examples [#examples] ### Sorting [#sorting] ```tsx import { DataTable } from "@dapplelight/signet-ui/components/data-table" import { columns, invoices } from "./invoices" // uses the invoices and columns from the first example export function Demo() { return (
r.id} sortable />
) } ```
### Row selection [#row-selection] ```tsx import { Button } from "@dapplelight/signet-ui/components/button" import { DataTable } from "@dapplelight/signet-ui/components/data-table" import { columns, invoices } from "./invoices" // uses the invoices and columns from the first example export function Demo() { return (
r.id} selectable bulkActions={(selected) => ( )} />
) } ```
### Search, columns and export [#search-columns-and-export] ```tsx import { DataTable } from "@dapplelight/signet-ui/components/data-table" import { columns, invoices } from "./invoices" // uses the invoices and columns from the first example export function Demo() { return (
r.id} sortable searchable={{ placeholder: "Search invoices" }} columnsMenu exportFilename="invoices" />
) } ```
### Clickable rows [#clickable-rows] ```tsx import { useState } from "react" import { DataTable } from "@dapplelight/signet-ui/components/data-table" import { columns, invoices, type Invoice } from "./invoices" // uses the invoices and columns from the first example export function Demo() { const [open, setOpen] = useState(null) return (
r.id} onRowClick={setOpen} getRowLabel={(r) => `Open ${r.id} for ${r.customer}`} />

{open ? `${open.id}: ${open.customer}` : "Click a row"}

) } ```
### Empty [#empty] ```tsx import { DataTable } from "@dapplelight/signet-ui/components/data-table" import { columns } from "./invoices" // uses the invoices and columns from the first example export function Demo() { return (
) } ```
## API Reference [#api-reference] ### DataTable [#datatable] Every feature is off by default and opt-in by prop. There is no built-in pagination: scroll long lists with `virtual`. | Prop | Type | Default | Description | | --- | --- | --- | --- | | `columns` | `ColumnDef[]` | required | TanStack column definitions. Set `meta.filter` to `"facet"` or `"text"` for a toolbar filter, and `meta.filterLabel` to name it. | | `data` | `TData[]` | required | The rows. | | `getRowId` | `(row: TData, index: number) => string` | row index | Stable row ids, for selection and `activeRowId`. | | `sortable` | `boolean` | `false` | Click a header to sort; shift-click adds a column. | | `selectable` | `boolean` | `false` | Checkbox column, select-all header and a bulk-actions bar. | | `selectedRowIds` | `readonly string[]` | none | Controlled selection. | | `onSelectedRowIdsChange` | `(ids: string[]) => void` | none | Called when selection changes. | | `bulkActions` | `(selected: TData[]) => ReactNode` | none | Rendered in the bulk bar while rows are selected. | | `searchable` | `boolean \| { placeholder?: string }` | `false` | A search box across every visible column. | | `columnsMenu` | `boolean` | `false` | A menu to show and hide columns. | | `exportFilename` | `string` | none | Adds an export button that downloads the current view as `.csv`. | | `onRowClick` | `(row: TData) => void` | none | Makes rows clickable and keyboard focusable. | | `getRowLabel` | `(row: TData) => string` | none | Accessible name for a clickable row. | | `activeRowId` | `string` | none | Row marked `data-active` and scrolled into view. | | `emptyMessage` | `string` | none | Shown when there are no rows. | | `virtual` | `{ rowHeight: number; height: number \| string; overscan?: number }` | none | Render only visible rows, under a sticky header. Keep cells to one line. | | `view` | `DataTableView` | none | Controlled filters, sorting and column visibility. | | `defaultView` | `DataTableView` | empty | Starting view when uncontrolled. | | `onViewChange` | `(view: DataTableView) => void` | none | Called when the view changes. | | `savedViews` | `{ views: SavedView[]; onSave: (name, view) => void; onDelete?: (id) => void }` | none | Named views in the toolbar. | | `manual` | `boolean` | `false` | The server filters and sorts; `data` is shown as given. | | `facetCounts` | `Record>` | computed | Server-side counts per facet value. | | `total` | `number` | `data.length` | Unfiltered row count, for "12 of 10,000". | | `tableRef` | `MutableRefObject` | none | Exposes the TanStack table instance. | | `className` | `string` | none | Class for the root. | ### TruncatedCell [#truncatedcell] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `children` | `ReactNode` | required | Cell content; a tooltip shows when a string or number is cut off. | | `className` | `string` | none | Class for the cell. | # Decision callout (/docs/components/decision-callout) ```tsx import { DecisionCallout, DecisionCalloutReason, DecisionCalloutTitle } from "@dapplelight/signet-ui/components/decision-callout" import { StageRail } from "@dapplelight/signet-ui/components/stage-rail" import { Timeline, TimelineConnector, TimelineDescription, TimelineItem, TimelineMarker, TimelineTime, TimelineTitle } from "@dapplelight/signet-ui/components/timeline" const stages = ["Plan", "Build", "Verify", "Review", "Ship"] export function Demo() { return (
Plan 09:02 Split the ticket into 4 tasks Build 09:14 Changed 7 files, +184 −36 Ran 42 affected tests instead of the full suite The diff touches 3 of 61 packages; 18 s instead of 6 min. Verify Running 42 tests Review Ship
) } ```
## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add decision-callout ``` ## Usage [#usage] ```tsx import { DecisionCallout, DecisionCalloutReason, DecisionCalloutTitle } from "@dapplelight/signet-ui/components/decision-callout" Build Ran 42 affected tests instead of the full suite The diff touches 3 of 61 packages; 18 s instead of 6 min. ``` It sits in the text column of a [Timeline](/docs/components/timeline) item, under the step's own text. It is a plain `div`, not an [Alert](/docs/components/alert), so screen readers do not announce each decision as it appears. Long text wraps. The reason line uses `text-text-secondary`, because `text-text-muted` does not reach 4.5:1 on the tint in every theme. ## Customising [#customising] 1. **Tokens.** The box is tinted with `accent-primary-subtle`, so it follows your primary colour. 2. **Props.** Children only: a title line and a reason line. Add an icon from lucide inside the title if you want one. 3. **`className`.** Every part takes one, merged over the defaults. 4. **Parts.** `DecisionCallout`, `DecisionCalloutTitle` and `DecisionCalloutReason` each carry a `data-slot` (`decision-callout`, `decision-callout-title`, `decision-callout-reason`) to target from CSS. 5. **Own the source.** `signet add decision-callout` copies the file into your project. ## API Reference [#api-reference] | Part | Element | Default classes | | --- | --- | --- | | `DecisionCallout` | `div` | `col-start-2 mt-2 rounded-md bg-accent-primary-subtle px-3 py-2` | | `DecisionCalloutTitle` | `p` | `text-sm font-semibold text-text-primary` | | `DecisionCalloutReason` | `p` | `text-xs text-text-secondary tabular-nums` | Each takes `className` and every native prop of its element. # Dialog (/docs/components/dialog) ```tsx import { Button } from "@dapplelight/signet-ui/components/button" import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@dapplelight/signet-ui/components/dialog" import { Input } from "@dapplelight/signet-ui/components/input" import { Label } from "@dapplelight/signet-ui/components/label" export function Demo() { return ( }>Edit profile Edit profile Update how your name appears on invoices.
}>Cancel
) } ```
## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add dialog ``` ## Usage [#usage] ```tsx import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from "@dapplelight/signet-ui/components/dialog" import { Button } from "@dapplelight/signet-ui/components/button" }>Open Title Description ``` ## Examples [#examples] ### Controlled [#controlled] ```tsx import { useState } from "react" import { Button } from "@dapplelight/signet-ui/components/button" import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from "@dapplelight/signet-ui/components/dialog" import { Input } from "@dapplelight/signet-ui/components/input" export function Demo() { const [open, setOpen] = useState(false) return ( <> Invite a teammate They get an email with a link to join Acme Finance. ) } ``` ### Footer close button [#footer-close-button] ```tsx import { Button } from "@dapplelight/signet-ui/components/button" import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@dapplelight/signet-ui/components/dialog" export function Demo() { return ( }>Discard draft Discard this invoice draft? INV-1048 has unsaved changes that will be lost. ) } ``` ## API Reference [#api-reference] Built on Base UI's Dialog. `Dialog`, `DialogTrigger`, `DialogClose`, `DialogPortal`, `DialogOverlay`, `DialogTitle` and `DialogDescription` take that primitive's props. Use `render` to change the element a part renders. ### Dialog [#dialog] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `open` | `boolean` | none | Controlled open state. | | `defaultOpen` | `boolean` | `false` | Starting state when uncontrolled. | | `onOpenChange` | `(open: boolean) => void` | none | Called when the dialog opens or closes. | | `modal` | `boolean` | `true` | Trap focus and block the page behind. | ### DialogContent [#dialogcontent] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `showCloseButton` | `boolean` | `true` | The X button in the corner. | | `className` | `string` | none | Merged onto the popup. | ### DialogFooter [#dialogfooter] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `showCloseButton` | `boolean` | `false` | Adds a Close button that dismisses the dialog. | | `className` | `string` | none | Merged onto the footer. | # Drawer (/docs/components/drawer) ```tsx import { Button } from "@dapplelight/signet-ui/components/button" import { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger } from "@dapplelight/signet-ui/components/drawer" export function Demo() { return ( }>Open order Order #8841 3 items, $214.00, shipping to Pune. }>Close ) } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add drawer ``` ## Usage [#usage] ```tsx import { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, } from "@dapplelight/signet-ui/components/drawer" import { Button } from "@dapplelight/signet-ui/components/button" }>Open Title Description }>Close ``` ## Examples [#examples] ### Side [#side] ```tsx import { Button } from "@dapplelight/signet-ui/components/button" import { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger } from "@dapplelight/signet-ui/components/drawer" export function Demo() { return ( }>Filters Filter orders Narrow the list by status and date. }>Cancel ) } ``` ### Snap points [#snap-points] ```tsx import { Button } from "@dapplelight/signet-ui/components/button" import { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger } from "@dapplelight/signet-ui/components/drawer" export function Demo() { return ( }>Customer details Northwind Traders Drag up for the full history. }>Done ) } ``` ## API Reference [#api-reference] Built on Base UI's Drawer. `DrawerTrigger`, `DrawerClose`, `DrawerPortal`, `DrawerOverlay`, `DrawerTitle` and `DrawerDescription` take that primitive's props. ### Drawer [#drawer] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `swipeDirection` | `"down" \| "up" \| "left" \| "right"` | `"down"` | The edge it opens from, and the direction that dismisses it. | | `modal` | `boolean` | `true` | Show the overlay and block the page behind. | | `showSwipeHandle` | `boolean` | `false` | Show a grab handle. | | `snapPoints` | `number[]` | none | Heights the drawer can rest at. | | `open` | `boolean` | none | Controlled open state. | | `defaultOpen` | `boolean` | `false` | Starting state when uncontrolled. | | `onOpenChange` | `(open: boolean) => void` | none | Called when the drawer opens or closes. | ### DrawerContent [#drawercontent] Renders the portal, overlay and popup. Takes the popup's props and `className`. # Dropdown Menu (/docs/components/dropdown-menu) ```tsx import { Button } from "@dapplelight/signet-ui/components/button" import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger } from "@dapplelight/signet-ui/components/dropdown-menu" export function Demo() { return ( priya@acme.com Profile ⇧⌘P Billing ⌘B Team (upgrade) Sign out ) } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add dropdown-menu ``` ## Usage [#usage] ```tsx import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "@dapplelight/signet-ui/components/dropdown-menu" import { Button } from "@dapplelight/signet-ui/components/button" Profile ``` ## Examples [#examples] ### Checkboxes [#checkboxes] ```tsx import { useState } from "react" import { Button } from "@dapplelight/signet-ui/components/button" import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from "@dapplelight/signet-ui/components/dropdown-menu" export function Demo() { const [showStatus, setShowStatus] = useState(true) const [showDue, setShowDue] = useState(false) return ( Show columns Status Due date ) } ``` ### Radio group [#radio-group] ```tsx import { useState } from "react" import { Button } from "@dapplelight/signet-ui/components/button" import { DropdownMenu, DropdownMenuContent, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuTrigger } from "@dapplelight/signet-ui/components/dropdown-menu" export function Demo() { const [sort, setSort] = useState("newest") return ( newest amount customer ) } ``` ### Submenu [#submenu] ```tsx import { Button } from "@dapplelight/signet-ui/components/button" import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "@dapplelight/signet-ui/components/dropdown-menu" export function Demo() { return ( Duplicate Export as PDF CSV Delete ) } ``` ## API Reference [#api-reference] Built on Radix's Dropdown Menu. Every part takes that primitive's props; these are the Signet additions. ### DropdownMenu [#dropdownmenu] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `open` | `boolean` | - | Controlled open state. | | `defaultOpen` | `boolean` | `false` | Initial state when uncontrolled. | | `onOpenChange` | `(open: boolean) => void` | - | Runs when it opens or closes. | | `modal` | `boolean` | `true` | Block pointer interaction outside while open. | ### DropdownMenuContent [#dropdownmenucontent] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `sideOffset` | `number` | `4` | Gap from the trigger in px. | | `side` | `"top" \| "right" \| "bottom" \| "left"` | `"bottom"` | Preferred side; flips when there is no room. | | `align` | `"start" \| "center" \| "end"` | `"center"` | Alignment against the trigger. | | `loop` | `boolean` | `false` | Wrap arrow keys at the ends. | | `className` | `string` | none | Merged onto the content. Rendered in a portal. | ### DropdownMenuItem, DropdownMenuLabel, DropdownMenuSubTrigger [#dropdownmenuitem-dropdownmenulabel-dropdownmenusubtrigger] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `inset` | `boolean` | `false` | Indent to line up with items that have an indicator. | | `onSelect` (`DropdownMenuItem`) | `(event: Event) => void` | - | Runs on choice; `event.preventDefault()` keeps the menu open. | | `disabled` (`DropdownMenuItem`, `DropdownMenuSubTrigger`) | `boolean` | `false` | Not focusable or selectable. | | `className` | `string` | none | Merged last. | ### Other parts [#other-parts] `DropdownMenu`, `DropdownMenuTrigger`, `DropdownMenuGroup`, `DropdownMenuPortal`, `DropdownMenuSub` and `DropdownMenuRadioGroup` are the Radix parts. `DropdownMenuCheckboxItem` (`checked`, `onCheckedChange`), `DropdownMenuRadioItem` (`value`), `DropdownMenuSubContent`, `DropdownMenuSeparator` and `DropdownMenuShortcut` take their Radix props plus `className`. # Emoji Picker (/docs/components/emoji-picker) ```tsx import { useState } from "react" import { EmojiPicker } from "@dapplelight/signet-ui/components/emoji-picker" export function Demo() { const [icon, setIcon] = useState("🎯") return } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add emoji-picker ``` ## Usage [#usage] ```tsx import { useState } from "react" import { EmojiPicker } from "@dapplelight/signet-ui/components/emoji-picker" const [icon, setIcon] = useState("🎯") ``` ## Examples [#examples] ### Empty [#empty] ```tsx import { useState } from "react" import { EmojiPicker } from "@dapplelight/signet-ui/components/emoji-picker" export function Demo() { const [icon, setIcon] = useState(null) return } ``` ### Custom set [#custom-set] ```tsx import { useState } from "react" import { EmojiPicker } from "@dapplelight/signet-ui/components/emoji-picker" export function Demo() { const [icon, setIcon] = useState("☕") return ( ) } ``` ## API Reference [#api-reference] ### EmojiPicker [#emojipicker] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `value` | `string \| null \| undefined` | required | The selected emoji. | | `onChange` | `(emoji: string) => void` | required | Called with the chosen emoji; the popover then closes. | | `emojis` | `string[]` | `DEFAULT_EMOJIS` | The grid contents. | | `label` | `string` | `"Choose an emoji"` | Accessible name of the trigger and grid. | | `className` | `string` | none | Merged onto the trigger. | `DEFAULT_EMOJIS` is exported. # Empty State (/docs/components/empty-state) ```tsx import { InboxIcon } from "lucide-react" import { Button } from "@dapplelight/signet-ui/components/button" import { EmptyState } from "@dapplelight/signet-ui/components/empty-state" export function Demo() { return ( } title="No invoices yet" description="Create your first invoice and it will show up here." action={} /> ) } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add empty-state ``` ## Usage [#usage] ```tsx import { EmptyState } from "@dapplelight/signet-ui/components/empty-state" ``` ## Examples [#examples] ### Title only [#title-only] ```tsx import { EmptyState } from "@dapplelight/signet-ui/components/empty-state" export function Demo() { return } ``` ### With description [#with-description] ```tsx import { ReceiptIcon } from "lucide-react" import { EmptyState } from "@dapplelight/signet-ui/components/empty-state" export function Demo() { return ( } title="Nothing matches your filters" description="Try a different status or widen the date range." /> ) } ``` ## API Reference [#api-reference] ### EmptyState [#emptystate] Fills at least 60% of the viewport height, centred. | Prop | Type | Default | Description | | --- | --- | --- | --- | | `title` | `string` | required | The headline. | | `description` | `string` | none | Supporting text. | | `icon` | `ReactNode` | none | Shown above the title. | | `action` | `ReactNode` | none | Shown below, usually a Button. | # Error State (/docs/components/error-state) ```tsx import { ErrorState } from "@dapplelight/signet-ui/components/error-state" export function Demo() { return {}} /> } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add error-state ``` ## Usage [#usage] ```tsx import { ErrorState } from "@dapplelight/signet-ui/components/error-state" import { refetch } from "./actions" ``` ## Examples [#examples] ### Retry [#retry] ```tsx import { useState } from "react" import { ErrorState } from "@dapplelight/signet-ui/components/error-state" export function Demo() { const [tries, setTries] = useState(0) return ( setTries((n) => n + 1)} /> ) } ``` ### Without message [#without-message] ```tsx import { ErrorState } from "@dapplelight/signet-ui/components/error-state" export function Demo() { return } ``` ## API Reference [#api-reference] ### ErrorState [#errorstate] Renders with `role="alert"`. The heading and button text come from the labels provider (`somethingWentWrong`, `tryAgain`). | Prop | Type | Default | Description | | --- | --- | --- | --- | | `message` | `string` | none | Detail under the heading. | | `onRetry` | `() => void` | none | Shows a retry button when set. | # Experiment Screens (/docs/components/experiment-screens) ```tsx import { ExperimentResults } from "@dapplelight/signet-ui/screens/experiment-screens" import { experiments, results } from "./experiments" function ExperimentResultsDemo() { return ( undefined} onRollout={() => undefined} /> ) } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add experiment-screens ``` ## Usage [#usage] ```tsx import { ExperimentList, ExperimentResults, ExperimentForm, PricingExperimentResults, } from "@dapplelight/signet-ui/screens/experiment-screens" ``` Data is shaped like signet-db's `createExperiments` results or the `experimentAdminRoutes` JSON; actions come out as callbacks that may be async. An action that throws or resolves `false` shows the failure message. ```tsx import { ExperimentResults } from "@dapplelight/signet-ui/screens/experiment-screens" import { experiment, results, stop } from "./experiments" ``` ## Examples [#examples] ### ExperimentList [#experimentlist] ```tsx import { useState } from "react" import { ExperimentList } from "@dapplelight/signet-ui/screens/experiment-screens" import { experiments } from "./experiments" function ExperimentListDemo() { const [selected, setSelected] = useState("onboarding-checklist") return ( ) } ``` ### ExperimentResults [#experimentresults] ```tsx import { ExperimentResults } from "@dapplelight/signet-ui/screens/experiment-screens" import { experiments, results } from "./experiments" function ExperimentResultsDemo() { return ( undefined} onRollout={() => undefined} /> ) } ``` ### ExperimentForm [#experimentform] ```tsx import { ExperimentForm } from "@dapplelight/signet-ui/screens/experiment-screens" import { experiments } from "./experiments" function ExperimentFormDemo() { return ( true} onStart={() => undefined} /> ) } ``` ### PricingExperimentResults [#pricingexperimentresults] ```tsx import { PricingExperimentResults, type PricingReadoutView } from "@dapplelight/signet-ui/screens/experiment-screens" import { experiments } from "./experiments" function PricingExperimentResultsDemo() { const readout: PricingReadoutView = { placements: ["onboarding"], alpha: 0.05, control: "monthly-first", variants: [ { key: "monthly-first", offering: { offering: "pro-monthly" }, exposed: 2400, converted: 168, rate: 0.07, lift: null, pValue: null, significant: false, trials: 410, trialConverted: 120, trialConversion: 0.29, revenue: { USD: 167832 }, revenuePerExposed: { USD: 70 }, ltv: { estimate: true, perCurrency: { USD: 5400 }, churn: 0.08, expectedPayments: 12 }, }, { key: "annual-first", offering: { offering: "pro-annual" }, exposed: 2380, converted: 214, rate: 0.09, lift: 0.2857, pValue: 0.011, significant: true, trials: 430, trialConverted: 150, trialConversion: 0.35, revenue: { USD: 256800 }, revenuePerExposed: { USD: 108 }, ltv: { estimate: true, perCurrency: { USD: 6200 }, churn: 0.06, expectedPayments: 16 }, }, ], } return ( undefined} onStop={() => undefined} /> ) } ``` ## API Reference [#api-reference] All screens also accept the props of their root element and `labels` (`Partial`, defaults in `DEFAULT_EXPERIMENT_LABELS`). ### ExperimentList [#experimentlist-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `experiments` | `readonly ExperimentView[]` | required | Experiments to list. | | `selected` | `string` | - | Key of the experiment shown, marked `aria-current`. | | `onSelect` | `(key: string) => void` | - | Called when one is picked. | ### ExperimentResults [#experimentresults-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `experiment` | `ExperimentView` | required | The experiment. | | `results` | `ExperimentResultsView \| null` | - | Per-variant results; null when the server has no events table. | | `onStart` | `() => unknown` | - | Start or resume. | | `onStop` | `() => unknown` | - | Stop. | | `onRollout` | `(variant: string) => unknown` | - | Roll out a variant. | ### ExperimentForm [#experimentform-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `experiment` | `ExperimentView` | - | The experiment to edit; omitted creates one. | | `offerings` | `readonly OfferingChoice[]` | - | Offerings to pick per variant (pricing experiment); omitted shows a JSON value field. | | `onSubmit` | `(input: ExperimentInputView) => unknown` | required | Create or save. Resolve `false` or throw to show the failure. | | `onStart` | `() => unknown` | - | Start the experiment. | | `onStop` | `() => unknown` | - | Stop the experiment. | ### PricingExperimentResults [#pricingexperimentresults-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `experiment` | `ExperimentView` | required | The experiment. | | `readout` | `PricingReadoutView` | required | Per-variant offering, conversion, trial conversion, revenue and LTV. | | `onRollout` | `(variant: string) => unknown` | - | Make a variant's offering the placement's offering. | | `onStart` | `() => unknown` | - | Start the experiment. | | `onStop` | `() => unknown` | - | Stop the experiment. | ### ExperimentStatusBadge [#experimentstatusbadge] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `status` | `"draft" \| "running" \| "stopped" \| "rolled_out"` | required | Status to show. | | `labels` | `Partial` | - | Override any string. | # Field (/docs/components/field) ```tsx import { Field, FieldControl, FieldDescription, FieldLabel } from "@dapplelight/signet-ui/components/field" export function Demo() { return ( Billing email Receipts are sent here. ) } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add field ``` ## Usage [#usage] ```tsx import { Field, FieldControl, FieldDescription, FieldError, FieldLabel, } from "@dapplelight/signet-ui/components/field" const errors = [{ message: "Enter a full email address" }] Email We send receipts here. ``` ## Examples [#examples] ### Error [#error] ```tsx import { useState } from "react" import { Field, FieldControl, FieldDescription, FieldError, FieldLabel } from "@dapplelight/signet-ui/components/field" export function Demo() { const [email, setEmail] = useState("billing@acme") return ( Billing email setEmail(e.target.value)} /> Receipts are sent here. ) } ``` ### Required [#required] ```tsx import { Field, FieldControl, FieldError, FieldLabel } from "@dapplelight/signet-ui/components/field" export function Demo() { return ( Company name Company name is required. ) } ``` ### Disabled [#disabled] ```tsx import { Field, FieldControl, FieldDescription, FieldLabel } from "@dapplelight/signet-ui/components/field" export function Demo() { return ( Workspace ID Set when the workspace was created. ) } ``` ## API Reference [#api-reference] Built on UI SDK's field. Every part takes that primitive's props plus `className`. ### Field [#field] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `errors` | `readonly (string \| { message?: string } \| null \| undefined)[]` | none | Validation errors, such as a TanStack Form field's `state.meta.errors`. Any message marks the field invalid. | | `invalid` | `boolean` | from `errors` | Force the invalid state. | | `disabled` | `boolean` | `false` | Disable the field and dim it. | ### FieldControl [#fieldcontrol] Renders Signet's `Input` unless `render` is given. Takes input props. ### FieldError [#fielderror] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `children` | `ReactNode` | first of `errors` | Message to show whenever the field is invalid. | | `match` | validity flag | none | Show only for one browser validity flag, such as `valueMissing`. | ### FieldLabel, FieldDescription [#fieldlabel-fielddescription] Text parts; they take `className` and the primitive's props. # Fold (/docs/components/fold) ```tsx import { Fold } from "@dapplelight/signet-ui/components/fold" const notes = `Changed **packages/ui** only. - Added the Fold component and its tests - Reused Markdown for the body` export function Demo() { return ( {notes} ) } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add fold ``` The body is rendered by [Markdown](/docs/components/markdown), so Fold needs its optional peers (`react-markdown`, `remark-gfm`, `remark-parse`, `unified`, `github-slugger`). That is why it is imported from `components/fold` and not the barrel. ## Usage [#usage] ```tsx import { Fold } from "@dapplelight/signet-ui/components/fold" {markdown} ``` The toggle is a real button: Enter and Space work, `aria-expanded` announces open or closed, and `aria-controls` points at the text. The text is capped at about 66 characters wide. ## Examples [#examples] ### Open at first [#open-at-first] ```tsx {markdown} ``` ### Your own words and styles [#your-own-words-and-styles] ```tsx {markdown} ``` ## Customising [#customising] - **Tokens:** it uses theme utilities only, so a theme change restyles it. - **Words:** `showMoreLabel` / `showLessLabel`, or `showMore` / `showLess` once for the app through `LabelsProvider`. - **Classes and state:** `className`, `classNames` per part (`header`, `title`, `detail`, `toggle`, `body`, `markdown`) and `data-state="open|closed"`. - **Parts:** `FoldRoot`, `FoldHeader`, `FoldTitle`, `FoldDetail`, `FoldToggle`, `FoldBody` to build your own row (a badge in the header, plain text in the body). - **Own the code:** `signet add fold` copies the file in. ## API Reference [#api-reference] ### Fold [#fold] | Prop | Type | Default | Description | | --- | --- | --- | --- | | title | `ReactNode` | - | The row's title. | | detail | `ReactNode` | - | Muted text beside the title. | | children | `string` | - | The long text, as Markdown. | | open | `boolean` | - | Controlled state. | | defaultOpen | `boolean` | `false` | Start open. | | onOpenChange | `(open: boolean) => void` | - | Called when the link is used. | | showMoreLabel | `string` | `"Show more"` | Link text while closed. | | showLessLabel | `string` | `"Show less"` | Link text while open. | | markdown | `Omit` | - | Passed to the Markdown renderer. | | classNames | `{ header?; title?; detail?; toggle?; body?; markdown? }` | - | Class per part. | # Funnel Screens (/docs/components/funnel-screens) ```tsx import { WebFunnel } from "@dapplelight/signet-ui/screens/funnel-screens" import { page } from "./funnel" function WebFunnelDemo() { return ( undefined} display={{ pro: { name: "Pro", features: ["Unlimited workouts", "Meal plans"] } }} /> ) } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add funnel-screens ``` ## Usage [#usage] ```tsx import { WebFunnel, FunnelQuestion, ExpressCheckout, FunnelRedemption, } from "@dapplelight/signet-ui/screens/funnel-screens" ``` Props are shaped like signet-server's funnel routes JSON; actions come out as callbacks, so any client fits. ```tsx import { ExpressCheckout, WebFunnel } from "@dapplelight/signet-ui/screens/funnel-screens" import { page, startCheckout } from "./funnel" } /> ``` ## Examples [#examples] ### WebFunnel [#webfunnel] ```tsx import { WebFunnel } from "@dapplelight/signet-ui/screens/funnel-screens" import { page } from "./funnel" function WebFunnelDemo() { return ( undefined} display={{ pro: { name: "Pro", features: ["Unlimited workouts", "Meal plans"] } }} /> ) } ``` ### FunnelQuestion [#funnelquestion] ```tsx import { useState } from "react" import { FunnelQuestion } from "@dapplelight/signet-ui/screens/funnel-screens" import { page } from "./funnel" function FunnelQuestionDemo() { const [value, setValue] = useState() return ( ) } ``` ### ExpressCheckout [#expresscheckout] Stripe.js loads from Stripe at runtime; this demo passes a stand-in `loadStripe` so no key or network is needed. ```tsx import { ExpressCheckout } from "@dapplelight/signet-ui/screens/funnel-screens" function ExpressCheckoutDemo() { // A stand-in for Stripe.js so the demo needs no network or keys. const loadStripe = async () => ({ elements: () => ({ create: () => ({ mount: (el: HTMLElement) => { el.textContent = "Payment Element mounts here" }, on: () => undefined, }), submit: async () => ({}), }), confirmPayment: async () => ({}), }) return ( ) } ``` ### FunnelRedemption [#funnelredemption] ```tsx import { FunnelRedemption } from "@dapplelight/signet-ui/screens/funnel-screens" function FunnelRedemptionDemo() { return ( ) } ``` ## API Reference [#api-reference] All screens accept the props of their root element and `labels` (`Partial`, defaults in `DEFAULT_FUNNEL_LABELS`). ### WebFunnel [#webfunnel-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `page` | `FunnelPageView` | required | The funnel, its offering and the URL's discounts per product. | | `code` | `string` | `""` | The discount code from the URL, shown in the checkout step. | | `onStep` | `(step: string) => void` | - | A step was shown: a question id, `"plans"` or `"checkout"`. | | `onCheckout` | `(request: FunnelCheckoutRequest) => unknown` | required | Start the checkout. Its result goes to `renderCheckout`. | | `renderCheckout` | `(result: unknown) => ReactNode` | - | Render the gateway step, e.g. `ExpressCheckout`. | | `display` | `Record>` | - | Names, descriptions and features per plan key for the paywall. | ### FunnelQuestion [#funnelquestion-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `question` | `FunnelQuestionView` | required | `id`, `title`, `options` and `multiple`. | | `value` | `string \| string[]` | - | The current answer. | | `onAnswer` | `(value: string \| string[]) => void` | required | Single choice answers on click; multiple choice on Continue. | ### ExpressCheckout [#expresscheckout-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `publishableKey` | `string` | required | Stripe publishable key. | | `clientSecret` | `string` | required | The checkout's PaymentIntent client secret. | | `returnUrl` | `string` | required | Where Stripe sends the buyer back (the funnel page with `?session=`). | | `amount` | `number` | required | Amount in minor units. | | `currency` | `string` | required | Currency code. | | `loadStripe` | `(publishableKey: string) => Promise` | loads `STRIPE_JS_URL` | Return `Stripe(key)`. | ### FunnelRedemption [#funnelredemption-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `data` | `FunnelSessionView \| null` | required | The latest session read; null while the first read is in flight. Poll until paid. | ### Helpers [#helpers] | Export | Description | | --- | --- | | `discountedOffering(offering, discounts)` | The offering with each valid discount priced into its product. | | `loadScript(src)` | Load a script once per page. | | `STRIPE_JS_URL` | The Stripe.js URL. | # Growth Screens (/docs/components/growth-screens) ```tsx import { useState } from "react" import { OnboardingChecklist } from "@dapplelight/signet-ui/screens/growth-screens" function OnboardingChecklistDemo() { const [done, setDone] = useState(["profile"]) return ( setDone((d) => (d.includes(step.key) ? d : [...d, step.key]))} steps={[ { key: "profile", title: "Complete your profile", description: "Add a photo and your team name." }, { key: "invite", title: "Invite a teammate", description: "Work together on the same board." }, { key: "import", title: "Import your invoices", description: "Upload a CSV from your old tool." }, ]} /> ) } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add growth-screens ``` ## Usage [#usage] ```tsx import { WaitlistJoin, InviteAccept, ReferralCard, OnboardingChecklist, FeedbackWidget, WhatsNew, } from "@dapplelight/signet-ui/screens/growth-screens" ``` Data is shaped like signet-db's growth module results; actions come out as callbacks. ```tsx import { WaitlistJoin } from "@dapplelight/signet-ui/screens/growth-screens" import { growth } from "./growth" growth.joinWaitlist(email)} /> ``` ## Examples [#examples] ### WaitlistJoin [#waitlistjoin] ```tsx import { WaitlistJoin } from "@dapplelight/signet-ui/screens/growth-screens" function WaitlistJoinDemo() { return ( ({ email, position: 412, joined: true })} /> ) } ``` ### InviteAccept [#inviteaccept] ```tsx import { InviteAccept } from "@dapplelight/signet-ui/screens/growth-screens" function InviteAcceptDemo() { return ( ({ ok: true })} onDecline={() => undefined} /> ) } ``` A failure that is known up front, such as a token that did not resolve, shows through `error`. ```tsx import { InviteAccept } from "@dapplelight/signet-ui/screens/growth-screens" function InviteAcceptExpiredDemo() { return ( ({ ok: false, reason: "expired" })} /> ) } ``` ### ReferralCard [#referralcard] ```tsx import { ReferralCard } from "@dapplelight/signet-ui/screens/growth-screens" function ReferralCardDemo() { return ( ) } ``` ### OnboardingChecklist [#onboardingchecklist] ```tsx import { useState } from "react" import { OnboardingChecklist } from "@dapplelight/signet-ui/screens/growth-screens" function OnboardingChecklistDemo() { const [done, setDone] = useState(["profile"]) return ( setDone((d) => (d.includes(step.key) ? d : [...d, step.key]))} steps={[ { key: "profile", title: "Complete your profile", description: "Add a photo and your team name." }, { key: "invite", title: "Invite a teammate", description: "Work together on the same board." }, { key: "import", title: "Import your invoices", description: "Upload a CSV from your old tool." }, ]} /> ) } ``` ### FeedbackForm [#feedbackform] ```tsx import { FeedbackForm } from "@dapplelight/signet-ui/screens/growth-screens" function FeedbackFormDemo() { return ( new Promise((resolve) => setTimeout(resolve, 400))} /> ) } ``` ### FeedbackWidget [#feedbackwidget] ```tsx import { FeedbackWidget } from "@dapplelight/signet-ui/screens/growth-screens" function FeedbackWidgetDemo() { return undefined} /> } ``` ### WhatsNew [#whatsnew] ```tsx import { useState } from "react" import { WhatsNew } from "@dapplelight/signet-ui/screens/growth-screens" import { entries } from "./growth" function WhatsNewDemo() { const [unseen, setUnseen] = useState(2) return setUnseen(0)} /> } ``` ## API Reference [#api-reference] All screens accept `labels` (`Partial`, defaults in `DEFAULT_GROWTH_LABELS`) except where noted, and the props of their root element. ### WaitlistJoin [#waitlistjoin-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `onJoin` | `(email: string) => Promise \| WaitlistResult` | required | Join and return the place in line. | | `result` | `WaitlistResult \| null` | - | The result (controlled), e.g. from an earlier visit. | | `defaultResult` | `WaitlistResult \| null` | - | Initial result when uncontrolled. | | `onResultChange` | `(result: WaitlistResult \| null) => void` | - | Called when the result changes. | | `title` | `ReactNode` | - | Heading override. | ### InviteAccept [#inviteaccept-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `invite` | `InviteDetails` | required | Inviter, scope, role, email and expiry. | | `onAccept` | `() => Promise \| InviteAcceptResult` | required | Accept the invite. | | `onDecline` | `() => void` | - | Shows Decline when set. | | `onAccepted` | `() => void` | - | Called after a successful accept, e.g. to navigate. | | `error` | `"not_found" \| "expired" \| "used" \| "revoked" \| "email_mismatch"` | - | Show a failure straight away. | ### ReferralCard [#referralcard-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `code` | `string` | required | The referral code. | | `url` | `string` | required | The link that carries the code. | | `stats` | `{ referred: number; converted: number; rewarded: number }` | - | Counts of friends. | | `onShare` | `(url: string) => void` | Web Share API, else copy | Replaces the share action. | | `title` | `ReactNode` | - | Heading override. | ### OnboardingChecklist [#onboardingchecklist-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `steps` | `readonly OnboardingStep[]` | required | `key`, `title` and optional `description`. | | `done` | `readonly string[]` | - | Done step keys (controlled). | | `defaultDone` | `readonly string[]` | - | Initial done keys when uncontrolled. | | `onDoneChange` | `(done: string[]) => void` | - | Called when done keys change. | | `onStepSelect` | `(step: OnboardingStep) => void` | - | A step was chosen: take the user there. | | `onDismiss` | `() => void` | - | Shows Dismiss when set. | | `title` | `ReactNode` | - | Heading override. | ### FeedbackForm [#feedbackform-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `onSubmit` | `(input: FeedbackInput) => Promise \| unknown` | required | Send the feedback. | | `kinds` | `readonly string[]` | bug, idea, praise, other | Feedback kinds. | | `rating` | `boolean` | - | Ask for 1 to 5 stars too. | | `defaultKind` | `string` | - | The kind selected first. | ### FeedbackWidget [#feedbackwidget-1] Takes every `FeedbackForm` prop, plus: | Prop | Type | Default | Description | | --- | --- | --- | --- | | `open` | `boolean` | - | Popover open state (controlled). | | `defaultOpen` | `boolean` | `false` | Initial open state. | | `onOpenChange` | `(open: boolean) => void` | - | Called when it opens or closes. | | `trigger` | `ReactElement` | - | Replaces the trigger button. | | `contentClassName` | `string` | - | Class on the popover content. | ### WhatsNew [#whatsnew-1] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `entries` | `readonly ChangelogEntry[]` | required | Every entry, newest first. | | `unseen` | `number` | `0` | How many are unseen. | | `onOpen` | `() => void` | - | Opened: mark them seen. | | `open` | `boolean` | - | Open state (controlled). | | `defaultOpen` | `boolean` | `false` | Initial open state. | | `onOpenChange` | `(open: boolean) => void` | - | Called when it opens or closes. | | `trigger` | `ReactElement` | - | Replaces the trigger button. | | `className` | `string` | - | Class on the trigger. | | `contentClassName` | `string` | - | Class on the popover content. | # Components (/docs/components) # Input Group (/docs/components/input-group) ```tsx import { SearchIcon } from "lucide-react" import { InputGroup, InputGroupAddon, InputGroupInput } from "@dapplelight/signet-ui/components/input-group" export function Demo() { return ( ) } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add input-group ``` ## Usage [#usage] ```tsx import { InputGroup, InputGroupAddon, InputGroupInput, } from "@dapplelight/signet-ui/components/input-group" import { SearchIcon } from "lucide-react" ``` ## Examples [#examples] ### Text addons [#text-addons] ```tsx import { InputGroup, InputGroupAddon, InputGroupInput, InputGroupText } from "@dapplelight/signet-ui/components/input-group" export function Demo() { return (
$ USD https:// .signet.app
) } ```
### Button [#button] ```tsx import { useState } from "react" import { EyeIcon, EyeOffIcon } from "lucide-react" import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "@dapplelight/signet-ui/components/input-group" export function Demo() { const [show, setShow] = useState(false) return ( setShow((s) => !s)} > {show ? : } ) } ``` ### Textarea [#textarea] ```tsx import { InputGroup, InputGroupAddon, InputGroupText, InputGroupTextarea } from "@dapplelight/signet-ui/components/input-group" export function Demo() { return ( 0 / 280 ) } ``` ## API Reference [#api-reference] ### InputGroup [#inputgroup] The bordered wrapper, `role="group"`. Takes `div` props. ### InputGroupAddon [#inputgroupaddon] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `align` | `"inline-start" \| "inline-end" \| "block-start" \| "block-end"` | `"inline-start"` | Where the addon sits. Block values stack it above or below the control. | Clicking an addon focuses the input. ### InputGroupButton [#inputgroupbutton] A `Button` with compact sizes. | Prop | Type | Default | Description | | --- | --- | --- | --- | | `size` | `"xs" \| "sm" \| "icon-xs" \| "icon-sm"` | `"xs"` | Size. | | `variant` | Button variants | `"ghost"` | Button variant. | | `type` | `"button" \| "submit" \| "reset"` | `"button"` | Button type. | ### InputGroupInput, InputGroupTextarea, InputGroupText [#inputgroupinput-inputgrouptextarea-inputgrouptext] `InputGroupInput` and `InputGroupTextarea` take `input` and `textarea` props. `InputGroupText` is a `span` for static text or an icon. # Input OTP (/docs/components/input-otp) ```tsx import { InputOTP, InputOTPGroup, InputOTPSlot } from "@dapplelight/signet-ui/components/input-otp" export function Demo() { return ( ) } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add input-otp ``` ## Usage [#usage] ```tsx import { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, } from "@dapplelight/signet-ui/components/input-otp" ``` ## Examples [#examples] ### Separator [#separator] ```tsx import { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot } from "@dapplelight/signet-ui/components/input-otp" export function Demo() { return ( ) } ``` ### Controlled [#controlled] ```tsx import { useState } from "react" import { InputOTP, InputOTPGroup, InputOTPSlot } from "@dapplelight/signet-ui/components/input-otp" export function Demo() { const [code, setCode] = useState("") return (

{code.length === 4 ? `Code ${code} entered` : "Enter the 4-digit PIN"}

) } ```
### Disabled [#disabled] ```tsx import { InputOTP, InputOTPGroup, InputOTPSlot } from "@dapplelight/signet-ui/components/input-otp" export function Demo() { return ( ) } ``` ## API Reference [#api-reference] Built on the `input-otp` package. `InputOTP` takes its props; screen readers see one text input. ### InputOTP [#inputotp] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `maxLength` | `number` | required | Number of characters. | | `value` | `string` | none | Controlled value. | | `onChange` | `(value: string) => void` | none | Called on every change. | | `onComplete` | `(value: string) => void` | none | Called when all slots are filled. | | `defaultValue` | `string` | none | Initial value when uncontrolled. | | `pattern` | `string` | none (any character) | Regular expression source the whole value must match, such as `"^[0-9]+$"`. | | `inputMode` | `string` | `"numeric"` | Soft keyboard type. | | `textAlign` | `"left" \| "center" \| "right"` | `"left"` | Alignment of the hidden input's caret. | | `pasteTransformer` | `(pasted: string) => string` | none | Clean pasted text, for example strip dashes. | | `pushPasswordManagerStrategy` | `"increase-width" \| "none"` | `"increase-width"` | Make room for a password manager's badge. | | `autoComplete` | `string` | `"one-time-code"` | Lets the OS offer SMS codes. | | `disabled` | `boolean` | `false` | Disable the input (a standard input attribute). | | `containerClassName` | `string` | none | Class for the wrapper. | | `className` | `string` | none | Class for the hidden input; `disabled:cursor-not-allowed` is built in. | ### InputOTPSlot [#inputotpslot] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `index` | `number` | required | Which character this slot shows. | ### InputOTPGroup, InputOTPSeparator [#inputotpgroup-inputotpseparator] `InputOTPGroup` joins slots into one bordered row. `InputOTPSeparator` is a decorative dash, hidden from screen readers. # Input (/docs/components/input) ```tsx import { Input } from "@dapplelight/signet-ui/components/input" export function Demo() { return } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add input ``` ## Usage [#usage] ```tsx import { Input } from "@dapplelight/signet-ui/components/input" ``` ## Examples [#examples] ### With label [#with-label] ```tsx import { Input } from "@dapplelight/signet-ui/components/input" import { Label } from "@dapplelight/signet-ui/components/label" export function Demo() { return (
) } ```
### File [#file] ```tsx import { Input } from "@dapplelight/signet-ui/components/input" import { Label } from "@dapplelight/signet-ui/components/label" export function Demo() { return (
) } ```
### Disabled [#disabled] ```tsx import { Input } from "@dapplelight/signet-ui/components/input" export function Demo() { return } ``` ### Invalid [#invalid] ```tsx import { Input } from "@dapplelight/signet-ui/components/input" export function Demo() { return } ``` ## Composition [#composition] ```tsx import { Button } from "@dapplelight/signet-ui/components/button" import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@dapplelight/signet-ui/components/card" import { Input } from "@dapplelight/signet-ui/components/input" import { Label } from "@dapplelight/signet-ui/components/label" export function SignUpCard() { return ( Create your account Sign in with a magic link. No password. ) } ``` ## API Reference [#api-reference] ### Input [#input] | Prop | Type | Default | Required | Description | | --- | --- | --- | --- | --- | | `type` | `string` | `"text"` | No | Any HTML input type. | | `aria-invalid` | `boolean` | — | No | Shows the error style. | | `className` | `string` | — | No | Merged last. | Plus every native [``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input) attribute. # Job Runs (/docs/components/job-runs) ```tsx import { type JobRun, JobRuns } from "@dapplelight/signet-ui/domain/job-runs" import { useState } from "react" const initial: JobRun[] = [ { id: "run_8f21", job: "invoice.generate", state: "running", attempt: 1, progress: { done: 340, total: 500, note: "March invoices" }, }, { id: "run_8f20", job: "email.digest", state: "done", attempt: 1 }, { id: "run_8f1e", job: "payout.settle", state: "dead", attempt: 5, error: { code: "GATEWAY_TIMEOUT", message: "Bank did not respond" }, }, { id: "run_8f1b", job: "report.export", state: "queued", attempt: 0 }, ] export function JobRunsDemo() { const [runs, setRuns] = useState(initial) return (
setRuns((rs) => rs.map((r) => r.id === run.id ? { ...r, state: "queued", attempt: r.attempt + 1, error: undefined } : r, ), ) } onCancel={(run) => setRuns((rs) => rs.map((r) => (r.id === run.id ? { ...r, state: "cancelled" } : r)))} />
) } ```
## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add job-runs ``` ## Usage [#usage] ```tsx import { JobRuns, type JobRun } from "@dapplelight/signet-ui/domain/job-runs" import { cancel, retry, runs } from "./jobs" ``` ## Examples [#examples] ### Retry and cancel [#retry-and-cancel] ```tsx import { type JobRun, JobRuns } from "@dapplelight/signet-ui/domain/job-runs" import { useState } from "react" const initial: JobRun[] = [ { id: "run_8f21", job: "invoice.generate", state: "running", attempt: 1, progress: { done: 340, total: 500, note: "March invoices" }, }, { id: "run_8f20", job: "email.digest", state: "done", attempt: 1 }, { id: "run_8f1e", job: "payout.settle", state: "dead", attempt: 5, error: { code: "GATEWAY_TIMEOUT", message: "Bank did not respond" }, }, { id: "run_8f1b", job: "report.export", state: "queued", attempt: 0 }, ] export function JobRunsDemo() { const [runs, setRuns] = useState(initial) return (
setRuns((rs) => rs.map((r) => r.id === run.id ? { ...r, state: "queued", attempt: r.attempt + 1, error: undefined } : r, ), ) } onCancel={(run) => setRuns((rs) => rs.map((r) => (r.id === run.id ? { ...r, state: "cancelled" } : r)))} />
) } ```
### Read only [#read-only] ```tsx import { type JobRun, JobRuns } from "@dapplelight/signet-ui/domain/job-runs" const initial: JobRun[] = [ { id: "run_8f21", job: "invoice.generate", state: "running", attempt: 1, progress: { done: 340, total: 500, note: "March invoices" }, }, { id: "run_8f20", job: "email.digest", state: "done", attempt: 1 }, { id: "run_8f1e", job: "payout.settle", state: "dead", attempt: 5, error: { code: "GATEWAY_TIMEOUT", message: "Bank did not respond" }, }, { id: "run_8f1b", job: "report.export", state: "queued", attempt: 0 }, ] export function JobRunsReadOnlyDemo() { return (
) } ```
### Empty [#empty] ```tsx import { JobRuns } from "@dapplelight/signet-ui/domain/job-runs" export function JobRunsEmptyDemo() { return (
) } ```
## API Reference [#api-reference] ### JobRuns [#jobruns] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `runs` | `JobRun[]` | — | Rows as `jobs.status(id)` or a dead-letter entry describe them. | | `onRetry` | `(run: JobRun) => void` | — | Shows Retry on failed (`dead`) runs. | | `onCancel` | `(run: JobRun) => void` | — | Shows Cancel on runs that have not finished. | | `emptyMessage` | `string` | `"No job runs"` | Shown when `runs` is empty. | | `className` | `string` | — | Class for the table. | ### JobRun [#jobrun] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `id` | `string` | — | Run id. | | `job` | `string` | — | Job name. | | `state` | `string` | — | `running`, `done`, `dead`, `cancelled`, or any other state. | | `attempt` | `number` | — | Attempts so far. | | `error` | `{ code: string; message?: string }` | — | Shown in red. | | `progress` | `{ done: number; total?: number; note?: string }` | — | Shown as `done/total · note`. | | `updatedAt` | `string` | — | Last update. | # Kanban (/docs/components/kanban) ```tsx import { Kanban, KanbanColumn, KanbanColumnHeader, KanbanColumnTitle, KanbanItem, KanbanList } from "@dapplelight/signet-ui/domain/kanban" const tasks: Record = { t1: "Draft Q3 pricing page", t2: "Fix invoice rounding bug", t3: "Onboard Northwind account", t4: "Migrate webhooks to v2", t5: "Ship dark mode", } const columns = { todo: "To do", doing: "In progress", done: "Done" } export function KanbanDemo() { return ( {(board) => Object.entries(columns).map(([value, title]) => ( {title} {board[value]?.length ?? 0} {(board[value] ?? []).map((id) => ( {tasks[id]} ))} )) } ) } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add kanban ``` ## Usage [#usage] ```tsx import { Kanban, KanbanColumn, KanbanColumnHeader, KanbanColumnTitle, KanbanList, KanbanItem } from "@dapplelight/signet-ui/domain/kanban" To do Draft pricing page ``` Pick up a card with Space or Enter, move it with the arrow keys, drop with Space, cancel with Escape. `data-over`, `data-lifted` and `data-dragging` mark the states. ## Examples [#examples] ### Uncontrolled [#uncontrolled] ```tsx import { Kanban, KanbanColumn, KanbanColumnHeader, KanbanColumnTitle, KanbanItem, KanbanList } from "@dapplelight/signet-ui/domain/kanban" const tasks: Record = { t1: "Draft Q3 pricing page", t2: "Fix invoice rounding bug", t3: "Onboard Northwind account", t4: "Migrate webhooks to v2", t5: "Ship dark mode", } const columns = { todo: "To do", doing: "In progress", done: "Done" } export function KanbanDemo() { return ( {(board) => Object.entries(columns).map(([value, title]) => ( {title} {board[value]?.length ?? 0} {(board[value] ?? []).map((id) => ( {tasks[id]} ))} )) } ) } ``` ### Controlled [#controlled] ```tsx import { Kanban, type KanbanBoard, KanbanColumn, KanbanColumnHeader, KanbanColumnTitle, KanbanItem, KanbanList, type KanbanMove } from "@dapplelight/signet-ui/domain/kanban" import { useState } from "react" const tasks: Record = { t1: "Draft Q3 pricing page", t2: "Fix invoice rounding bug", t3: "Onboard Northwind account", t4: "Migrate webhooks to v2", t5: "Ship dark mode", } const columns = { todo: "To do", doing: "In progress", done: "Done" } export function KanbanControlledDemo() { const [board, setBoard] = useState({ todo: ["t1", "t2", "t3"], doing: ["t4"], done: ["t5"] }) const [last, setLast] = useState(null) return (
{Object.entries(columns).map(([value, title]) => ( {title} {(board[value] ?? []).map((id) => ( {tasks[id]} ))} ))}

{last ? `Moved ${tasks[last.item]} from ${last.from} to ${last.to} at ${last.index}` : "Drag a card, or focus one and press Space."}

) } ```
### Screen reader messages [#screen-reader-messages] ```tsx import { Kanban, KanbanColumn, KanbanItem, KanbanList } from "@dapplelight/signet-ui/domain/kanban" const tasks: Record = { t1: "Draft Q3 pricing page", t2: "Fix invoice rounding bug", t3: "Onboard Northwind account", t4: "Migrate webhooks to v2", t5: "Ship dark mode", } const columns = { todo: "To do", doing: "In progress", done: "Done" } export function KanbanMessagesDemo() { return ( `${item} now in ${column}, ${p} of ${n}.`, }} > {(board) => ( <> {(board.todo ?? []).map((id) => ( {tasks[id]} ))} {(board.done ?? []).map((id) => ( {tasks[id]} ))} )} ) } ``` ## API Reference [#api-reference] ### Kanban [#kanban] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `value` | `KanbanBoard` | — | Controlled board: column id to item ids, in order. | | `defaultValue` | `KanbanBoard` | `{}` | Initial board when uncontrolled. | | `onValueChange` | `(board: KanbanBoard) => void` | — | The whole board after a card is dropped somewhere new. | | `onItemMove` | `(move: KanbanMove) => void` | — | The single move (`item`, `from`, `to`, `index`), for saving to a server. | | `messages` | `Partial` | — | Screen reader text: `instructions`, `itemRoleDescription`, `lifted`, `moved`, `dropped`, `cancelled`. | | `children` | `ReactNode \| (board: KanbanBoard) => ReactNode` | — | Columns and cards. A function gets the board as it is now. | | `liveRegionClassName` | `string` | — | Class for the hidden live region. | ### KanbanColumn [#kanbancolumn] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `value` | `string` | — | The column's key in the board. | | `label` | `string` | — | Accessible name. Defaults to the KanbanColumnTitle text. | | `render` | `ReactElement` | — | Replaces the element. | ### KanbanItem [#kanbanitem] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `value` | `string` | — | The item's id in the board. | | `label` | `string` | — | Name used in announcements. Defaults to the card's text. | | `render` | `ReactElement` | — | Replaces the element. | ### KanbanColumnHeader, KanbanColumnTitle, KanbanList [#kanbancolumnheader-kanbancolumntitle-kanbanlist] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `className` | `string` | — | Merged over the defaults. KanbanColumnTitle and KanbanList also take `render`. | # Kbd (/docs/components/kbd) ```tsx import { Kbd } from "@dapplelight/signet-ui/components/kbd" export function Demo() { return ⌘K } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add kbd ``` ## Usage [#usage] ```tsx import { Kbd, KeySequence } from "@dapplelight/signet-ui/components/kbd" ⌘K ``` ## Examples [#examples] ### Sequence [#sequence] ```tsx import { KeySequence } from "@dapplelight/signet-ui/components/kbd" export function Demo() { return (
) } ```
### Inline [#inline] ```tsx import { Kbd, KeySequence } from "@dapplelight/signet-ui/components/kbd" export function Demo() { return (

Press / to search invoices, or to send.

) } ```
## API Reference [#api-reference] ### Kbd [#kbd] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `children` | `ReactNode` | none | The key label. | | `className` | `string` | none | Merged last. | ### KeySequence [#keysequence] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `keys` | `string \| string[]` | required | One key per entry, each in its own `Kbd`. | | `className` | `string` | none | Merged onto the wrapper. | # Label (/docs/components/label) ```tsx import { Input } from "@dapplelight/signet-ui/components/input" import { Label } from "@dapplelight/signet-ui/components/label" export function Demo() { return (
) } ```
## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add label ``` ## Usage [#usage] ```tsx import { Label } from "@dapplelight/signet-ui/components/label" import { Input } from "@dapplelight/signet-ui/components/input" ``` ## Examples [#examples] ### With checkbox [#with-checkbox] ```tsx import { Checkbox } from "@dapplelight/signet-ui/components/checkbox" import { Label } from "@dapplelight/signet-ui/components/label" export function Demo() { return (
) } ```
### Disabled [#disabled] ```tsx import { Input } from "@dapplelight/signet-ui/components/input" import { Label } from "@dapplelight/signet-ui/components/label" export function Demo() { return (
) } ```
## API Reference [#api-reference] ### Label [#label] | Prop | Type | Default | Description | | --- | --- | --- | --- | | `htmlFor` | `string` | none | The id of the control it names. | | `className` | `string` | none | Merged last. | Plus every `
Recent invoices Invoice Status Method Amount {invoices.map((inv) => ( {inv.id} {inv.status} {inv.method} {inv.amount} ))}
) } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add table ``` ## Usage [#usage] ```tsx import { Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow, } from "@dapplelight/signet-ui/components/table" Invoice INV-1042
``` ## Examples [#examples] ### Without caption [#without-caption] ```tsx import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@dapplelight/signet-ui/components/table" const invoices = [ { id: "INV-1042", status: "Paid", method: "Card", amount: "$250.00" }, { id: "INV-1043", status: "Pending", method: "Bank transfer", amount: "$1,180.00" }, { id: "INV-1044", status: "Paid", method: "Card", amount: "$89.50" }, { id: "INV-1045", status: "Overdue", method: "Bank transfer", amount: "$640.00" }, ] export function Demo() { return ( Invoice Status Method Amount {invoices.map((inv) => ( {inv.id} {inv.status} {inv.method} {inv.amount} ))}
) } ```
### Highlighted row [#highlighted-row] ```tsx import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@dapplelight/signet-ui/components/table" export function Demo() { return ( Member Role Priya Shah Owner Marcus Lee Admin (selected) Ana Torres Viewer
) } ```
## API Reference [#api-reference] `Table` wraps a `` in a `div`. `TableHeader` is ``, `TableBody` is ``, `TableRow` is ``, `TableHead` is `
`, `TableCell` is `` and `TableCaption` is `
` (shown below the table). | Prop | Type | Default | Description | | --- | --- | --- | --- | | `className` | `string` | `-` | On every part. Merged over the defaults. | Every part also takes the native props of its element. For sorting, filtering and pagination see Data Table. # Tabs (/docs/components/tabs) ```tsx import { Tabs, TabsContent, TabsList, TabsTrigger } from "@dapplelight/signet-ui/components/tabs" export function Demo() { return ( Overview Orders Billing Revenue is up 12% this month. 1,284 orders, 38 awaiting shipment. Next invoice on the 1st. ) } ``` ## Installation [#installation] ```bash npm i @dapplelight/signet-ui ``` ```bash pnpm add @dapplelight/signet-ui ``` ```bash bun add @dapplelight/signet-ui ``` ```bash bun path/to/signet/packages/cli/src/index.ts add tabs ``` ## Usage [#usage] ```tsx import { Tabs, TabsContent, TabsList, TabsTrigger } from "@dapplelight/signet-ui/components/tabs" Overview Orders ... ... ``` ## Examples [#examples] ### Line [#line] ```tsx import { Tabs, TabsContent, TabsList, TabsTrigger } from "@dapplelight/signet-ui/components/tabs" export function Demo() { return ( Overview Orders Billing Revenue is up 12% this month. 1,284 orders, 38 awaiting shipment. Next invoice on the 1st. ) } ``` ### Vertical [#vertical] ```tsx import { Tabs, TabsContent, TabsList, TabsTrigger } from "@dapplelight/signet-ui/components/tabs" export function Demo() { return ( Overview Orders Billing Revenue is up 12% this month. 1,284 orders, 38 awaiting shipment. Next invoice on the 1st. ) } ``` ### Disabled [#disabled] ```tsx import { Tabs, TabsContent, TabsList, TabsTrigger } from "@dapplelight/signet-ui/components/tabs" export function Demo() { return ( Overview Orders Billing Revenue is up 12% this month. 1,284 orders, 38 awaiting shipment. Next invoice on the 1st. ) } ``` ### Controlled [#controlled] ```tsx import { useState } from "react" import { Tabs, TabsContent, TabsList, TabsTrigger } from "@dapplelight/signet-ui/components/tabs" import { Button } from "@dapplelight/signet-ui/components/button" export function Demo() { const [tab, setTab] = useState("overview") return (
Overview Orders Revenue is up 12% this month. 1,284 orders, 38 awaiting shipment.
) } ```
## API Reference [#api-reference] `Tabs` | Prop | Type | Default | Description | | --- | --- | --- | --- | | `defaultValue` | `string` | `-` | Initially selected tab. | | `value` | `string` | `-` | Controlled selected tab. | | `onValueChange` | `(value: string) => void` | `-` | Called when the selection changes. | | `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | Direction of the list. | `TabsList` | Prop | Type | Default | Description | | --- | --- | --- | --- | | `variant` | `"default" \| "line"` | `"default"` | Filled pill or underline. | `TabsTrigger` | Prop | Type | Default | Description | | --- | --- | --- | --- | | `value` | `string` | `-` | Matches a `TabsContent`. | | `disabled` | `boolean` | `false` | Blocks selection. | `TabsContent` | Prop | Type | Default | Description | | --- | --- | --- | --- | | `value` | `string` | `-` | The tab this panel belongs to. | The parts come from the Base UI tabs primitive, so its other props apply. `tabsListVariants` is exported for custom lists. # Textarea (/docs/components/textarea) ```tsx import { Textarea } from "@dapplelight/signet-ui/components/textarea" export function Demo() { return (