Signer page kit
Sheet
One task at a time. Rises from the bottom on a phone, a centred dialog on wider screens.
- In the signer page, not yet in the package
- AGPL-3.0-only
- Client only · no backend
Theme
The CSS variables this sets
:root {
--signing-accent: #3157e8;
--sig-accent: #3157e8;
--sig-accent-soft: color-mix(in oklab, #3157e8 14%, white);
--sig-radius: 8px;
--radius-control: 8px;
--radius-panel: 12px;
--font-sans: var(--font-inter), ui-sans-serif, system-ui, sans-serif;
}In the signer page kit, set the accent with accentProps(accent) on the element around the surface; it sets data-signing-accent and --signing-accent. The secure elements take the same values as a checked appearance object instead.
Open it
Then try Escape or a tap outside. On a phone it rises from the bottom.
tsx
import { useState } from "react";
import { Sheet } from "@/components/signing";
export function Example() {
const [open, setOpen] = useState(false);
return (
<>
<button className="btn-secondary" onClick={() => setOpen(true)}>
Open the sheet
</button>
<Sheet
open={open}
onClose={() => setOpen(false)}
title="Review and sign"
description="Mutual NDA, Example Labs"
footer={<button className="btn-primary w-full" onClick={() => setOpen(false)}>Sign document</button>}
>
<p>The statement to agree to, and the Sign button.</p>
</Sheet>
</>
);
}
Long content
The content scrolls; the footer with the action stays in view.
tsx
import { useState } from "react";
import { Sheet } from "@/components/signing";
export function Example() {
const [open, setOpen] = useState(false);
return (
<>
<button className="btn-secondary" onClick={() => setOpen(true)}>
Open a long sheet
</button>
<Sheet open={open} onClose={() => setOpen(false)} title="Terms" footer={<button className="btn-primary w-full" onClick={() => setOpen(false)}>I have read them</button>}>
{Array.from({ length: 14 }, (_, i) => (
<p key={i}>Clause {i + 1}.</p>
))}
</Sheet>
</>
);
}
useCompactLayout
Resize the window: true below 1024 px.
useCompactLayout(): false (1024 px or wider: a centred dialog)
tsx
import { useCompactLayout } from "@/components/signing";
export function Example() {
const compact = useCompactLayout();
return <p>{compact ? "A sheet from the bottom" : "A centred dialog"}</p>;
}
Installation
npx shadcn@latest add …
Not published yet
Not in the registry (packages/ui/registry.json) yet.
Props
className and children are left out: every component that takes them passes them on.
Sheet
| Name | Type | Default | Description |
|---|---|---|---|
| open | boolean | Shown as a modal dialog while true. | |
| onClose | () => void | Escape, the × button and a tap outside. | |
| title | ReactNode | Heading; also the dialog's name. | |
| description | ReactNode | One line under the title. | |
| footer | ReactNode | Actions, kept visible while the content scrolls. |
Hooks
| Name | Type | Default | Description |
|---|---|---|---|
| useCompactLayout | (query?: string) => boolean | True below 1024 px (or for the media query given). |
Accessibility
- Built on <dialog>: focus stays inside and returns when it closes, and the page behind is inert.
- Escape, the × button and a tap outside close it. Mark an element data-autofocus to focus it on open.