Files
supabase/apps/design-system/registry/default/example/input-otp-controlled.tsx
Ivan Vasilov 1cd1ebfc7f chire: Sort imports in all packages, cms, design-system and ui-library apps (#41610)
Sorted all imports in all packages, `cms`, `design-system` and
`ui-library` apps by running `pnpm format` on them.

All changes in this PR are done by the script.
2026-02-05 13:54:10 +01:00

27 lines
777 B
TypeScript

'use client'
import * as React from 'react'
import { InputOTP, InputOTPGroup, InputOTPSlot } from 'ui'
export default function InputOTPControlled() {
const [value, setValue] = React.useState('')
return (
<div className="space-y-2">
<InputOTP maxLength={6} value={value} onChange={(value) => setValue(value)}>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
<InputOTPSlot index={3} />
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTPGroup>
</InputOTP>
<div className="text-center text-sm">
{value === '' ? <>Enter your one-time password.</> : <>You entered: {value}</>}
</div>
</div>
)
}