Components / Placed Field

Signer page kit

Placed Field

A field the sender places on a page: drag to move, drag the corner to resize, or use the keyboard.

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

Move, resize, remove

Drag it, drag the corner, or Tab to it and use the keys.

Drag to move. Arrow keys move it by half a percent of the page, Shift and arrow keys resize it, Delete removes it. Signature

x 0.100 · y 0.400 · w 0.400 · h 0.200

Several fields

Drag to move. Arrow keys move it by half a percent of the page, Shift and arrow keys resize it, Delete removes it.Signature
Drag to move. Arrow keys move it by half a percent of the page, Shift and arrow keys resize it, Delete removes it.Date
Drag to move. Arrow keys move it by half a percent of the page, Shift and arrow keys resize it, Delete removes it.Text

Tab to a field, then use the arrow keys. Shift and arrows resize, Delete removes.

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.

PlacedField

NameTypeDefaultDescription
boxBoxPosition and size on the page, each 0 to 1.
onChange(b: Box) => voidCalled while it is dragged, resized or moved with keys.
onRemove() => voidThe × button and Delete.
labelstringWhat the field is, for screen readers.
selectedbooleanfalseShow the handles without focus, e.g. right after placing.
onSelect() => voidCalled when the field gets focus.
minWidthnumber0.06Smallest width, as a share of the page.
minHeightnumber0.02Smallest height, as a share of the page.
idstringSet as data-field-id, to focus a field just placed.

Accessibility

  • Arrow keys move the field, Shift with an arrow resizes it, Delete removes it.
  • The label names the field for screen readers, with the keys in its description.