Staaarter

Phone Number Sign In

Full-height sign-in screen built around a phone number instead of an email or password. A native country-code select sits next to a tel input, followed by a send-code button and an email fallback link.

By Staaarter Team
Auth
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/phone-number-sign-in.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/auth/auth15.tsx instead.

Usage

The file also exports auth15Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.

import { Auth15, auth15Demo } from "@/components/blocks/auth/auth15";

export default function Page() {
  return <Auth15 {...auth15Demo} />;
}

Props

PropTypeDefaultDescription
headingReactNode"Sign in with your phone"Screen heading.
descriptionstringundefinedSupporting copy under the heading.
countryCodesCountryCode[]noneOptions rendered in the native country select.
defaultCountryValuestringundefinedValue pre-selected in the country select; falls back to the first entry in countryCodes.
submitLabelstring"Send code"Label on the submit button.
emailFallbackEmailFallbackundefinedOptional "use email instead" link shown below the form.
classNamestringnoneExtra classes for the outer section element.

Types

type CountryCode = { value: string; label: string };

type EmailFallback = { label: string; href: string };

Behavior notes

  • The country select is a plain native <select>, no JS is needed to open or operate it, so the whole block stays a server component.
  • "Send code" is a real <button type="submit"> inside a <form>, but the form has no action wired up; submitting it does not actually send an SMS.
  • emailFallback is optional; omitting it removes the "use email instead" link entirely rather than leaving empty space.