Theme

Start Here

Start from the smallest working snippet, then move to interactive examples and the full API contract below.

Styled quick start

Copy this entrypoint first. It includes the imports required to get the component on screen.

svelte
<script lang="ts">
  import '@dryui/ui/themes/default.css';
  import '@dryui/ui/themes/dark.css';
  import { PinInput } from '@dryui/ui';
</script>

<PinInput.Root bind:value={pin} length={6} oncomplete={handleVerify}>
  {#snippet children({ cells })}
    <PinInput.Group>
      {#each cells.slice(0, 3) as cell}
        <PinInput.Cell {cell} />
      {/each}
    </PinInput.Group>
    <PinInput.Separator />
    <PinInput.Group>
      {#each cells.slice(3) as cell}
        <PinInput.Cell {cell} />
      {/each}
    </PinInput.Group>
  {/snippet}
</PinInput.Root>

Import options

Root package

ts
import { PinInput } from '@dryui/ui'

Per-component subpath

ts
import { PinInput } from '@dryui/ui/pin-input'

Customize

Use the interactive examples to see common variants, states, and composition patterns before building your own.

Simple (4-Digit)

svelte
<PinInput.Root length={4} />

Grouped with Separator

svelte
<PinInput.Root length={6}>
  {#snippet children({ cells })}
    <PinInput.Group>
      {#each cells.slice(0, 3) as cell}
        <PinInput.Cell {cell} />
      {/each}
    </PinInput.Group>
    <PinInput.Separator />
    <PinInput.Group>
      {#each cells.slice(3) as cell}
        <PinInput.Cell {cell} />
      {/each}
    </PinInput.Group>
  {/snippet}
</PinInput.Root>

Masked Input

svelte
<PinInput.Root length={4} mask />

Alphanumeric

svelte
<PinInput.Root length={6} type="alphanumeric" placeholder="-" />

Sizes

svelte
<PinInput.Root length={4} size="sm" />
<PinInput.Root length={4} size="md" />
<PinInput.Root length={4} size="lg" />

Flushed Variant

svelte
<PinInput.Root length={4} variant="flushed" />

Disabled

svelte
<PinInput.Root length={4} disabled />

Structure

Compound components always start with PinInput.Root. Use this structure block to understand required wrappers before you wire state or styling.

PinInput.Root
  PinInput.Group
    PinInput.Cell
  PinInput.Separator
PinInput.Root PinInput.GroupPinInput.CellPinInput.Separator

Compose

The full API contract lives here: props, CSS variables, and the public data attributes you can target when styling.

Compound component. Start with PinInput.Root, then add only the parts you need.

PinInput.GroupPinInput.CellPinInput.Separator

PinInput.Root

Prop Type Default Required Bindable
value
string
''
length
number
4
mask
boolean
false
type
numericalphanumeric
'numeric'
pattern
RegExp
placeholder
string
'○'
disabled
boolean
false
oncomplete
(value: string) => void
pasteTransformer
(text: string) => string
blurOnComplete
boolean
false
name
string
size
smmdlg
'md'
variant
outlineflushed
'outline'
children
Snippet<[{ cells: PinInputCellType[] }]>

Forwards <div> attributes via rest props. Common examples: id, style, role. Omitted: children.

PinInput.Group

Prop Type Default Required Bindable
children
Snippet

Forwards <div> attributes via rest props. Common examples: id, style, role.

PinInput.Cell

Prop Type Default Required Bindable
cell
PinInputCellType
children
Snippet<[{ char: string | null; isActive: boolean; hasFakeCaret: boolean }]>

Forwards <div> attributes via rest props. Common examples: id, style, role. Omitted: children.

PinInput.Separator

Prop Type Default Required Bindable
children
Snippet

Forwards <div> attributes via rest props. Common examples: id, style, role.