Stepped Sign Up
ProSign up card split into three validated steps (account, about you, workspace) under a step band that restates earlier answers. Use it when one long form would lose people before the workspace is named.
How it differs. A full-width step band sits between header and form: finished steps become buttons that echo their answer, and each step validates before the next set of fields replaces it.
Install
pnpm dlx shadcn@latest add @hazine/sign-up-steppedAdds 2 files, 5 shadcn primitives (button, card, input, label, select), 3 Hazine items (@hazine/heading, @hazine/password-input, @hazine/use-controllable-state), and 1 package (lucide-react).
First time? Add the registry to components.json
{
"registries": {
"@hazine": {
"url": "https://api.hazine.dev/r/{name}.json",
"headers": { "Authorization": "Bearer ${HAZINE_TOKEN}" }
}
}
}Set HAZINE_TOKEN in your environment. The token comes with a Pro licence.
The source of a Pro item is not published on this site. It installs into your codebase with the same command once your registry entry carries a Pro token.
- components/blocks/sign-up-stepped.tsx
- 449 lines
- components/blocks/sign-up-stepped.steps.tsx
- 275 lines
- 2 files
- 724 lines
pnpm dlx shadcn@latest add @hazine/sign-up-steppedAdds 2 files, 5 shadcn primitives (button, card, input, label, select), 3 Hazine items (@hazine/heading, @hazine/password-input, @hazine/use-controllable-state), and 1 package (lucide-react).
Props16
- title
- string = "Set up Marlow for your agency"
- roles
- SignUpOption[] = DEFAULT_ROLES
- teamSizes
- SignUpOption[] = DEFAULT_TEAM_SIZES
- defaultValues
- SignUpValues = DEFAULT_VALUES
- step
- SignUpStepId
- defaultStep
- SignUpStepId = "account"
- onStepChange
- (step: SignUpStepId) => void
- fieldErrors
- SignUpFieldErrors = NO_FIELD_ERRORS
- Field messages from your server. Pass a new object for each response: the form opens the first step that holds one, and a message hides once its field is edited.
- error
- string
- Message for a request that failed as a whole. Announced as an alert above the fields.
- loading
- boolean = false
- True while the request is in flight.
- disabled
- boolean = false
- disabledReason
- string
- Shown under the actions while `disabled` is set.
- onSignUpSubmit
- (values: SignUpValues) => void
- Called with trimmed values once the last step passes validation.
- signInHref
- string = "/sign-in"
- termsHref
- string = "/terms"
- headingLevel
- HeadingLevel = 1
Also accepts every prop of Omit<React.ComponentProps<typeof Card>, "title">.
Accessibility
- Pattern
- Form with labelled fields, Stepper
- Keyboard
Keyboard support for Stepped Sign Up Key Effect Tab Moves through the buttons of opened steps, the fields of the open step, the password visibility toggle, Back (the sign in link on the first step), the continue button and the terms link Enter in a field Validates the open step, then opens the next step. On the last step it validates every step and submits, or opens the first step that fails Enter or Space on a step button Opens that step with its answers intact. Moving forward validates the steps in between first Enter or Space on Back Opens the previous step without validating and moves focus to its heading Enter, Space or Arrow Down on a select Opens the role or team size list. Arrows move, Enter chooses, Escape closes - Screen reader
A navigation list of three steps with aria-current on the open one and a hidden Completed, Not finished or Not started on the others, above a form named by the step heading. Opened steps are buttons, not links, because reopening one changes no address. Changing step moves focus to that heading, which reads Step 2 of 3 before its title. Failed validation moves focus to the first invalid field, opening its step first when that step is not the open one. Request errors arrive in an alert region and the pending request in a status region.
- Announces: Step {n} of {total}, {heading}
- Announces: {field error}
- Announces: {error}
- Announces: Password strength: {word}
- Announces: Creating workspace
- Reduced motion
- The loading icon does not spin. Colour transitions only. The select list animation belongs to the host primitive.
- Checked
- Not checked yet. Automated results appear here once CI has run.
Dependencies9
- button
- card
- input
- label
- select
- @hazine/heading
- @hazine/password-input
- @hazine/use-controllable-state
- lucide-react
Filled chips are registry items the CLI adds for you. Outlined chips are npm packages.
Tokens shipped0
None. The item is styled by the tokens your theme already has.