{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "otp-with-numbers-only", "type": "registry:component", "title": "OTP with Numbers Only", "description": "A component for inputting OTP codes with numbers only", "registryDependencies": [ "input-otp", "label" ], "files": [ { "path": "registry/default/components/input/otp-with-numbers-only.tsx", "content": "'use client'\r\n\r\nimport {\r\n InputOTP,\r\n InputOTPGroup,\r\n InputOTPSlot,\r\n} from '@/registry/default/ui/input-otp'\r\nimport { Label } from '@/registry/default/ui/label'\r\n\r\n// Change the inputLength to the desired number of slots\r\nconst inputLength = 6\r\n\r\nexport default function OtpWithNumbersOnly() {\r\n return (\r\n
\r\n \r\n\r\n {\r\n //if value is not a number, return\r\n if (isNaN(Number(e))) {\r\n return\r\n }\r\n }}\r\n >\r\n \r\n {Array.from({ length: inputLength }, (_, index) => (\r\n \r\n ))}\r\n \r\n \r\n\r\n

\r\n Built with{' '}\r\n \r\n input-otp\r\n {' '}\r\n

\r\n
\r\n )\r\n}\r\n", "type": "registry:component", "target": "components/otp-with-numbers-only.tsx" } ] }