Dashral Pro is on the wayGet 30% off at launch

Dashral

Sign in

Google and GitHub, or email and password with Forgot password, remember me, loading and a wrong-password error.

$ pnpm dlx shadcn@latest add @dashral/sign-in

When to use

  • Sign in with a provider or email and password, with forgot password, loading and errors.
  • Any app's login page.

When not to use

  • Making an account: Sign up, split.
  • Apps that only sign in through a company's single sign-on: one button says it; the email form would mislead.

Usage

Sign in with your own data: every prop has the sample as its default, so pass only what you have.

example.tsx
import { SignIn } from "@/components/dashral/blocks/sign-in"

<SignIn
  providers={providers}
  onProvider={(provider) => signIn(provider)}
  onSubmit={async ({ email, password }) => {
    await signIn("credentials", { email, password })
  }}
  forgotHref="/forgot-password"
  signUpHref="/register"
/>

API reference

SignIn

A sign-in card: providers such as Google and GitHub, or email and password with "Forgot password?" by the label, a remember-me box and a loading state. An error shows above the form. Every part comes from props; wire onSubmit to your auth (without it, try any email with the password "password").

PropTypeDefault
titleReact.ReactNode"Welcome back"
descriptionReact.ReactNodesample
providers{ id: string; label: string; icon?: React.ReactNode }[]

The buttons above the form; none hides them and the "or" under them.

sample
onProvider(id: string) => void

Called with a provider's id when its button is pressed, e.g. to start its sign-in.

—
onSubmit(values: SignInValues) => Promise<void> | void

Your sign-in. Resolve to sign in (the card says so); throw an Error to show its message above the form. Without it, the card plays a sample: any email with the password "password".

—
forgotHrefstring

Where "Forgot password?" and "Create an account" go; none hides them.

"#"
signUpHrefstring"#"
signUpPromptstring

The words before "Create an account".

"New to Acme?"
done{ title: string; description?: string }

What the card says once signed in.

sample

type SignInValues

PropTypeDefault
emailstring—
passwordstring—
rememberboolean—