PinInput
Segmented one-time-code / PIN entry — a row of single-character cells with auto-advance, backspace-to-previous, paste-to-fill, and optional masking. Purpose-built for the 2FA/OTP flow.
Playground
01 Examples
Six-digit OTP with a completion callback
Masked — passcode entry
Alphanumeric with a grouped separator
Sizes
Error state
02 Two-factor / OTP
PinInput is purpose-built for the one-time-code step of a two-factor flow. The
first cell already carries autocomplete="one-time-code", so iOS surfaces the code
straight from an incoming SMS as a keyboard suggestion — no extra wiring on your side. Pair it
with the auth package's TwoFactorManager, feeding the bound value into your
verify call from onComplete.
Give it a visible label and a helper line so the source of the code (authenticator
app vs. SMS) is never ambiguous.
Authenticator verification field
03 Customization
Every visual surface is a named slot: root (what class also
targets), label, group (the cell row), cell, separator, and message. Pass slotClasses to merge
classes onto any of them, or unstyled to drop all default tv() styles and rebuild from scratch. For a look you reuse across the app, register a preset once on <BlocksProvider> and reference it by name instead of repeating overrides.
Terminal-style cells via slotClasses
04 Accessibility
- The cell row is a
role="group", named byaria-labelledbywhen a visiblelabelis set, or byaria-labelotherwise. - Each cell announces its position —
aria-label="Character N of M"— so a screen-reader user always knows where the caret sits. - An
errormessage is exposed viarole="alert"and wired to every cell througharia-describedby, alongsidearia-invalid. - Full keyboard support: typing a valid character auto-advances to the next cell,
Backspaceclears and steps back, the arrow keys plusHome/Endmove between cells, and a paste is distributed across the cells from the caret.
05 API Reference
No matching properties |