Fine-tune light, shadows, borders, neumorphic
Light and shadows
Borders
Neumorphic
Forms Form-associated

PinInput <pm-pin-input>

PIN / one-time code input: one box per character, paste-aware, autofills SMS codes (autocomplete="one-time-code").

Full screen

Props

<script type="module"> import '@prismora/css'; import '@prismora/elements/pin-input'; </script> <pm-pin-input label="Verification code" length="6" separator="3" hint="We sent it to your phone."></pm-pin-input>

Sizes

Set with the size attribute; controls keep touch-sized targets on phones.

size="xs"
size="sm"
size="md"
size="lg"
size="xl"

States

Each state is one attribute.

Disabled
Read-only
Required
Error

Attributes

AttributeTypeDefaultDescription
lengthnumber6Number of characters.
type'numeric' | 'alphanumeric'numericnumeric (default) or alphanumeric.
maskbooleanfalseHide characters like a password.
separatornumber—Visual separator after this many boxes (e.g. 3 → "123-456").
namestring—Form field name: the value is submitted under it.
valuestring—Current value (submitted with the form).
labelstring—Visible label (required for accessibility; use hide-label to visually hide it).
hintstring—Help text under the field, linked to it for screen readers.
errorstring—Custom error message. Setting it marks the control invalid.
size'xs' | 'sm' | 'md' | 'lg' | 'xl'—Control size.
requiredbooleanfalseThe form cannot be submitted until this has a value.
disabledbooleanfalseNot interactive and not submitted.
readonlybooleanfalseFocusable and submitted, but not editable.
hide-label
prop: hideLabel
booleanfalseHide the label visually; it stays the accessible name.

Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.

Events

EventReact / Svelte propDescription
pm-completeonPmCompleteEvery box is filled.
pm-inputonPmInputOn every value change while editing.
pm-changeonPmChangeWhen the value is committed.

Methods

checkValidity(), reportValidity(), validate(), focus()

Used in templates

Two-step verification