# Input OTP

Use input-otp for one-time codes. Built on bits-ui's PinInput primitive. Compose `Root` with
`Group` and `Slot`, and an optional `Separator` between groups, inside the `cells` snippet.

```svelte
<script lang="ts">
	import * as InputOTP from '~/components/input-otp';
</script>

<InputOTP.Root maxlength={6}>
	{#snippet children({ cells })}
		<InputOTP.Group>
			{#each cells.slice(0, 3) as cell (cell)}
				<InputOTP.Slot {cell} />
			{/each}
		</InputOTP.Group>
		<InputOTP.Separator />
		<InputOTP.Group>
			{#each cells.slice(3, 6) as cell (cell)}
				<InputOTP.Slot {cell} />
			{/each}
		</InputOTP.Group>
	{/snippet}
</InputOTP.Root>
```