Split Signup Form Hero
ProHero with a headline, three checkmarked benefits and trial facts beside a card that holds a working signup form: work email, company size and submit. Use when the page goal is a trial or demo signup.
How it differs. The media half is a working form card: two labelled fields validate inline, and a valid submit swaps the form for a confirmation that echoes the address and the chosen size.
Install
pnpm dlx shadcn@latest add @hazine/hero-split-signup-formAdds 1 file, 5 shadcn primitives (button, card, input, label, select), 2 Hazine items (@hazine/heading, @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/hero-split-signup-form.tsx
- 433 lines
- 1 file
- 433 lines
pnpm dlx shadcn@latest add @hazine/hero-split-signup-formAdds 1 file, 5 shadcn primitives (button, card, input, label, select), 2 Hazine items (@hazine/heading, @hazine/use-controllable-state), and 1 package (lucide-react).
Props16
- title
- string = "Staff every warehouse shift from one rota"
- benefits
- SignupBenefit[] = DEFAULT_BENEFITS
- sizes
- CompanySize[] = DEFAULT_SIZES
- blockedDomains
- string[] = DEFAULT_BLOCKED_DOMAINS
- Mail domains refused as personal addresses, lowercase. Pass an empty array to accept any address.
- defaultValues
- SignupValues = DEFAULT_VALUES
- fieldErrors
- SignupFieldErrors = NO_FIELD_ERRORS
- Field messages from your server. Pass a new object for each response: a field's message hides once that 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 submit button while `disabled` is set.
- submitted
- boolean
- Confirmation state. Leave it out and a valid submit confirms at once. Pass it to hold the form until your request resolves.
- defaultSubmitted
- boolean = false
- onSubmittedChange
- (submitted: boolean) => void
- Called with `false` when the visitor returns to the form, and with `true` on a valid submit when `submitted` is not passed.
- onSignupSubmit
- (values: SignupValues) => void
- Called with trimmed values once they pass validation.
- privacyHref
- string = "/privacy"
- headingLevel
- HeadingLevel = 1
Also accepts every prop of Omit<React.ComponentProps<"section">, "title">.
Accessibility
- Pattern
- Form with labelled fields, Landmarks and headings
- Keyboard
Keyboard support for Split Signup Form Hero Key Effect Tab Moves through work email, company size, submit and the privacy link. After a valid submit: Use a different email, then the privacy link Enter in the email field, Enter or Space on submit Submits the form. With errors, focus moves to the first invalid field. When valid, focus moves to the confirmation heading Enter, Space or Arrow Down on company size Opens the list of sizes Arrow Up, Arrow Down, Home, End Moves through the open list. Typing a character jumps to a matching size Enter or Space in the list Chooses the size, closes the list and returns focus to the trigger Escape Closes the list without changing the size Enter or Space on Use a different email Returns to the form with the values kept and moves focus to the email field - Screen reader
Section labelled by its heading. The form is named by the card heading, each field has a label, and errors are wired by aria-describedby with aria-invalid. A failed request is an alert that returns focus to submit, and the confirmation sits in a status region.
- Announces: We sent a setup link to {email}. It expires in 24 hours.
- Announces: {error}
- Reduced motion
- The loading icon does not spin. Colour transitions only.
- Checked
- Not checked yet. Automated results appear here once CI has run.
Dependencies8
- button
- card
- input
- label
- select
- @hazine/heading
- @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.