input-otp-01
Loading...
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function InputOTPDemo() {
return (
<InputOTP maxLength={6} defaultValue="123456">
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
<InputOTPSlot index={3} />
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTPGroup>
</InputOTP>
)
}input-otp-02
Loading...
import {
InputOTP,
InputOTPGroup,
InputOTPSeparator,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function InputOTPWithSeparator() {
return (
<InputOTP maxLength={6}>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
</InputOTPGroup>
<InputOTPSeparator />
<InputOTPGroup>
<InputOTPSlot index={2} />
<InputOTPSlot index={3} />
</InputOTPGroup>
<InputOTPSeparator />
<InputOTPGroup>
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTPGroup>
</InputOTP>
)
}input-otp-03
Loading...
"use client"
import { REGEXP_ONLY_DIGITS } from "input-otp"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function InputOTPFourDigits() {
return (
<InputOTP maxLength={4} pattern={REGEXP_ONLY_DIGITS}>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
<InputOTPSlot index={3} />
</InputOTPGroup>
</InputOTP>
)
}input-otp-04
Loading...
"use client"
import { REGEXP_ONLY_DIGITS } from "input-otp"
import { Button } from "@/components/ui/button"
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function EmailVerificationCard() {
return (
<Card className="w-full max-w-sm">
<CardHeader>
<CardTitle>Check your inbox</CardTitle>
<CardDescription>
We sent a 6-digit code to{" "}
<span className="font-medium text-foreground">
ali@designali.com
</span>
.
</CardDescription>
</CardHeader>
<CardContent className="flex flex-col items-center gap-4">
<InputOTP maxLength={6} pattern={REGEXP_ONLY_DIGITS} autoFocus>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
<InputOTPSlot index={3} />
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTPGroup>
</InputOTP>
<Button className="w-full">Verify email</Button>
</CardContent>
<CardFooter className="justify-center text-xs text-muted-foreground">
Didn't get it?
<Button variant="link" size="sm" className="px-1">
Resend code
</Button>
</CardFooter>
</Card>
)
}
input-otp-05
Loading...
"use client"
import { REGEXP_ONLY_DIGITS } from "input-otp"
import {
ShieldCheck as ShieldCheckIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import { Checkbox } from "@/components/ui/checkbox"
import {
InputOTP,
InputOTPGroup,
InputOTPSeparator,
InputOTPSlot,
} from "@/components/ui/input-otp"
import { Label } from "@/components/ui/label"
export function TwoFactorLoginStep() {
return (
<div className="flex w-full max-w-sm flex-col gap-5 border bg-background p-6">
<div className="flex size-10 items-center justify-center bg-muted">
<ShieldCheckIcon className="size-5" />
</div>
<div className="space-y-1">
<h3 className="text-sm font-semibold">Two-factor authentication</h3>
<p className="text-xs text-muted-foreground">
Open your authenticator app and enter the code for Designali.
</p>
</div>
<InputOTP maxLength={6} pattern={REGEXP_ONLY_DIGITS}>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
</InputOTPGroup>
<InputOTPSeparator />
<InputOTPGroup>
<InputOTPSlot index={3} />
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTPGroup>
</InputOTP>
<div className="flex items-center gap-2">
<Checkbox id="trust-device" />
<Label htmlFor="trust-device">Trust this device for 30 days</Label>
</div>
<Button>Continue</Button>
</div>
)
}
input-otp-06
Loading...
"use client"
import * as React from "react"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function ControlledOtpValueReadout() {
const [value, setValue] = React.useState("")
return (
<div className="flex flex-col items-center gap-3">
<InputOTP maxLength={6} value={value} onChange={setValue}>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
<InputOTPSlot index={3} />
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTPGroup>
</InputOTP>
<p className="text-xs text-muted-foreground">
{value.length === 0
? "Enter the code we sent to hello@designali.com."
: value.length < 6
? "You entered " + value + " (" + (6 - value.length) + " left)"
: "Code complete: " + value}
</p>
</div>
)
}
input-otp-07
Loading...
"use client"
import * as React from "react"
import { REGEXP_ONLY_DIGITS } from "input-otp"
import {
CircleCheck as CircleCheckIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
import { Spinner } from "@/components/ui/spinner"
export function AutoSubmitOnComplete() {
const [status, setStatus] = React.useState<"idle" | "verifying" | "done">(
"idle"
)
function handleComplete() {
setStatus("verifying")
window.setTimeout(() => setStatus("done"), 1200)
}
return (
<div className="flex flex-col items-center gap-3">
<InputOTP
maxLength={6}
pattern={REGEXP_ONLY_DIGITS}
disabled={status !== "idle"}
onComplete={handleComplete}
>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
<InputOTPSlot index={3} />
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTPGroup>
</InputOTP>
<div className="flex h-5 items-center gap-1.5 text-xs text-muted-foreground">
{status === "idle" && "The code submits as soon as it's complete."}
{status === "verifying" && (
<>
<Spinner /> Verifying code...
</>
)}
{status === "done" && (
<>
<CircleCheckIcon className="size-4 text-primary dark:text-primary" />
Verified. Redirecting...
</>
)}
</div>
{status === "done" && (
<Button variant="ghost" size="sm" onClick={() => setStatus("idle")}>
Try again
</Button>
)}
</div>
)
}
input-otp-08
Loading...
import { Field, FieldError, FieldLabel } from "@/components/ui/field"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function InvalidCodeError() {
return (
<Field className="w-fit" data-invalid>
<FieldLabel htmlFor="otp-invalid">designali.com verification code</FieldLabel>
<InputOTP id="otp-invalid" maxLength={6} defaultValue="482913">
<InputOTPGroup>
<InputOTPSlot index={0} aria-invalid />
<InputOTPSlot index={1} aria-invalid />
<InputOTPSlot index={2} aria-invalid />
<InputOTPSlot index={3} aria-invalid />
<InputOTPSlot index={4} aria-invalid />
<InputOTPSlot index={5} aria-invalid />
</InputOTPGroup>
</InputOTP>
<FieldError>That Designali code is incorrect or has expired.</FieldError>
</Field>
)
}
input-otp-09
Loading...
import {
Lock as LockIcon,
} from "@designali/icons"
import {
Alert,
AlertDescription,
AlertTitle,
} from "@/components/ui/alert"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function LockedAfterAttempts() {
return (
<div className="flex w-full max-w-sm flex-col gap-4">
<InputOTP maxLength={6} disabled>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
<InputOTPSlot index={3} />
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTPGroup>
</InputOTP>
<Alert variant="error">
<LockIcon />
<AlertTitle>Too many attempts</AlertTitle>
<AlertDescription>
For your security, code entry is paused for 15 minutes.
</AlertDescription>
</Alert>
</div>
)
}
input-otp-10
Loading...
"use client"
import * as React from "react"
import { REGEXP_ONLY_DIGITS } from "input-otp"
import {
RotateCw as RotateCwIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function ResendCountdownTimer() {
const [seconds, setSeconds] = React.useState(30)
React.useEffect(() => {
if (seconds === 0) return
const id = window.setInterval(
() => setSeconds((s) => Math.max(0, s - 1)),
1000
)
return () => window.clearInterval(id)
}, [seconds])
return (
<div className="flex flex-col items-center gap-4">
<InputOTP maxLength={6} pattern={REGEXP_ONLY_DIGITS}>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
<InputOTPSlot index={3} />
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTPGroup>
</InputOTP>
<Button
variant="outline"
size="sm"
disabled={seconds > 0}
onClick={() => setSeconds(30)}
>
<RotateCwIcon data-icon="inline-start" />
{seconds > 0
? "Resend in 0:" + String(seconds).padStart(2, "0")
: "Resend code"}
</Button>
</div>
)
}
input-otp-11
Loading...
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function LargeOtpSlots() {
return (
<InputOTP maxLength={4}>
<InputOTPGroup>
<InputOTPSlot index={0} className="size-14 text-2xl font-semibold" />
<InputOTPSlot index={1} className="size-14 text-2xl font-semibold" />
<InputOTPSlot index={2} className="size-14 text-2xl font-semibold" />
<InputOTPSlot index={3} className="size-14 text-2xl font-semibold" />
</InputOTPGroup>
</InputOTP>
)
}
input-otp-12
Loading...
import { Button } from "@/components/ui/button"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function CompactInlineOtp() {
return (
<div className="flex w-full max-w-md flex-wrap items-center justify-between gap-3 border p-3">
<div>
<p className="text-xs font-medium">Confirm your Designali sign-in</p>
<p className="text-xs text-muted-foreground">
Code sent to ali@designali.com
</p>
</div>
<div className="flex items-center gap-2">
<InputOTP maxLength={4}>
<InputOTPGroup>
<InputOTPSlot index={0} className="size-7" />
<InputOTPSlot index={1} className="size-7" />
<InputOTPSlot index={2} className="size-7" />
<InputOTPSlot index={3} className="size-7" />
</InputOTPGroup>
</InputOTP>
<Button size="sm">Confirm</Button>
</div>
</div>
)
}
input-otp-13
Loading...
"use client"
import * as React from "react"
import { REGEXP_ONLY_DIGITS_AND_CHARS } from "input-otp"
import {
Field,
FieldDescription,
FieldLabel,
} from "@/components/ui/field"
import {
InputOTP,
InputOTPGroup,
InputOTPSeparator,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function AlphanumericRecoveryCode() {
const [value, setValue] = React.useState("")
return (
<Field className="w-fit">
<FieldLabel htmlFor="recovery-code">Designali recovery code</FieldLabel>
<InputOTP
id="recovery-code"
maxLength={8}
pattern={REGEXP_ONLY_DIGITS_AND_CHARS}
value={value}
onChange={(next) => setValue(next.toUpperCase())}
>
<InputOTPGroup>
<InputOTPSlot index={0} className="font-sans" />
<InputOTPSlot index={1} className="font-sans" />
<InputOTPSlot index={2} className="font-sans" />
<InputOTPSlot index={3} className="font-sans" />
</InputOTPGroup>
<InputOTPSeparator />
<InputOTPGroup>
<InputOTPSlot index={4} className="font-sans" />
<InputOTPSlot index={5} className="font-sans" />
<InputOTPSlot index={6} className="font-sans" />
<InputOTPSlot index={7} className="font-sans" />
</InputOTPGroup>
</InputOTP>
<FieldDescription>
Use one of the codes you saved when enabling 2FA on designali.com.
</FieldDescription>
</Field>
)
}
input-otp-14
Loading...
"use client"
import { REGEXP_ONLY_CHARS } from "input-otp"
import {
ArrowRight as ArrowRightIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function LettersOnlyRoomCode() {
return (
<div className="flex w-full max-w-xs flex-col items-center gap-4 text-center">
<div className="space-y-1">
<h3 className="text-sm font-semibold">Join a quiz</h3>
<p className="text-xs text-muted-foreground">
Enter the 5-letter room code on the host's screen.
</p>
</div>
<InputOTP maxLength={5} pattern={REGEXP_ONLY_CHARS} inputMode="text">
<InputOTPGroup>
<InputOTPSlot index={0} className="size-10 text-base uppercase" />
<InputOTPSlot index={1} className="size-10 text-base uppercase" />
<InputOTPSlot index={2} className="size-10 text-base uppercase" />
<InputOTPSlot index={3} className="size-10 text-base uppercase" />
<InputOTPSlot index={4} className="size-10 text-base uppercase" />
</InputOTPGroup>
</InputOTP>
<Button className="w-full">
Join room
<ArrowRightIcon data-icon="inline-end" />
</Button>
</div>
)
}
input-otp-15
Loading...
"use client"
import { REGEXP_ONLY_DIGITS } from "input-otp"
import {
Smartphone as SmartphoneIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function PhoneSmsVerification() {
return (
<div className="flex w-full max-w-sm flex-col gap-4">
<div className="flex items-start gap-3">
<div className="flex size-9 shrink-0 items-center justify-center bg-muted">
<SmartphoneIcon className="size-4" />
</div>
<div className="flex-1">
<p className="text-sm font-medium">Enter the code we texted you</p>
<p className="text-xs text-muted-foreground">
Sent to +1 ••• ••• 4821.{" "}
<a
href="#"
className="text-foreground underline underline-offset-4"
>
Change number
</a>
</p>
</div>
</div>
<InputOTP
maxLength={4}
pattern={REGEXP_ONLY_DIGITS}
autoComplete="one-time-code"
>
<InputOTPGroup>
<InputOTPSlot index={0} className="size-11 text-lg" />
<InputOTPSlot index={1} className="size-11 text-lg" />
<InputOTPSlot index={2} className="size-11 text-lg" />
<InputOTPSlot index={3} className="size-11 text-lg" />
</InputOTPGroup>
</InputOTP>
<Button>Verify phone</Button>
</div>
)
}
input-otp-16
Loading...
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function SpacedSlotBoxes() {
return (
<InputOTP maxLength={6}>
<InputOTPGroup className="gap-2">
<InputOTPSlot index={0} className="size-10 border text-sm" />
<InputOTPSlot index={1} className="size-10 border text-sm" />
<InputOTPSlot index={2} className="size-10 border text-sm" />
<InputOTPSlot index={3} className="size-10 border text-sm" />
<InputOTPSlot index={4} className="size-10 border text-sm" />
<InputOTPSlot index={5} className="size-10 border text-sm" />
</InputOTPGroup>
</InputOTP>
)
}
input-otp-17
Loading...
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function UnderlineSlots() {
return (
<InputOTP maxLength={6}>
<InputOTPGroup className="gap-3">
<InputOTPSlot
index={0}
className="size-9 border-0 border-b-2 bg-transparent text-lg first:border-s-0 data-[active=true]:ring-0 dark:bg-transparent"
/>
<InputOTPSlot
index={1}
className="size-9 border-0 border-b-2 bg-transparent text-lg first:border-s-0 data-[active=true]:ring-0 dark:bg-transparent"
/>
<InputOTPSlot
index={2}
className="size-9 border-0 border-b-2 bg-transparent text-lg first:border-s-0 data-[active=true]:ring-0 dark:bg-transparent"
/>
<InputOTPSlot
index={3}
className="size-9 border-0 border-b-2 bg-transparent text-lg first:border-s-0 data-[active=true]:ring-0 dark:bg-transparent"
/>
<InputOTPSlot
index={4}
className="size-9 border-0 border-b-2 bg-transparent text-lg first:border-s-0 data-[active=true]:ring-0 dark:bg-transparent"
/>
<InputOTPSlot
index={5}
className="size-9 border-0 border-b-2 bg-transparent text-lg first:border-s-0 data-[active=true]:ring-0 dark:bg-transparent"
/>
</InputOTPGroup>
</InputOTP>
)
}
input-otp-18
Loading...
"use client"
import * as React from "react"
import { OTPInputContext } from "input-otp"
import {
Field,
FieldDescription,
FieldLabel,
} from "@/components/ui/field"
import { InputOTP, InputOTPGroup } from "@/components/ui/input-otp"
function MaskedSlot({ index }: { index: number }) {
const context = React.useContext(OTPInputContext)
const slot = context.slots[index]
return (
<div
data-active={slot?.isActive}
className="relative flex size-10 items-center justify-center border-y border-e border-input first:border-s data-[active=true]:z-10 data-[active=true]:border-ring data-[active=true]:ring-1 data-[active=true]:ring-ring/50"
>
{slot?.char ? (
<span className="size-2.5 rounded-full bg-foreground" />
) : null}
{slot?.hasFakeCaret && (
<span className="h-4 w-px animate-caret-blink bg-foreground" />
)}
</div>
)
}
export function MaskedPinSlots() {
return (
<Field className="w-fit">
<FieldLabel htmlFor="card-pin">Designali studio door PIN</FieldLabel>
<InputOTP id="card-pin" maxLength={4} inputMode="numeric">
<InputOTPGroup>
{[0, 1, 2, 3].map((index) => (
<MaskedSlot key={index} index={index} />
))}
</InputOTPGroup>
</InputOTP>
<FieldDescription>Digits are hidden as you type.</FieldDescription>
</Field>
)
}
input-otp-19
Loading...
"use client"
import { REGEXP_ONLY_DIGITS } from "input-otp"
import { Button } from "@/components/ui/button"
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card"
import {
InputOTP,
InputOTPGroup,
InputOTPSeparator,
InputOTPSlot,
} from "@/components/ui/input-otp"
const rows = [
{ label: "To", value: "Designali Studio" },
{ label: "Account", value: "•••• 7730" },
{ label: "Amount", value: "$2,450.00" },
]
export function BankTransferConfirmation() {
return (
<Card className="w-full max-w-sm">
<CardHeader>
<CardTitle>Confirm transfer</CardTitle>
<CardDescription>
Enter the code sent to your banking app.
</CardDescription>
</CardHeader>
<CardContent className="flex flex-col gap-4">
<dl className="divide-y border text-xs">
{rows.map((row) => (
<div key={row.label} className="flex justify-between px-3 py-2">
<dt className="text-muted-foreground">{row.label}</dt>
<dd className="font-medium">{row.value}</dd>
</div>
))}
</dl>
<InputOTP
maxLength={6}
pattern={REGEXP_ONLY_DIGITS}
containerClassName="justify-center"
>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
</InputOTPGroup>
<InputOTPSeparator />
<InputOTPGroup>
<InputOTPSlot index={3} />
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTPGroup>
</InputOTP>
</CardContent>
<CardFooter className="gap-2">
<Button variant="outline" className="flex-1">
Cancel
</Button>
<Button className="flex-1">Send $2,450</Button>
</CardFooter>
</Card>
)
}
input-otp-20
Loading...
"use client"
import { REGEXP_ONLY_DIGITS } from "input-otp"
import {
CreditCard as CreditCardIcon,
} from "@designali/icons"
import { Badge } from "@/components/ui/badge"
import { Button } from "@/components/ui/button"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function CardPaymentChallenge() {
return (
<div className="w-full max-w-sm border bg-background">
<div className="flex items-center justify-between border-b bg-muted/50 px-4 py-3">
<div className="flex items-center gap-2 text-xs font-medium">
<CreditCardIcon className="size-4" />
Designali Checkout
</div>
<Badge variant="outline">Secure check</Badge>
</div>
<div className="flex flex-col gap-4 p-4">
<p className="text-xs text-muted-foreground">
You're paying{" "}
<span className="font-medium text-foreground">$84.20</span> to
Designali for Templates Pro with the card ending in 1094.
</p>
<InputOTP maxLength={6} pattern={REGEXP_ONLY_DIGITS}>
<InputOTPGroup>
<InputOTPSlot index={0} className="size-9" />
<InputOTPSlot index={1} className="size-9" />
<InputOTPSlot index={2} className="size-9" />
<InputOTPSlot index={3} className="size-9" />
<InputOTPSlot index={4} className="size-9" />
<InputOTPSlot index={5} className="size-9" />
</InputOTPGroup>
</InputOTP>
<Button className="w-full">Authorize payment</Button>
<Button variant="ghost" size="sm" className="self-center">
Cancel and return to store
</Button>
</div>
</div>
)
}
input-otp-21
Loading...
"use client"
import { REGEXP_ONLY_DIGITS_AND_CHARS } from "input-otp"
import {
Tv as TvIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import {
InputOTP,
InputOTPGroup,
InputOTPSeparator,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function TvPairingCode() {
return (
<div className="flex w-full max-w-sm flex-col items-center gap-4 text-center">
<div className="flex h-20 w-32 items-center justify-center border-4 border-foreground/80 bg-gradient-to-br from-muted to-background">
<TvIcon className="size-6 text-muted-foreground" />
</div>
<div className="space-y-1">
<h3 className="text-sm font-semibold">Connect your TV</h3>
<p className="text-xs text-muted-foreground">
Enter the code shown on your TV to sign in to Designali.
</p>
</div>
<InputOTP maxLength={8} pattern={REGEXP_ONLY_DIGITS_AND_CHARS}>
<InputOTPGroup>
<InputOTPSlot index={0} className="uppercase" />
<InputOTPSlot index={1} className="uppercase" />
<InputOTPSlot index={2} className="uppercase" />
<InputOTPSlot index={3} className="uppercase" />
</InputOTPGroup>
<InputOTPSeparator />
<InputOTPGroup>
<InputOTPSlot index={4} className="uppercase" />
<InputOTPSlot index={5} className="uppercase" />
<InputOTPSlot index={6} className="uppercase" />
<InputOTPSlot index={7} className="uppercase" />
</InputOTPGroup>
</InputOTP>
<Button className="w-full">Pair device</Button>
</div>
)
}
input-otp-22
Loading...
"use client"
import * as React from "react"
import {
Delete as DeleteIcon,
LockKeyhole as LockKeyholeIcon,
X as XIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
const keys = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
export function DoorLockKeypad() {
const [value, setValue] = React.useState("")
const press = (digit: string) =>
setValue((v) => (v.length < 4 ? v + digit : v))
return (
<div className="flex w-full max-w-[16rem] flex-col items-center gap-4 border p-4">
<div className="flex items-center gap-2 text-xs font-medium">
<LockKeyholeIcon className="size-4" />
Front door
</div>
<InputOTP maxLength={4} value={value} onChange={setValue}>
<InputOTPGroup>
<InputOTPSlot index={0} className="size-10 text-base" />
<InputOTPSlot index={1} className="size-10 text-base" />
<InputOTPSlot index={2} className="size-10 text-base" />
<InputOTPSlot index={3} className="size-10 text-base" />
</InputOTPGroup>
</InputOTP>
<div className="grid w-full grid-cols-3 gap-2">
{keys.map((key) => (
<Button key={key} variant="outline" onClick={() => press(key)}>
{key}
</Button>
))}
<Button variant="ghost" aria-label="Clear" onClick={() => setValue("")}>
<XIcon />
</Button>
<Button variant="outline" onClick={() => press("0")}>
0
</Button>
<Button
variant="ghost"
aria-label="Delete"
onClick={() => setValue((v) => v.slice(0, -1))}
>
<DeleteIcon />
</Button>
</div>
<Button className="w-full" disabled={value.length < 4}>
Unlock
</Button>
</div>
)
}
input-otp-23
Loading...
"use client"
import * as React from "react"
import {
Trash2 as Trash2Icon,
TriangleAlert as TriangleAlertIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function DeleteAccountConfirmation() {
const [value, setValue] = React.useState("")
return (
<div className="flex w-full max-w-sm flex-col gap-4 border border-destructive/40 p-5">
<div className="flex items-center gap-2 text-sm font-semibold text-destructive">
<TriangleAlertIcon className="size-4" />
Delete workspace
</div>
<p className="text-xs text-muted-foreground">
This permanently removes 14 projects and 2.3 GB of files. Enter the code
we emailed to the owner to continue.
</p>
<InputOTP maxLength={6} value={value} onChange={setValue}>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
<InputOTPSlot index={3} />
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTPGroup>
</InputOTP>
<Button variant="destructive" disabled={value.length < 6}>
<Trash2Icon data-icon="inline-start" />
Delete forever
</Button>
</div>
)
}
input-otp-24
Loading...
"use client"
import { REGEXP_ONLY_DIGITS } from "input-otp"
import {
Shield as ShieldIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import {
Dialog,
DialogClose,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog"
import {
InputOTP,
InputOTPGroup,
InputOTPSeparator,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function EnableTwoFactorDialog() {
return (
<Dialog>
<DialogTrigger render={<Button variant="outline" />}>
<ShieldIcon data-icon="inline-start" />
Enable 2FA
</DialogTrigger>
<DialogContent className="sm:max-w-sm">
<DialogHeader>
<DialogTitle>Confirm your authenticator</DialogTitle>
<DialogDescription>
Enter the 6-digit code from your app to finish setup.
</DialogDescription>
</DialogHeader>
<InputOTP
maxLength={6}
pattern={REGEXP_ONLY_DIGITS}
containerClassName="justify-center py-2"
>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
</InputOTPGroup>
<InputOTPSeparator />
<InputOTPGroup>
<InputOTPSlot index={3} />
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTPGroup>
</InputOTP>
<DialogFooter>
<DialogClose render={<Button variant="outline" />}>
Cancel
</DialogClose>
<Button>Enable</Button>
</DialogFooter>
</DialogContent>
</Dialog>
)
}
input-otp-25
Loading...
"use client"
import { REGEXP_ONLY_DIGITS } from "input-otp"
import { Button } from "@/components/ui/button"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function AuthenticatorSetup() {
return (
<div className="flex w-full max-w-md flex-col gap-5 border p-5 sm:flex-row">
<svg
viewBox="0 0 21 21"
className="size-28 shrink-0 self-center bg-white p-2 text-black"
aria-label="QR code"
>
<path
fill="currentColor"
d="M0 0h7v7H0zM1 1v5h5V1zM2 2h3v3H2zM14 0h7v7h-7zM15 1v5h5V1zM16 2h3v3h-3zM0 14h7v7H0zM1 15v5h5v-5zM2 16h3v3H2zM9 0h2v2H9zM9 3h1v3H9zM11 4h2v2h-2zM8 8h3v2H8zM12 8h2v1h-2zM15 9h3v2h-3zM9 11h2v3H9zM12 12h3v2h-3zM16 13h2v3h-2zM9 16h3v2H9zM13 16h2v5h-2zM18 18h3v3h-3zM0 9h2v2H0zM3 10h3v2H3z"
/>
</svg>
<div className="flex flex-1 flex-col gap-3">
<div className="space-y-1">
<p className="text-sm font-medium">Secure your designali.com account</p>
<p className="text-xs text-muted-foreground">
Scan with your authenticator or enter key{" "}
<code className="bg-muted px-1 font-mono">JBSW Y3DP EHPK 3PXP</code>
</p>
</div>
<InputOTP maxLength={6} pattern={REGEXP_ONLY_DIGITS}>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
<InputOTPSlot index={3} />
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTPGroup>
</InputOTP>
<Button size="sm" className="self-start">
Verify and activate
</Button>
</div>
</div>
)
}
input-otp-26
Loading...
"use client"
import * as React from "react"
import { REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS } from "input-otp"
import { Button } from "@/components/ui/button"
import {
InputOTP,
InputOTPGroup,
InputOTPSeparator,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function BackupCodeToggle() {
const [mode, setMode] = React.useState<"app" | "backup">("app")
const length = mode === "app" ? 6 : 10
return (
<div className="flex w-full max-w-sm flex-col gap-4">
<div className="space-y-1">
<p className="text-sm font-medium">
{mode === "app" ? "Authenticator code" : "Backup code"}
</p>
<p className="text-xs text-muted-foreground">
{mode === "app"
? "Enter the 6-digit Designali code from your app."
: "Enter one of your 10-character designali.com backup codes."}
</p>
</div>
<InputOTP
key={mode}
maxLength={length}
pattern={
mode === "app" ? REGEXP_ONLY_DIGITS : REGEXP_ONLY_DIGITS_AND_CHARS
}
>
{mode === "app" ? (
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
<InputOTPSlot index={3} />
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTPGroup>
) : (
<>
<InputOTPGroup>
<InputOTPSlot index={0} className="w-7 font-sans uppercase" />
<InputOTPSlot index={1} className="w-7 font-sans uppercase" />
<InputOTPSlot index={2} className="w-7 font-sans uppercase" />
<InputOTPSlot index={3} className="w-7 font-sans uppercase" />
<InputOTPSlot index={4} className="w-7 font-sans uppercase" />
</InputOTPGroup>
<InputOTPSeparator />
<InputOTPGroup>
<InputOTPSlot index={5} className="w-7 font-sans uppercase" />
<InputOTPSlot index={6} className="w-7 font-sans uppercase" />
<InputOTPSlot index={7} className="w-7 font-sans uppercase" />
<InputOTPSlot index={8} className="w-7 font-sans uppercase" />
<InputOTPSlot index={9} className="w-7 font-sans uppercase" />
</InputOTPGroup>
</>
)}
</InputOTP>
<Button
variant="link"
size="sm"
className="self-start px-0"
onClick={() => setMode(mode === "app" ? "backup" : "app")}
>
{mode === "app" ? "Use a backup code instead" : "Use authenticator app"}
</Button>
</div>
)
}
input-otp-27
Loading...
"use client"
import * as React from "react"
import {
ClipboardPaste as ClipboardPasteIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function PasteFromClipboard() {
const [value, setValue] = React.useState("")
async function handlePaste() {
try {
const text = await navigator.clipboard.readText()
setValue(text.replace(/\D/g, "").slice(0, 6))
} catch {
// Clipboard access denied; the user can still type or paste manually.
}
}
return (
<div className="flex flex-col items-center gap-3">
<InputOTP maxLength={6} value={value} onChange={setValue}>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
<InputOTPSlot index={3} />
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTPGroup>
</InputOTP>
<Button variant="outline" size="sm" onClick={handlePaste}>
<ClipboardPasteIcon data-icon="inline-start" />
Paste code
</Button>
</div>
)
}
input-otp-28
Loading...
"use client"
import { REGEXP_ONLY_DIGITS } from "input-otp"
import {
Field,
FieldDescription,
FieldLabel,
} from "@/components/ui/field"
import {
InputOTP,
InputOTPGroup,
InputOTPSeparator,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function StripDashesOnPaste() {
return (
<Field className="w-fit">
<FieldLabel htmlFor="otp-paste">Paste your Designali code</FieldLabel>
<InputOTP
id="otp-paste"
maxLength={6}
pattern={REGEXP_ONLY_DIGITS}
pasteTransformer={(pasted) => pasted.replace(/[^0-9]/g, "")}
>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
</InputOTPGroup>
<InputOTPSeparator />
<InputOTPGroup>
<InputOTPSlot index={3} />
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTPGroup>
</InputOTP>
<FieldDescription>
Paste the code from your hello@designali.com email, e.g. 482-913.
</FieldDescription>
</Field>
)
}
input-otp-29
Loading...
import {
BadgeCheck as BadgeCheckIcon,
} from "@designali/icons"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function VerifiedSuccessState() {
return (
<div className="flex flex-col items-center gap-3">
<InputOTP
maxLength={6}
value="305918"
disabled
containerClassName="has-disabled:opacity-100"
>
<InputOTPGroup>
<InputOTPSlot
index={0}
className="border-primary/60 bg-primary/10 text-chart-3 dark:text-chart-1"
/>
<InputOTPSlot
index={1}
className="border-primary/60 bg-primary/10 text-chart-3 dark:text-chart-1"
/>
<InputOTPSlot
index={2}
className="border-primary/60 bg-primary/10 text-chart-3 dark:text-chart-1"
/>
<InputOTPSlot
index={3}
className="border-primary/60 bg-primary/10 text-chart-3 dark:text-chart-1"
/>
<InputOTPSlot
index={4}
className="border-primary/60 bg-primary/10 text-chart-3 dark:text-chart-1"
/>
<InputOTPSlot
index={5}
className="border-primary/60 bg-primary/10 text-chart-3 dark:text-chart-1"
/>
</InputOTPGroup>
</InputOTP>
<p className="flex items-center gap-1.5 text-xs font-medium text-chart-3 dark:text-primary">
<BadgeCheckIcon className="size-4" />
Email verified
</p>
</div>
)
}
input-otp-30
Loading...
"use client"
import * as React from "react"
import { Badge } from "@/components/ui/badge"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
const CORRECT = "246810"
export function AttemptsRemaining() {
const [value, setValue] = React.useState("")
const [attempts, setAttempts] = React.useState(3)
const [invalid, setInvalid] = React.useState(false)
function handleComplete(code: string) {
if (code === CORRECT) return
setInvalid(true)
setAttempts((a) => Math.max(0, a - 1))
}
return (
<div className="flex w-full max-w-xs flex-col gap-3">
<div className="flex items-center justify-between">
<span className="text-xs font-medium">designali.com security code</span>
<Badge variant={attempts <= 1 ? "destructive" : "secondary"}>
{attempts} attempts left
</Badge>
</div>
<InputOTP
maxLength={6}
value={value}
disabled={attempts === 0}
onChange={(next) => {
setValue(next)
setInvalid(false)
}}
onComplete={handleComplete}
>
<InputOTPGroup>
{[0, 1, 2, 3, 4, 5].map((index) => (
<InputOTPSlot
key={index}
index={index}
aria-invalid={invalid || undefined}
/>
))}
</InputOTPGroup>
</InputOTP>
<p className="text-xs text-muted-foreground">
{invalid
? "Incorrect code. Hint: try 246810."
: "Enter the code from your Designali email."}
</p>
</div>
)
}
input-otp-31
Loading...
"use client"
import { REGEXP_ONLY_DIGITS } from "input-otp"
import {
Gift as GiftIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import { Field, FieldLabel } from "@/components/ui/field"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function GiftCardPin() {
return (
<div className="flex w-full max-w-sm flex-col gap-4 border p-5">
<div className="flex h-24 flex-col justify-between bg-gradient-to-br from-primary to-primary p-3 text-white">
<GiftIcon className="size-5" />
<span className="font-sans text-xs tracking-widest">
6011 •••• •••• 3307
</span>
</div>
<Field>
<FieldLabel htmlFor="gift-pin">Scratch-off PIN</FieldLabel>
<InputOTP id="gift-pin" maxLength={4} pattern={REGEXP_ONLY_DIGITS}>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
<InputOTPSlot index={3} />
</InputOTPGroup>
</InputOTP>
</Field>
<Button>Redeem $50.00</Button>
</div>
)
}
input-otp-32
Loading...
"use client"
import { REGEXP_ONLY_DIGITS_AND_CHARS } from "input-otp"
import {
Field,
FieldDescription,
FieldLabel,
} from "@/components/ui/field"
import {
InputOTP,
InputOTPGroup,
InputOTPSeparator,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function LicenseKeyActivation() {
return (
<Field className="w-fit">
<FieldLabel htmlFor="license-key">License key</FieldLabel>
<InputOTP
id="license-key"
maxLength={12}
pattern={REGEXP_ONLY_DIGITS_AND_CHARS}
>
<InputOTPGroup>
<InputOTPSlot index={0} className="size-6 font-sans uppercase" />
<InputOTPSlot index={1} className="size-6 font-sans uppercase" />
<InputOTPSlot index={2} className="size-6 font-sans uppercase" />
<InputOTPSlot index={3} className="size-6 font-sans uppercase" />
</InputOTPGroup>
<InputOTPSeparator />
<InputOTPGroup>
<InputOTPSlot index={4} className="size-6 font-sans uppercase" />
<InputOTPSlot index={5} className="size-6 font-sans uppercase" />
<InputOTPSlot index={6} className="size-6 font-sans uppercase" />
<InputOTPSlot index={7} className="size-6 font-sans uppercase" />
</InputOTPGroup>
<InputOTPSeparator />
<InputOTPGroup>
<InputOTPSlot index={8} className="size-6 font-sans uppercase" />
<InputOTPSlot index={9} className="size-6 font-sans uppercase" />
<InputOTPSlot index={10} className="size-6 font-sans uppercase" />
<InputOTPSlot index={11} className="size-6 font-sans uppercase" />
</InputOTPGroup>
</InputOTP>
<FieldDescription>
Find it in your purchase receipt from Designali Templates Pro.
</FieldDescription>
</Field>
)
}
input-otp-33
Loading...
"use client"
import { REGEXP_ONLY_DIGITS } from "input-otp"
import {
ArrowRight as ArrowRightIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import { Field, FieldLabel } from "@/components/ui/field"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function ChangeEmailConfirmation() {
return (
<div className="flex w-full max-w-sm flex-col gap-4">
<div className="flex items-center gap-2 border bg-muted/40 p-3 text-xs">
<span className="truncate text-muted-foreground line-through">
ali@example.com
</span>
<ArrowRightIcon className="size-3.5 shrink-0" />
<span className="truncate font-medium">ali@designali.com</span>
</div>
<Field>
<FieldLabel htmlFor="change-email-otp">
Code sent to your new address
</FieldLabel>
<InputOTP
id="change-email-otp"
maxLength={6}
pattern={REGEXP_ONLY_DIGITS}
>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
<InputOTPSlot index={3} />
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTPGroup>
</InputOTP>
</Field>
<div className="flex gap-2">
<Button variant="outline" size="sm">
Cancel change
</Button>
<Button size="sm">Confirm email</Button>
</div>
</div>
)
}
input-otp-34
Loading...
"use client"
import { REGEXP_ONLY_DIGITS } from "input-otp"
import {
ArrowLeft as ArrowLeftIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
import { Progress } from "@/components/ui/progress"
export function OnboardingVerifyStep() {
return (
<div className="flex w-full max-w-sm flex-col gap-5">
<div className="space-y-2">
<div className="flex justify-between text-xs text-muted-foreground">
<span>Step 2 of 3</span>
<span>Verify email</span>
</div>
<Progress value={66} />
</div>
<div className="space-y-1">
<h3 className="text-base font-semibold">Confirm it's you</h3>
<p className="text-xs text-muted-foreground">
Enter the code we sent to hello@designali.com
</p>
</div>
<InputOTP maxLength={6} pattern={REGEXP_ONLY_DIGITS}>
<InputOTPGroup>
<InputOTPSlot index={0} className="size-10 text-sm" />
<InputOTPSlot index={1} className="size-10 text-sm" />
<InputOTPSlot index={2} className="size-10 text-sm" />
<InputOTPSlot index={3} className="size-10 text-sm" />
<InputOTPSlot index={4} className="size-10 text-sm" />
<InputOTPSlot index={5} className="size-10 text-sm" />
</InputOTPGroup>
</InputOTP>
<div className="flex justify-between">
<Button variant="ghost">
<ArrowLeftIcon data-icon="inline-start" />
Back
</Button>
<Button>Next</Button>
</div>
</div>
)
}
input-otp-35
Loading...
"use client"
import * as React from "react"
import { Button } from "@/components/ui/button"
import { Field, FieldError, FieldLabel } from "@/components/ui/field"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
import { Kbd } from "@/components/ui/kbd"
export function FormSubmitWithValidation() {
const [value, setValue] = React.useState("")
const [error, setError] = React.useState("")
const [sent, setSent] = React.useState(false)
function handleSubmit(event: React.FormEvent) {
event.preventDefault()
if (value.length < 6) {
setError("Enter all 6 digits.")
return
}
setError("")
setSent(true)
}
return (
<form
onSubmit={handleSubmit}
className="flex w-full max-w-xs flex-col gap-3"
>
<Field data-invalid={!!error || undefined}>
<FieldLabel htmlFor="otp-form">Verify your designali.com account</FieldLabel>
<InputOTP
id="otp-form"
maxLength={6}
value={value}
onChange={(next) => {
setValue(next)
setSent(false)
}}
>
<InputOTPGroup>
{[0, 1, 2, 3, 4, 5].map((index) => (
<InputOTPSlot
key={index}
index={index}
aria-invalid={!!error || undefined}
/>
))}
</InputOTPGroup>
</InputOTP>
{error ? <FieldError>{error}</FieldError> : null}
</Field>
<div className="flex items-center justify-between">
<span className="flex items-center gap-1 text-xs text-muted-foreground">
Press <Kbd>Enter</Kbd> to submit
</span>
<Button type="submit" size="sm">
{sent ? "Verified" : "Verify"}
</Button>
</div>
</form>
)
}
input-otp-36
Loading...
"use client"
import { REGEXP_ONLY_DIGITS_AND_CHARS } from "input-otp"
import {
MessageSquare as MessageSquareIcon,
} from "@designali/icons"
import {
Avatar,
AvatarFallback,
AvatarGroup,
AvatarGroupCount,
} from "@/components/ui/avatar"
import { Button } from "@/components/ui/button"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
const members = ["Ali Imam", "Brand Designer", "Studio Developer"]
export function JoinPrivateChatRoom() {
return (
<div className="flex w-full max-w-sm flex-col items-center gap-4 border p-5 text-center">
<AvatarGroup>
{members.map((member) => (
<Avatar key={member}>
<AvatarFallback>
{member
.split(" ")
.map((p) => p[0])
.join("")}
</AvatarFallback>
</Avatar>
))}
<AvatarGroupCount>+9</AvatarGroupCount>
</AvatarGroup>
<div className="space-y-1">
<h3 className="text-sm font-semibold">#design-crit is private</h3>
<p className="text-xs text-muted-foreground">
Ask a member for the invite code to join.
</p>
</div>
<InputOTP maxLength={6} pattern={REGEXP_ONLY_DIGITS_AND_CHARS}>
<InputOTPGroup>
<InputOTPSlot index={0} className="uppercase" />
<InputOTPSlot index={1} className="uppercase" />
<InputOTPSlot index={2} className="uppercase" />
<InputOTPSlot index={3} className="uppercase" />
<InputOTPSlot index={4} className="uppercase" />
<InputOTPSlot index={5} className="uppercase" />
</InputOTPGroup>
</InputOTP>
<Button className="w-full">
<MessageSquareIcon data-icon="inline-start" />
Join channel
</Button>
</div>
)
}
input-otp-37
Loading...
"use client"
import * as React from "react"
import { REGEXP_ONLY_DIGITS } from "input-otp"
import {
Ticket as TicketIcon,
} from "@designali/icons"
import {
Avatar,
AvatarFallback,
AvatarImage,
} from "@/components/ui/avatar"
import { Badge } from "@/components/ui/badge"
import { Button } from "@/components/ui/button"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function EventCheckInDesk() {
const [value, setValue] = React.useState("")
const found = value === "40217"
return (
<div className="flex w-full max-w-sm flex-col gap-4 border p-4">
<div className="flex items-center justify-between">
<span className="flex items-center gap-2 text-sm font-medium">
<TicketIcon className="size-4" />
Check-in
</span>
<Badge variant="secondary">Hall B · 212 / 480</Badge>
</div>
<InputOTP
maxLength={5}
pattern={REGEXP_ONLY_DIGITS}
value={value}
onChange={setValue}
>
<InputOTPGroup>
<InputOTPSlot index={0} className="size-11 text-lg" />
<InputOTPSlot index={1} className="size-11 text-lg" />
<InputOTPSlot index={2} className="size-11 text-lg" />
<InputOTPSlot index={3} className="size-11 text-lg" />
<InputOTPSlot index={4} className="size-11 text-lg" />
</InputOTPGroup>
</InputOTP>
<div className="flex min-h-12 items-center gap-3 border border-dashed p-2 text-xs">
{found ? (
<>
<Avatar size="sm">
<AvatarImage src="/ali.jpg" alt="Ali Imam" />
<AvatarFallback>AI</AvatarFallback>
</Avatar>
<div className="flex-1">
<p className="font-medium">Ali Imam</p>
<p className="text-muted-foreground">Speaker pass</p>
</div>
<Button size="sm">Check in</Button>
</>
) : (
<span className="text-muted-foreground">Try ticket code 40217</span>
)}
</div>
</div>
)
}
input-otp-38
Loading...
"use client"
import * as React from "react"
import { REGEXP_ONLY_DIGITS } from "input-otp"
import {
Field,
FieldDescription,
FieldLabel,
} from "@/components/ui/field"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
import { Label } from "@/components/ui/label"
import { Separator } from "@/components/ui/separator"
import { Switch } from "@/components/ui/switch"
export function ParentalControlsPin() {
const [enabled, setEnabled] = React.useState(true)
return (
<div className="flex w-full max-w-sm flex-col gap-4 border p-4">
<div className="flex items-center justify-between gap-4">
<div>
<Label htmlFor="parental">Client approval lock</Label>
<p className="mt-1 text-xs text-muted-foreground">
Require a PIN before Designali files are sent to clients.
</p>
</div>
<Switch id="parental" checked={enabled} onCheckedChange={setEnabled} />
</div>
<Separator />
<Field className="w-fit">
<FieldLabel htmlFor="parental-pin">Studio PIN</FieldLabel>
<InputOTP
id="parental-pin"
maxLength={4}
pattern={REGEXP_ONLY_DIGITS}
disabled={!enabled}
>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
<InputOTPSlot index={3} />
</InputOTPGroup>
</InputOTP>
<FieldDescription>
{enabled
? "Choose 4 digits you'll remember."
: "Turn on the lock to set a PIN."}
</FieldDescription>
</Field>
</div>
)
}
input-otp-39
Loading...
"use client"
import * as React from "react"
import {
EyeOff as EyeOffIcon,
KeyRound as KeyRoundIcon,
} from "@designali/icons"
import { Badge } from "@/components/ui/badge"
import { Button } from "@/components/ui/button"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function RevealApiSecret() {
const [revealed, setRevealed] = React.useState(false)
return (
<div className="flex w-full max-w-sm flex-col gap-3 border p-4">
<div className="flex items-center justify-between">
<span className="text-xs font-medium">Production secret key</span>
<Badge variant="outline">Live</Badge>
</div>
<div className="flex items-center gap-2 bg-muted px-3 py-2 font-sans text-xs">
<KeyRoundIcon className="size-3.5 shrink-0" />
<span className="truncate">
{revealed
? "key_demo_aZr4"
: "key_demo_••••••••••••••••••"}
</span>
</div>
{!revealed && (
<>
<p className="text-xs text-muted-foreground">
Enter your 2FA code to reveal this key.
</p>
<InputOTP maxLength={6} onComplete={() => setRevealed(true)}>
<InputOTPGroup>
<InputOTPSlot index={0} className="size-7" />
<InputOTPSlot index={1} className="size-7" />
<InputOTPSlot index={2} className="size-7" />
<InputOTPSlot index={3} className="size-7" />
<InputOTPSlot index={4} className="size-7" />
<InputOTPSlot index={5} className="size-7" />
</InputOTPGroup>
</InputOTP>
</>
)}
{revealed && (
<Button variant="outline" size="sm" onClick={() => setRevealed(false)}>
<EyeOffIcon data-icon="inline-start" />
Hide key
</Button>
)}
</div>
)
}
input-otp-40
Loading...
"use client"
import { REGEXP_ONLY_DIGITS } from "input-otp"
import {
Clock as ClockIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import {
InputOTP,
InputOTPGroup,
InputOTPSeparator,
InputOTPSlot,
} from "@/components/ui/input-otp"
import { CounterNumber } from "@/components/ui/counter-number"
export function PayoutSecurityCode() {
return (
<div className="flex w-full max-w-sm flex-col gap-4 border p-5">
<div className="text-center">
<p className="text-xs text-muted-foreground">
Designali studio payout to Checking •• 2201
</p>
<p className="font-semibold tabular-nums">
<CounterNumber value={12800} prefix="$" decimalPlaces={2} size="lg" />
</p>
</div>
<InputOTP
maxLength={6}
pattern={REGEXP_ONLY_DIGITS}
containerClassName="justify-center"
>
<InputOTPGroup>
<InputOTPSlot index={0} className="size-10" />
<InputOTPSlot index={1} className="size-10" />
<InputOTPSlot index={2} className="size-10" />
</InputOTPGroup>
<InputOTPSeparator />
<InputOTPGroup>
<InputOTPSlot index={3} className="size-10" />
<InputOTPSlot index={4} className="size-10" />
<InputOTPSlot index={5} className="size-10" />
</InputOTPGroup>
</InputOTP>
<p className="flex items-center justify-center gap-1.5 text-xs text-muted-foreground">
<ClockIcon className="size-3.5" />
Funds arrive in 1-2 business days
</p>
<Button>Confirm payout</Button>
</div>
)
}
input-otp-41
Loading...
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
function Dot() {
return (
<div
role="separator"
className="mx-1 size-1.5 rounded-full bg-muted-foreground/50"
/>
)
}
export function DotSeparatorGroups() {
return (
<InputOTP maxLength={6}>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
</InputOTPGroup>
<Dot />
<InputOTPGroup>
<InputOTPSlot index={2} />
<InputOTPSlot index={3} />
</InputOTPGroup>
<Dot />
<InputOTPGroup>
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTPGroup>
</InputOTP>
)
}
input-otp-42
Loading...
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function CircularSlots() {
return (
<InputOTP maxLength={4}>
<InputOTPGroup className="gap-3">
<InputOTPSlot
index={0}
className="size-12 rounded-full border text-lg first:rounded-full last:rounded-full"
/>
<InputOTPSlot
index={1}
className="size-12 rounded-full border text-lg first:rounded-full last:rounded-full"
/>
<InputOTPSlot
index={2}
className="size-12 rounded-full border text-lg first:rounded-full last:rounded-full"
/>
<InputOTPSlot
index={3}
className="size-12 rounded-full border text-lg first:rounded-full last:rounded-full"
/>
</InputOTPGroup>
</InputOTP>
)
}
input-otp-43
Loading...
"use client"
import * as React from "react"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
import { cn } from "@/lib/utils"
export function FilledSlotHighlight() {
const [value, setValue] = React.useState("38")
return (
<InputOTP maxLength={6} value={value} onChange={setValue}>
<InputOTPGroup className="gap-1.5">
{[0, 1, 2, 3, 4, 5].map((index) => (
<InputOTPSlot
key={index}
index={index}
className={cn(
"size-10 border text-base",
value[index] &&
"border-primary/40 bg-primary/10 dark:bg-primary/15"
)}
/>
))}
</InputOTPGroup>
</InputOTP>
)
}
input-otp-44
Loading...
"use client"
import * as React from "react"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
import { Progress } from "@/components/ui/progress"
export function EntryProgressBar() {
const [value, setValue] = React.useState("")
return (
<div className="flex w-fit flex-col gap-3">
<InputOTP maxLength={6} value={value} onChange={setValue}>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
<InputOTPSlot index={3} />
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTPGroup>
</InputOTP>
<Progress value={(value.length / 6) * 100} />
<p className="text-center text-xs text-muted-foreground tabular-nums">
{value.length} of 6 digits sent to hello@designali.com
</p>
</div>
)
}
input-otp-45
Loading...
"use client"
import * as React from "react"
import { REGEXP_ONLY_DIGITS } from "input-otp"
import {
Pencil as PencilIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import { Field, FieldLabel } from "@/components/ui/field"
import { Input } from "@/components/ui/input"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function MagicCodeTwoStep() {
const [email, setEmail] = React.useState("sam@parcelpost.dev")
const [step, setStep] = React.useState<"email" | "code">("code")
return (
<div className="flex w-full max-w-xs flex-col gap-4">
{step === "email" ? (
<>
<Field>
<FieldLabel htmlFor="magic-email">Email</FieldLabel>
<Input
id="magic-email"
type="email"
value={email}
onChange={(e) => setEmail(e.target.value)}
/>
</Field>
<Button onClick={() => setStep("code")}>Send sign-in code</Button>
</>
) : (
<>
<div className="flex items-center justify-between gap-2 text-xs">
<span className="truncate text-muted-foreground">{email}</span>
<Button
variant="link"
size="sm"
className="px-0"
onClick={() => setStep("email")}
>
<PencilIcon data-icon="inline-start" />
Edit
</Button>
</div>
<InputOTP maxLength={6} pattern={REGEXP_ONLY_DIGITS} autoFocus>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
<InputOTPSlot index={3} />
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTPGroup>
</InputOTP>
<Button>Sign in</Button>
</>
)}
</div>
)
}
input-otp-46
Loading...
"use client"
import * as React from "react"
import { REGEXP_ONLY_DIGITS } from "input-otp"
import {
Mail as MailIcon,
MessageSquare as MessageSquareIcon,
Phone as PhoneIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
import { Label } from "@/components/ui/label"
import {
RadioGroup,
RadioGroupItem,
} from "@/components/ui/radio-group"
const methods = [
{ value: "sms", label: "Text message", icon: MessageSquareIcon },
{ value: "call", label: "Voice call", icon: PhoneIcon },
{ value: "email", label: "Email", icon: MailIcon },
]
export function DeliveryMethodChooser() {
const [method, setMethod] = React.useState("sms")
return (
<div className="flex w-full max-w-sm flex-col gap-4">
<RadioGroup
value={method}
onValueChange={(v) => setMethod(String(v))}
className="grid grid-cols-3 gap-2"
>
{methods.map((m) => (
<Label
key={m.value}
htmlFor={"method-" + m.value}
className="flex-col gap-2 border p-3 has-data-checked:border-primary has-data-checked:bg-muted"
>
<RadioGroupItem
id={"method-" + m.value}
value={m.value}
className="sr-only"
/>
<m.icon className="size-4" />
{m.label}
</Label>
))}
</RadioGroup>
<InputOTP maxLength={6} pattern={REGEXP_ONLY_DIGITS}>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
<InputOTPSlot index={3} />
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTPGroup>
</InputOTP>
<Button variant="outline" size="sm" className="self-start">
Send new code
</Button>
</div>
)
}
input-otp-47
Loading...
"use client"
import { REGEXP_ONLY_DIGITS_AND_CHARS } from "input-otp"
import {
Building as BuildingIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import { Field, FieldLabel } from "@/components/ui/field"
import {
InputOTP,
InputOTPGroup,
InputOTPSeparator,
InputOTPSlot,
} from "@/components/ui/input-otp"
import {
Item,
ItemContent,
ItemDescription,
ItemMedia,
ItemTitle,
} from "@/components/ui/item"
export function WorkspaceInviteCode() {
return (
<div className="flex w-full max-w-sm flex-col gap-4">
<Item variant="outline">
<ItemMedia variant="icon">
<BuildingIcon />
</ItemMedia>
<ItemContent>
<ItemTitle>Designali Studio</ItemTitle>
<ItemDescription>38 members · Design team</ItemDescription>
</ItemContent>
</Item>
<Field>
<FieldLabel htmlFor="invite-code">Invite code</FieldLabel>
<InputOTP
id="invite-code"
maxLength={6}
pattern={REGEXP_ONLY_DIGITS_AND_CHARS}
>
<InputOTPGroup>
<InputOTPSlot index={0} className="uppercase" />
<InputOTPSlot index={1} className="uppercase" />
<InputOTPSlot index={2} className="uppercase" />
</InputOTPGroup>
<InputOTPSeparator />
<InputOTPGroup>
<InputOTPSlot index={3} className="uppercase" />
<InputOTPSlot index={4} className="uppercase" />
<InputOTPSlot index={5} className="uppercase" />
</InputOTPGroup>
</InputOTP>
</Field>
<Button>Join workspace</Button>
</div>
)
}
input-otp-48
Loading...
"use client"
import * as React from "react"
import {
Check as CheckIcon,
Copy as CopyIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import {
InputOTP,
InputOTPGroup,
InputOTPSeparator,
InputOTPSlot,
} from "@/components/ui/input-otp"
export function ReadOnlyPairingCodeDisplay() {
const [copied, setCopied] = React.useState(false)
const code = "829304"
return (
<div className="flex w-full max-w-xs flex-col items-center gap-3 border p-4 text-center">
<p className="text-xs text-muted-foreground">
Enter this code on your other device
</p>
<InputOTP
maxLength={6}
value={code}
disabled
containerClassName="has-disabled:opacity-100"
>
<InputOTPGroup>
<InputOTPSlot
index={0}
className="size-10 bg-muted text-base font-semibold"
/>
<InputOTPSlot
index={1}
className="size-10 bg-muted text-base font-semibold"
/>
<InputOTPSlot
index={2}
className="size-10 bg-muted text-base font-semibold"
/>
</InputOTPGroup>
<InputOTPSeparator />
<InputOTPGroup>
<InputOTPSlot
index={3}
className="size-10 bg-muted text-base font-semibold"
/>
<InputOTPSlot
index={4}
className="size-10 bg-muted text-base font-semibold"
/>
<InputOTPSlot
index={5}
className="size-10 bg-muted text-base font-semibold"
/>
</InputOTPGroup>
</InputOTP>
<Button
variant="ghost"
size="sm"
onClick={() => {
void navigator.clipboard?.writeText(code)
setCopied(true)
}}
>
{copied ? (
<CheckIcon data-icon="inline-start" />
) : (
<CopyIcon data-icon="inline-start" />
)}
{copied ? "Copied" : "Copy code"}
</Button>
</div>
)
}
input-otp-49
Loading...
"use client"
import { REGEXP_ONLY_DIGITS } from "input-otp"
import {
CircleQuestionMark as CircleHelpIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import { Field, FieldLabel } from "@/components/ui/field"
import {
InputOTP,
InputOTPGroup,
InputOTPSeparator,
InputOTPSlot,
} from "@/components/ui/input-otp"
import {
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@/components/ui/tooltip"
export function VerificationWithTooltipHelp() {
return (
<Field className="w-fit">
<div className="flex items-center gap-1.5">
<FieldLabel htmlFor="otp-help">Device code</FieldLabel>
<Tooltip>
<TooltipTrigger
render={
<Button
variant="ghost"
size="icon-xs"
aria-label="Where is my code?"
/>
}
>
<CircleHelpIcon />
</TooltipTrigger>
<TooltipContent>
Open Settings → Devices on your phone to see the code.
</TooltipContent>
</Tooltip>
</div>
<InputOTP id="otp-help" maxLength={6} pattern={REGEXP_ONLY_DIGITS}>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
</InputOTPGroup>
<InputOTPSeparator />
<InputOTPGroup>
<InputOTPSlot index={3} />
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTPGroup>
</InputOTP>
</Field>
)
}
input-otp-50
Loading...
"use client"
import { REGEXP_ONLY_DIGITS } from "input-otp"
import {
FingerprintPattern as FingerprintIcon,
} from "@designali/icons"
import { Button } from "@/components/ui/button"
import {
InputOTP,
InputOTPGroup,
InputOTPSlot,
} from "@/components/ui/input-otp"
import { Separator } from "@/components/ui/separator"
export function SecurityKeyFallback() {
return (
<div className="flex w-full max-w-xs flex-col gap-4">
<Button variant="outline">
<FingerprintIcon data-icon="inline-start" />
Use passkey
</Button>
<div className="flex items-center gap-3 text-xs text-muted-foreground">
<Separator className="flex-1" />
or enter a code
<Separator className="flex-1" />
</div>
<InputOTP
maxLength={6}
pattern={REGEXP_ONLY_DIGITS}
containerClassName="justify-center"
>
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
<InputOTPSlot index={3} />
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTPGroup>
</InputOTP>
<Button>Sign in</Button>
</div>
)
}
Categories
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Avatar
- Badge
- Breadcrumb
- Button
- Calendar
- Card
- Carousel
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Dialog
- Drawer
- Dropdown Menu
- Field
- Hover Card
- Input
- Input OTP
- Label
- Menubar
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Resizable
- Scroll Area
- Select
- Separator
- Sheet
- Skeleton
- Slider
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toast
- Toggle
- Toggle Group
- Tooltip