Skip to content
PixiKit

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
NameTypeDefaultDescription
viewGateViewNoneThe view shown, when you hold the state.
defaultViewGateView"sign-in"The view shown at first, when the flow holds the state.
onViewChange(view: GateView) => voidNoneCalled 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.
asideReactNodeNoneReplaces the default animated art in the split layout.
brandReactNodeNoneA logo or name shown above the form.
providersGateProvider[][]Buttons above a divider on sign in and sign up.
onProvider(id: string) => void | Promise<void>NoneCalled with the provider's id; a rejection shows its message in the banner.
onSignIn(values: { identifier: string; password: string; remember: boolean }) => Promise<void>NoneCalled 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>NoneCalled on sign up; on success the flow asks for the code.
onForgot(values: { identifier: string }) => Promise<void>NoneCalled on the forgot password form; on success the flow asks for the code.
onVerify(code: string) => Promise<void>NoneCalled with the code once every box is filled. A rejection shakes the boxes and clears them.
onResend() => Promise<void>NoneCalled by the resend button.
passkeybooleanfalseShows a passkey button on sign in.
onPasskey() => void | Promise<void>NoneCalled when the passkey button is pressed.
magicLinkbooleanfalseSign in asks only for the identifier, sends a link, then shows a check your inbox state.
codeLengthnumber6The number of boxes in the code.
resendAfternumber30Seconds the resend button counts down before it works.
identifierLabelstring"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.
identifierPlaceholderstringNoneThe identifier field's placeholder.
termsReactNodeNoneA note under the sign up button, such as a line about terms.
passwordRulesGateRule[][]Rules shown under the sign up password as a checklist that ticks itself, with a strength line that fills.
classNamestringNoneExtra classes for the root.

Related