Components / Kit helpers

Signer page kit

Kit helpers

The functions and hooks the kit exports: theming, contrast, layout and scrolling.

  • 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.

Contrast and readable accents

contrastOnWhite = 2.14 · readableAccent = #4f71a2 (4.98)

useCompactLayout

useCompactLayout(): false (1024 px or wider: a centred dialog)

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.

Functions and hooks

NameTypeDefaultDescription
accentProps(accent?: string | null) => propsTheme a signing surface. Light custom colours are darkened to 4.5:1.
readableAccent(hex: string) => stringThe colour, or the same hue darkened until white text on it reaches 4.5:1.
contrastOnWhite(hex: string) => numberWCAG contrast of white text on the colour.
signatureLineFor(padHeight: number) => { height, below }SignatureLine props that match a SignaturePad, so a drawing shows 1:1.
initials(name: string) => stringUp to two initials, for Avatar.
scrollToField(id: string) => voidScroll a field into view and focus its control.
useCompactLayout(query?: string) => booleanTrue below 1024 px (or for the media query given).
useTargetDirection(id: string | null) => "up" | "down" | nullWhere an element is relative to the screen; null while it is visible.