Gate Forms
Sign in, sign up, forgot password and code verification as one flow. Real forms with field errors, a failure banner, a password checklist with a strength line, code boxes that advance and take a paste, and views that slide while the card changes height.
pixikit.com/docs/app-ui/forms/gate-forms
Customize
Default view
Layout
Passkey
Magic link
Code length6
Resend after20s
Props
23| Name | Type | Default | Description |
|---|---|---|---|
view | GateView | None | The view shown, when you hold the state. |
defaultView | GateView | "sign-in" | The view shown at first, when the flow holds the state. |
onViewChange | (view: GateView) => void | None | Called with the view the flow moves to. |
layout | "centered" | "card" | "split" | "card" | Bare on the page, in a bordered card, or the form beside an aside panel that drops away when the container is narrow. |
aside | ReactNode | None | Replaces the default animated art in the split layout. |
brand | ReactNode | None | A logo or name shown above the form. |
providers | GateProvider[] | [] | Buttons above a divider on sign in and sign up. |
onProvider | (id: string) => void | Promise<void> | None | Called with the provider's id; a rejection shows its message in the banner. |
onSignIn | (values: { identifier: string; password: string; remember: boolean }) => Promise<void> | None | Called on sign in. With `magicLink` the password is an empty string. A rejection shows its message. |
onSignUp | (values: { name: string; identifier: string; password: string }) => Promise<void> | None | Called on sign up; on success the flow asks for the code. |
onForgot | (values: { identifier: string }) => Promise<void> | None | Called on the forgot password form; on success the flow asks for the code. |
onVerify | (code: string) => Promise<void> | None | Called with the code once every box is filled. A rejection shakes the boxes and clears them. |
onResend | () => Promise<void> | None | Called by the resend button. |
passkey | boolean | false | Shows a passkey button on sign in. |
onPasskey | () => void | Promise<void> | None | Called when the passkey button is pressed. |
magicLink | boolean | false | Sign in asks only for the identifier, sends a link, then shows a check your inbox state. |
codeLength | number | 6 | The number of boxes in the code. |
resendAfter | number | 30 | Seconds the resend button counts down before it works. |
identifierLabel | string | "Email" | The label of the identifier field. A label with "email" in it makes the field an email address; any other label makes it plain text. |
identifierPlaceholder | string | None | The identifier field's placeholder. |
terms | ReactNode | None | A note under the sign up button, such as a line about terms. |
passwordRules | GateRule[] | [] | Rules shown under the sign up password as a checklist that ticks itself, with a strength line that fills. |
className | string | None | Extra classes for the root. |