{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "input-otp-controlled", "type": "registry:example", "author": "shadcn (https://ui.shadcn.com)", "registryDependencies": [ "input-otp" ], "files": [ { "path": "examples/input-otp-controlled.tsx", "content": "\"use client\"\n\nimport * as React from \"react\"\n\nimport {\n InputOTP,\n InputOTPGroup,\n InputOTPSlot,\n} from \"@/registry/default/ui/input-otp\"\n\nexport default function InputOTPControlled() {\n const [value, setValue] = React.useState(\"\")\n\n return (\n
\n setValue(value)}\n >\n \n \n \n \n \n \n \n \n \n
\n {value === \"\" ? (\n <>Enter your one-time password.\n ) : (\n <>You entered: {value}\n )}\n
\n
\n )\n}\n", "type": "registry:example", "target": "" } ] }