PinInput

PIN/OTP code input built on bits-ui. Renders individual cells for each character.

Example

Props

PropTypeDefaultDescription
valuestring''Entered value (bindable)
onValueChange(value: string) => voidCallback when value changes
lengthnumber4Number of input cells
placeholderstring'○'Placeholder for empty cells
disabledbooleanfalseDisable interaction
classstringAdditional CSS classes

Usage

<script>
  import { PinInput } from '@chrissnell/chonky-ui';
  let code = $state('');
</script>

<PinInput bind:value={code} length={6} />
<PinInput placeholder="*" />