Usage
import { SignIn } from './SignIn.jsx'
// Without callbacks the card signs in after a short wait (the code 000000 is refused). Wire it to your auth:
<SignIn
locale="en"
onSignIn={async ({ email, password, remember }) => (await auth.signIn(email, password, remember)).ok}
onProvider={() => auth.redirect('google')}
onSendCode={async (email) => (await auth.sendCode(email)).ok}
onVerifyCode={async ({ email, code }) => (await auth.verify(email, code)).ok}
onForgot={(email) => auth.sendReset(email)}
onSignUp={() => router.push('/sign-up')}
/>Props
| Prop | Type | Default | What it does |
|---|---|---|---|
locale | 'en' | 'zh-CN' | 'es' | 'ja' | 'en' | Language of the built-in text. |
defaultMode | 'password' | 'code' | 'password' | The path the card opens on: password, or a one-time code by email. |
defaultEmail | string | '' | The email the field starts with, for example the last one used. |
provider | ReactNode | 'Continue with Google' | The text of the provider button; its mark stays plain and monochrome. |
loading | boolean | false | Shows the form as sending: fields locked, the button spinning. |
error | boolean | string | false | Shows the refused sign-in banner; a string replaces its sentence. It clears on the next try. |
onSignIn | ({ email, password, remember }) => Promise<boolean | string | void> | — | Signs in. Resolve false (or a sentence) to show the banner; otherwise the card shows who is signed in. |
onSendCode / onVerifyCode | (email) => Promise<boolean | string | void> / ({ email, code, remember }) => Promise<boolean | string | void> | — | Emails a code, and checks the code typed. Resolve false or a sentence to say it under the field. |
onProvider / onForgot / onSignUp | () => void / (email) => void / () => void | — | The provider button, the forgotten-password link (with the email typed) and the create-account link were pressed. |
product | string | 'Halden' (sample) | The product’s name, used in the title and the sign-up line. |
labels | object | — | Replaces any built-in text (keys as in copy.js). |
className | string | — | Added to the root section. |
Add it to your project
Copy the prompt into Codex or Claude Code. The agent reads the published source, shows you what it will write and adds the block together with the components it is built from.
SignIn.jsxsign-in.csscopy.jskit.jsxkit.cssui/base-button/ui/alert-banner/ui/success-check/ui/checkbox/ui/otp-input/ui/text-input/tokens.cssREADME.md
The block, its stylesheet and text, the shared kit, the components it uses and tokens.css install together into one folder.