WRNexus UI
Advanced Forms component

Pin Input

Secure multi-cell PIN and verification-code input with regex and paste support.

26 props0 slots6 eventsTheme readyResponsive
Interactive playground

Configure Pin Input

Change any prop and inspect the server-rendered component immediately.

Live preview
Default four-digit PIN
Component code
<PinInput
  label="Default four-digit PIN"
  name="pin-input-1"
/>
Component props26 controls
Live examples

Designed for real product surfaces

Compare configurations and resize the browser to check responsive behavior.

Entry behavior

Default four-digit PIN

Live default four-digit pin example with keyboard navigation, filtering, and copyable component code.

01
Live preview
Default four-digit PIN
Component usage.wrn
<PinInput
  label="Default four-digit PIN"
  name="pin-input-1"
/>
Entry behavior

Different lengths

Live different lengths example with keyboard navigation, filtering, and copyable component code.

02
Live preview
3-digit code
5-digit code
7-digit code
Component usage.wrn
<PinInput
  label="3-digit code"
  name="pinLength3"
  length="3"
/>

<PinInput
  label="5-digit code"
  name="pinLength5"
  length="5"
/>

<PinInput
  label="7-digit code"
  name="pinLength7"
  length="7"
/>
Entry behavior

Pre-filled verification code

Live pre-filled verification code example with keyboard navigation, filtering, and copyable component code.

03
Live preview
Pre-filled verification code
Component usage.wrn
<PinInput
  label="Pre-filled verification code"
  name="pin-input-3"
  value="482915"
  length="6"
/>
Entry behavior

Masked security PIN

Live masked security pin example with keyboard navigation, filtering, and copyable component code.

04
Live preview
Masked security PIN
Component usage.wrn
<PinInput
  label="Masked security PIN"
  name="pin-input-4"
  masked="true"
/>
Entry behavior

Alphanumeric regex

Live alphanumeric regex example with keyboard navigation, filtering, and copyable component code.

05
Live preview
Alphanumeric regex
Component usage.wrn
<PinInput
  label="Alphanumeric regex"
  name="pin-input-5"
  length="6"
  pattern="[A-Z0-9]"
  inputMode="text"
/>
Entry behavior

Grouped code with separator

Live grouped code with separator example with keyboard navigation, filtering, and copyable component code.

06
Live preview
Grouped code with separator
Component usage.wrn
<PinInput
  label="Grouped code with separator"
  name="pin-input-6"
  length="6"
  separator="–"
  groupSize="3"
/>
Entry behavior

Paste from clipboard

Live paste from clipboard example with keyboard navigation, filtering, and copyable component code.

07
Live preview
Paste from clipboard
Component usage.wrn
<PinInput
  label="Paste from clipboard"
  name="pin-input-7"
  length="6"
/>
States & design

Disabled PIN input

Live disabled pin input example with keyboard navigation, filtering, and copyable component code.

08
Live preview
Disabled PIN input
Component usage.wrn
<PinInput
  label="Disabled PIN input"
  name="pin-input-8"
  length="6"
  disabled="true"
/>
States & design

Read-only code

Live read-only code example with keyboard navigation, filtering, and copyable component code.

09
Live preview
Read-only code
Component usage.wrn
<PinInput
  label="Read-only code"
  name="pin-input-9"
  value="739204"
  length="6"
  readonly="true"
/>
States & design

Validation state

Live validation state example with keyboard navigation, filtering, and copyable component code.

010
Live preview
Validation state
Component usage.wrn
<PinInput
  label="Validation state"
  name="pin-input-10"
  length="6"
  required="true"
/>
States & design

Supporting help text

Live supporting help text example with keyboard navigation, filtering, and copyable component code.

011
Live preview
Supporting help text
Enter the code sent to your registered email address.
Component usage.wrn
<PinInput
  label="Supporting help text"
  name="pin-input-11"
  length="6"
  helpText="Enter the code sent to your registered email address."
/>
States & design

Large PIN cells

Live large pin cells example with keyboard navigation, filtering, and copyable component code.

012
Live preview
Large PIN cells
Component usage.wrn
<PinInput
  size="lg"
  label="Large PIN cells"
  name="pin-input-12"
  length="6"
/>
States & design

Custom placeholder

Live custom placeholder example with keyboard navigation, filtering, and copyable component code.

013
Live preview
Custom placeholder
Component usage.wrn
<PinInput
  label="Custom placeholder"
  name="pin-input-13"
  length="6"
  placeholder="•"
/>
Automation

Automatic form submission

Live automatic form submission example with keyboard navigation, filtering, and copyable component code.

014
Live preview
Automatic form submission
Component usage.wrn
<PinInput
  label="Automatic form submission"
  name="pin-input-14"
  length="6"
  autoSubmit="true"
/>
Automation

Completion events

Live completion events example with keyboard navigation, filtering, and copyable component code.

015
Live preview
Completion events
Component usage.wrn
<PinInput
  label="Completion events"
  name="pin-input-15"
  length="6"
/>
Automation

JavaScript methods

Live javascript methods example with keyboard navigation, filtering, and copyable component code.

016
Live preview
JavaScript methods
Component usage.wrn
<PinInput
  label="JavaScript methods"
  name="pin-input-16"
  length="6"
/>
Component events

Respond to every interaction

Events are declared with @event, bubble from the component root, and expose their state through event.detail.

@inputFires after any PIN cell input is processed.
@changeFires when the combined PIN value changes.
@completeFires when every PIN cell contains an accepted character.
@pasteFires after clipboard content is filtered and distributed.
@clearFires after the complete PIN value is cleared.
@errorFires when component configuration, such as regex, is invalid.
Event listeners.js
const component = document.querySelector("[data-wrn-pin-input]")

component.addEventListener("complete", (event) => {
  console.log(event.detail.value)
  console.log(event.detail.complete)
})

component.addEventListener("paste", (event) => {
  console.log(event.detail)
})
Component API

Props and configuration

All content and behavior shown above is supplied through these props and slots.

PropTypeDefaultRequired
sizestring"default"No
colorstring"primary"No
labelstring"Verification code"No
namestring"pin"No
valuestring""No
lengthnumber4No
patternstring"[0-9]"No
typestring"text"No
inputModestring"numeric"No
placeholderstring"○"No
autocompletestring"one-time-code"No
maskedbooleanfalseNo
disabledbooleanfalseNo
readonlybooleanfalseNo
requiredbooleanfalseNo
autoFocusbooleanfalseNo
autoSubmitbooleanfalseNo
allowPastebooleantrueNo
clearablebooleantrueNo
clearLabelstring"Clear code"No
separatorstring""No
groupSizenumber0No
helpTextstring""No
invalidbooleanfalseNo
validationMessagestring""No
classstring""No