Signer page kit
Theme Picker
One accent colour drives every brand shade on a signing surface. Presets, or any colour, made readable.
- 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.
Presets and your own colour
The accent drives buttons, tints, focus rings and field outlines on everything inside.
tsx
import { useState } from "react";
import { ThemePicker, accentProps, type SigningAccent } from "@/components/signing";
export function Example() {
const [accent, setAccent] = useState<SigningAccent>("forest");
return (
<div {...accentProps(accent)}>
<ThemePicker value={accent} onChange={setAccent} />
<button className="btn-primary">Sign document</button>
</div>
);
}
Compact, for a toolbar
Accent
tsx
import { useState } from "react";
import { ThemePicker, type SigningAccent } from "@/components/signing";
export function Example() {
const [accent, setAccent] = useState<SigningAccent>("plum");
return <ThemePicker compact value={accent} onChange={setAccent} />;
}
A colour too light for white text
accentProps darkens it until white text on it reaches 4.5:1, so an accent from an API never makes Sign unreadable.
#ffd400 → #856e00
#0f766e → #0f766e
tsx
import { accentProps, readableAccent } from "@/components/signing";
export function Example() {
return (
<div {...accentProps("#ffd400")}>
<button className="btn-primary">Sign document</button>
<p>Used: {readableAccent("#ffd400")}</p>
</div>
);
}
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.
ThemePicker
| Name | Type | Default | Description |
|---|---|---|---|
| value | SigningAccent | A preset id or a #rrggbb colour. | |
| onChange | (a: SigningAccent) => void | Called with the new accent. | |
| compact | boolean | false | Smaller swatches for toolbars. |
accentProps
| Name | Type | Default | Description |
|---|---|---|---|
| accent | string | null | SignNative blue | Spread the result on the element that wraps a signing surface. |
Accessibility
- The presets are a radio group: arrow keys move between them.
- A custom colour too light for white text is darkened until it reaches a 4.5:1 contrast, and the picker says so.