Components / Headless Signer Flow

Embedded signing

Headless Signer Flow

The layer below: your app renders every step, and the evidence says so. Checks the document's hash before it allows signing.

  • @signnative/ui
  • MIT
  • Client only · mock server here
  • Prototype · ADR 0033 proposed

A prototype for ADR 0033 (proposed), shown against a mock server in your browser. Nothing is sent and nothing is signed.

It never acts by itself: opening, sending a code, signing and declining each follow a press. Sign stays disabled until the person ticked consent for exactly what is on screen. For evidence as strong as the hosted page, use the Signer Flow with secure elements.

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.

Email code

The mock accepts 123456. No email is sent.

Loading the document…

Mock server: waiting for the person.

Error: the document does not match

The mock serves other bytes than the hash in the view. The flow refuses to let the person sign.

Loading the document…

Mock server: waiting for the person.

Phone width

Loading the document…

Mock server: waiting for the person.

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.

HeadlessSignerFlow

NameTypeDefaultDescription
adapterHeadlessSignerAdapterYour connection to a signing server. For another link, also change the key.
renderDocument(doc) => ReactNodeShows the document. Called only with bytes whose SHA-256 matched the view.
onSigned() => voidCalled after the server accepted the signature.
onDeclined() => voidCalled after the person declined.
labelsPartial<HeadlessSignerFlowLabels>EnglishEvery text, for translation.
headingLevel2 | 32Level of the envelope title.

createMockHeadlessAdapter

NameTypeDefaultDescription
verification"sender_link" | "email_otp""sender_link"How the signer opens the document.
codestring"123456"email_otp: the code the mock accepts.
tamperDocumentbooleanfalseServe other bytes than the view's hash, as a broken server would.
titlestring"Synthetic NDA (test)"Envelope title.
senderstring"Example Workspace"Who sent it.
signerNamestring"Ada Example"The signer's name.
signerEmailstring"ada@example.com"The signer's address, shown masked.
fieldsSignerField[]Fields. Default: a required text field and a signature.

Accessibility

  • Errors are announced (role=alert) and the flow sets aria-busy while it works.
  • Signature entry is Signature Capture, so the person can type instead of draw.