Signature
Signature Font Picker
The person's name in each of the four signature faces, to choose from.
- @signnative/ui
- MIT
- 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.
With a name input
Style
value: "delafield"
tsx
import { useState } from "react";
import { DEFAULT_SIGNATURE_FONT, SignatureFontPicker, type SignatureFontId } from "@signnative/ui";
import "@signnative/ui/styles.css";
import "@signnative/ui/fonts.css";
export function Example() {
const [name, setName] = useState("Ada Example");
const [font, setFont] = useState<SignatureFontId>(DEFAULT_SIGNATURE_FONT);
return (
<div>
<label htmlFor="name">Full name</label>
<input id="name" value={name} onChange={(e) => setName(e.target.value)} />
<p id="style-label">Style</p>
<SignatureFontPicker text={name} value={font} onChange={setFont} labelledBy="style-label" />
</div>
);
}
No name yet
An empty name shows “Your name” in each face.
tsx
import { useState } from "react";
import { SignatureFontPicker, type SignatureFontId } from "@signnative/ui";
import "@signnative/ui/styles.css";
export function Example() {
const [font, setFont] = useState<SignatureFontId>("allura");
return <SignatureFontPicker text="" value={font} onChange={setFont} />;
}
A long name at phone width
tsx
import { useState } from "react";
import { SignatureFontPicker, type SignatureFontId } from "@signnative/ui";
import "@signnative/ui/styles.css";
export function Example() {
const [font, setFont] = useState<SignatureFontId>("aurore");
return <SignatureFontPicker text="Maximiliana Montgomery-Ekström" value={font} onChange={setFont} />;
}
Installation
npx shadcn@latest add …
Not published yet
Not in the registry (packages/ui/registry.json) yet.
API
className and children are left out: every component that takes them passes them on.
SignatureFontPicker
| Name | Type | Default | Description |
|---|---|---|---|
| text | string | The name to show in each face. Empty shows "Your name". | |
| value | SignatureFontId | The chosen face. | |
| onChange | (id: SignatureFontId) => void | Called with the face the person chose. | |
| labelledBy | string | Id of a visible label; without it the group is named "Signature font". |
Accessibility
- A radio group: Tab reaches the chosen face, arrow keys move between faces and choose.
- Give it a visible label and pass its id as labelledBy.