# PinInput primitive
Source: https://texuli.com/primitives-page/pin-input/
# PinInput
A one-time code entered one character per cell.
Import
`import { PinInput } from '@texuli/primitives/pin-input';`
Pattern
Text input
Size budget
4.0 KiB gzip for @texuli/primitives/pin-input
Reference
`packages/primitives/docs/prim-pin-input.md`
## Live demo
Right to left
Loading the PinInput demo…
## Anatomy
PinInput anatomy: each box holds the parts inside it.
- `PinInput.Root``PinInput.Cell`
## Behavior checks
`tests/behavior/scenarios/pin-input.spec.ts` runs **10 rows** against the PinInput scenario on Chromium, WebKit and the Pixel 7. Each row asserts what a user or assistive technology can observe, held to the WAI-ARIA Authoring Practices pattern.
All 10 rows
- one named text field, offered for one-time-code autofill
- typing digits fills the code
- characters outside the pattern are refused
- the code stops at its length
- Backspace removes the last character
- filling the last cell reports the code once
- pasting a code fills every cell and completes it
- pasting a code with spaces ("123 456") fills it
- a click or tap on the cells focuses the field
- axe finds no violations, empty and filled
### Limits
- Every row passes on every project; a flaky row gets at most two retries.
- Size: at most 4.0 KiB gzip for `@texuli/primitives/pin-input` (`pnpm size`).
- Open-to-focus: p75 at most 150 ms (asserted with `TEXULI_PERF=1`).
PinInput
A one-time code entered one character per cell.
- Import
import { PinInput } from '@texuli/primitives/pin-input';- Pattern
- Text input
- Size budget
- 4.0 KiB gzip for @texuli/primitives/pin-input
- Reference
packages/primitives/ docs/ prim-pin-input.md
Loading the PinInput demo…
Anatomy
PinInput.RootPinInput.Cell
Behavior checks
tests/behavior/scenarios/pin-input.spec.ts runs 10 rows against the PinInput scenario on Chromium, WebKit and the Pixel 7. Each row asserts what a user or assistive technology can observe, held to the WAI-ARIA Authoring Practices pattern.
All 10 rows
- one named text field, offered for one-time-code autofill
- typing digits fills the code
- characters outside the pattern are refused
- the code stops at its length
- Backspace removes the last character
- filling the last cell reports the code once
- pasting a code fills every cell and completes it
- pasting a code with spaces ("123 456") fills it
- a click or tap on the cells focuses the field
- axe finds no violations, empty and filled
Limits
- Every row passes on every project; a flaky row gets at most two retries.
- Size: at most 4.0 KiB gzip for
@texuli/primitives/pin-input(pnpm size). - Open-to-focus: p75 at most 150 ms (asserted with
TEXULI_PERF=1).