BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/shadcn-solidjs/input-otp

input-otp

shadcn-solidjs/input-otp
FreeComponent

shadcn-solidjs publishes no description for this item.

Live preview

live · rendered by the registry
Rendered by shadcn-solidjs on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://shadcn-solidjs.com/r/input-otp.json

Source

src/registry/ui/input-otp.tsxshadcn-solidjs.com/r/input-otp.json
1import type { DynamicProps, InputProps, RootProps } from "@corvu/otp-field";
2import OtpField from "@corvu/otp-field";
3
4import { cn } from "~/lib/utils.ts";
5import IconMinus from "~icons/lucide/minus";
6
7import type { Component, ComponentProps, ValidComponent } from "solid-js";
8import { mergeProps, Show, splitProps } from "solid-js";
9
10export const REGEXP_ONLY_DIGITS = "^\\d*$";
11export const REGEXP_ONLY_CHARS = "^[a-zA-Z]*$";
12export const REGEXP_ONLY_DIGITS_AND_CHARS = "^[a-zA-Z0-9]*$";
13
14type InputOTPProps<T extends ValidComponent = "div"> = RootProps<T> & {
15 class?: string;
16};
17
18const InputOTP = <T extends ValidComponent = "div">(
19 props: DynamicProps<T, InputOTPProps<T>>,
20) => {
21 const [local, others] = splitProps(props as InputOTPProps, ["class"]);
22 return (
23 <OtpField
24 class={cn(
25 "gap-2 flex items-center has-disabled:opacity-50",
26 local.class,
27 )}
28 {...others}
29 />
30 );
31};
32
33type InputOTPInputProps<T extends ValidComponent = "input"> = InputProps<T> & {
34 class?: string;
35};
36
37const InputOTPInput = <T extends ValidComponent = "input">(
38 rawProps: DynamicProps<T, InputOTPInputProps<T>>,
39) => {
40 // corvu defaults `pattern` to digits-only; shadcn accepts any character
41 // unless a pattern is given, so opt out of the primitive's default.
42 const props = mergeProps({ pattern: null }, rawProps as InputOTPInputProps);
43 const [local, others] = splitProps(props, ["class"]);
44 return (
45 <OtpField.Input
46 data-slot="input-otp"
47 class={cn("disabled:cursor-not-allowed", local.class)}
48 {...others}
49 />
50 );
51};
52
53const InputOTPGroup: Component<ComponentProps<"div">> = (props) => {
54 const [local, others] = splitProps(props, ["class"]);
55 return (
56 <div
57 data-slot="input-otp-group"
58 class={cn("has-aria-invalid:ring-destructive/20 dark:has-aria-invalid:ring-destructive/40 has-aria-invalid:border-destructive rounded-lg has-aria-invalid:ring-3 flex items-center", local.class)}
59 {...others}
60 />
61 );
62};
63
64const InputOTPSlot: Component<ComponentProps<"div"> & { index: number }> = (
65 props,
66) => {
67 const [local, others] = splitProps(props, ["class", "index"]);
68 const context = OtpField.useContext();
69 const char = () => context.value()[local.index];
70 const isActive = () => context.activeSlots().includes(local.index);
71 const showFakeCaret = () =>
72 context.value().length === local.index && context.isInserting();
73
74 return (
75 <div
76 data-slot="input-otp-slot"
77 data-active={isActive()}
78// … truncated

What it pulls in

npm packages

  • @corvu/otp-field

Facts

Registry
shadcn-solidjs
Type
registry:ui
Access
Free
Files written
0
Licence
MIT
In the index
at or before 2026-08-16
Last confirmed
today

Go to the source

Docs on shadcn-solidjs shadcn-solidjs.com ptzburn/shadcn-solidjs on GitHub Raw registry item This item as JSON

More from shadcn-solidjs

All 85 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
accordionaccordionshadcn-solidjsComponentsFree1 dep
alertalertshadcn-solidjsComponentsFree2 deps
alert-dialogalert-dialogshadcn-solidjsComponentsFree2 deps
aspect-ratioaspect-ratioshadcn-solidjsComponentsFreeno deps
attachmentattachmentshadcn-solidjsComponentsFree2 deps
avataravatarshadcn-solidjsComponentsFree1 dep
badgebadgeshadcn-solidjsComponentsFree2 deps
breadcrumbbreadcrumbshadcn-solidjsComponentsFree1 dep

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex