BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/better-auth-ui/phone-number

Phone Number

better-auth-ui/phone-number
FreeComponent

Phone-number plugin with verification-code and password sign-in, password recovery, and verified phone-number management.

Live preview

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

Install it

npx shadcn@latest add https://better-auth-ui.com/r/phone-number.json

Source

src/components/auth/phone-number/phone-number.tsxbetter-auth-ui.com/r/phone-number.json · first 6 KB
1"use client"
2
3import { authMutationKeys } from "@better-auth-ui/core"
4import {
5 AuthPrompts,
6 type PhoneNumberAuthClient,
7 useAuth,
8 useAuthPlugin,
9 useFetchOptions,
10 useSendPhoneNumberOtp,
11 useSignInPhoneNumber,
12 useVerifyPhoneNumber
13} from "@better-auth-ui/react"
14import { useIsMutating } from "@tanstack/react-query"
15import { Eye, EyeOff } from "lucide-react"
16import { type SyntheticEvent, useState } from "react"
17
18import { Button } from "@/components/ui/button"
19import {
20 Card,
21 CardContent,
22 CardDescription,
23 CardHeader,
24 CardTitle
25} from "@/components/ui/card"
26import { Checkbox } from "@/components/ui/checkbox"
27import {
28 Field,
29 FieldDescription,
30 FieldError,
31 FieldGroup,
32 FieldLabel,
33 FieldSeparator
34} from "@/components/ui/field"
35import { Input } from "@/components/ui/input"
36import {
37 InputGroup,
38 InputGroupAddon,
39 InputGroupButton,
40 InputGroupInput
41} from "@/components/ui/input-group"
42import { Spinner } from "@/components/ui/spinner"
43import { phoneNumberPlugin } from "@/lib/auth/phone-number-plugin"
44import { useResendCooldown } from "@/lib/auth/use-resend-cooldown"
45import { useSignInContinuation } from "@/lib/auth/use-sign-in-continuation"
46import { cn } from "@/lib/utils"
47import { OtpField } from "../otp-field"
48import { ProviderButtons, type SocialLayout } from "../provider-buttons"
49
50type PhoneNumberMode = "code" | "password"
51
52export type PhoneNumberProps = {
53 className?: string
54 socialLayout?: SocialLayout
55 socialPosition?: "top" | "bottom"
56}
57
58/** Sign in with either a phone verification code or a phone and password. */
59export function PhoneNumber({
60 className,
61 socialLayout,
62 socialPosition = "bottom"
63}: PhoneNumberProps) {
64 const {
65 authClient,
66 basePaths,
67 emailAndPassword,
68 localization,
69 plugins,
70 socialProviders,
71 viewPaths,
72 Link
73 } = useAuth()
74 const {
75 localization: phoneLocalization,
76 otpLength,
77 passwordReset,
78 passwordSignIn,
79 signIn,
80 viewPaths: phoneNumberViewPaths
81 } = useAuthPlugin(phoneNumberPlugin)
82 const phoneClient = authClient as PhoneNumberAuthClient
83 const { fetchOptions, resetFetchOptions } = useFetchOptions()
84 const continueSignIn = useSignInContinuation()
85 const { cooldown, isCoolingDown, startCooldown } = useResendCooldown()
86 const [mode, setMode] = useState<PhoneNumberMode>(
87 signIn ? "code" : "password"
88 )
89 const [phoneNumber, setPhoneNumber] = useState("")
90 const [password, setPassword] = useState("")
91// … truncated

What it pulls in

npm packages

  • @better-auth-ui/react@latest
  • @better-auth-ui/core@latest
  • better-auth
  • input-otp
  • lucide-react

Other registry items

  • alert-dialog
  • button
  • card
  • checkbox
  • field
  • https://better-auth-ui.com/r/radix-nova/account-settings.json
  • input
  • input-group
  • input-otp
  • skeleton
  • sonner
  • spinner

Files it writes

  • src/lib/auth/auth-plugin.ts
  • src/lib/auth/phone-number-plugin.ts
  • src/lib/auth/use-resend-cooldown.ts
  • src/lib/auth/use-sign-in-continuation.ts
  • src/components/auth/otp-field.tsx
  • src/components/auth/phone-number/phone-number.tsx
  • src/components/auth/phone-number/phone-number-button.tsx
  • src/components/auth/phone-number/forgot-phone-number-password.tsx
  • src/components/auth/phone-number/reset-phone-number-password.tsx
  • src/components/auth/phone-number/change-phone-number.tsx
  • src/components/auth/phone-number/remove-phone-number-dialog.tsx
  • src/components/auth/provider-button.tsx
  • src/components/auth/provider-buttons.tsx
  • src/components/auth/last-login-method/last-used-badge.tsx
  • src/components/auth/use-is-hydrated.ts

Facts

Registry
better-auth-ui
Type
registry:component
Access
Free
Files written
15
Licence
MIT
In the index
at or before 2026-08-12
Last confirmed
today

Go to the source

Docs on better-auth-ui better-auth-ui.com better-auth-ui/better-auth-ui on GitHub Raw registry item This item as JSON

More from better-auth-ui

All 49 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Account Settingsaccount-settingsbetter-auth-uiComponentsFree2 deps
Active Sessionsactive-sessionsbetter-auth-uiComponentsFree5 deps · 2 files
Additional Fieldadditional-fieldbetter-auth-uiComponentsFree5 deps
Adminadminbetter-auth-uiComponentsFree4 deps · 3 files
Anonymousanonymousbetter-auth-uiComponentsFree4 deps · 3 files
API Keyapi-keybetter-auth-uiComponentsFree4 deps · 10 files
Authauthbetter-auth-uiComponentsFree2 deps
Auth Providerauth-providerbetter-auth-uiComponentsFree4 deps · 2 files

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