Step form
A React block (a whole screen) in Beamline's Shop app.
The finished frame for any multi-step form you compose — onboarding, intake brief, questionnaire, booking, application: a wide card with progress, the step's title and your fields, one accent Continue; a side panel with the steps and the answers so far (each with Edit); an automatic review step, sending and done.
Use it for
- Any form of more than one screen you compose from fields: onboarding, client intake briefs, questionnaires, bookings, applications. You write each step's fields with the right elements; the block gives the finished layout, progress, the answers panel, review, errors, sending and done. It is the form element itself: keep the answers in useState and check each step in its validate; the form package is not needed.
Not for
- Account creation (signup-form) or sign-in (sign-in, auth).
- Account settings (settings).
- A short one-screen form (form inside a card or dialog).
- Showing progress of work that is not a form (stepper, plan).
Anatomy
- root (container-sized: two columns from about 900 px, one below)
- card: progress line (step N of M and a thin bar), then the step tray (step title, description, fields) whose height follows the step
- fields: your elements for the step, in a native form so Enter continues
- error: the validate message above the actions; it grows in, so the actions glide down
- actions: Back (ghost) and Continue / Submit (accent, keeps its size while sending)
- aside: the steps as a vertical stepper (done steps reopen), then Your answers grouped by step with Edit (stepping aside on the review step)
- review step: every answer grouped by step, two abreast in a wide card, each group with Edit; Submit sends
- done: a check, your title and message, and your action
States
- a step in progress
- step refused by validate (message shown, first invalid field focused)
- checking (async validate: Continue shows its loader)
- review
- sending (Submit loading, everything else inert)
- send failed (the rejection's message above the actions, the answers kept)
- done
Keyboard
- Enter in a field continues (the step is a form)
- Tab reaches the fields, Back and Continue, then the aside's done steps and Edit links
- a refused step moves focus to its first field marked aria-invalid, else to the message
- a new step moves focus to its title
Motion
The step tray keeps the card's path: its height eases from the old step to the new over the morph duration, so the actions glide to their place, while the new step arrives on --pui-motion-in (fade and a 6 px rise from the side it comes from); a refusal grows in above the actions; the progress bar fills over --pui-motion-out; answers in the aside appear with a fade. Done, the check draws itself once. Reduced motion keeps the fades only and changes heights at once. Nothing moves at rest.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
steps (required) | StepFormStep[] | — | Form steps with their fields and validation. Required. |
onSubmit (required) | () => Promise<void> | — | Send the answers you hold in your own state. Reject with an Error: its message shows above the actions. |
summary | StepFormAnswer[] | — | The answers so far, for the aside and the review step. Without it there is no answers panel. |
review | boolean | true when summary is given | Adds a review step before sending. Default: on when `summary` is given. |
aside | ReactNode | — | More in the side panel under the answers: what happens next, a contact. |
done | { title, description?, action? } | — | What the finished state says and offers. |
step / defaultStep / onStepChange | number / number / (index: number) => void | — | step: The step in view (the review step is steps.length), controlled or not. defaultStep: Initial active step when uncontrolled. Defaults to 0. onStepChange: Reports active step after a change; no callback by default. |
labels | { continue?, back?, submit?, review?, answers?, notAnswered?, edit? } | — | Action, review and progress text overrides; defaults to the built-in English labels. |
step | number | — | The step in view (the review step is steps.length), controlled or not. |
defaultStep | number | — | Initial active step when uncontrolled. Defaults to 0. |
onStepChange | ((index: number) => void) | — | Reports active step after a change; no callback by default. |
headingLevel | 1 | 2 | 3 | — | The heading level of the step titles. Default 2. |
className | string | — | Classes on the documented visual root; no override by default. |
classNames | Partial<Record<"root" | "heading" | "description" | "error" | "actions" | "answers" | "… | — | Classes for the named visual parts; no part overrides by default. |
style | CSSProperties | — | Inline styles on the documented visual root; no inline overrides by default. |
ref | Ref<HTMLDivElement> | — | Receives the documented root element; no ref by default. |
Built from
- stepper
- button
- alert
- badge
Dependencies
lucide-react
Import
import { StepForm } from "@beamline/step-form";
Get it
Step form is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Get Beamline · Connect your agent
More in Shop
- Product editor: A product being made in a shop's back office, every value read as text at rest. The variant grid, grouped by the first option, lists each combination…
- Category manager: A shop's product categories, nested and ranked. Each category moves up, down or into another from its menu, and every move gets its own receipt (saving…
- Inventory item: One stock item in a shop's back office, apart from the variants that sell it (how many each uses per unit). Stock per location as stocked, reserved and…
- Plan comparison: Plans side by side against every feature: prices that roll between monthly and yearly, the current and recommended plan marked, a header that stays in…
- Orders admin: A shop's order desk: today's orders and revenue, quick filters for what needs doing (to fulfil, unpaid, returns), a virtualised orders grid, and the…
- Order detail: One shop order with payment and fulfilment as two separate lanes. The header says where each stands (paid, partly paid, awaiting, refunded; not…
- Order board: A shop's orders as cards in its columns, on the shared kanban with drag and keyboard moves. Each card: number, estimate or work order, customer, vehicle…
- Order composer: An order made inside a support ticket: products found by name, each variant with its stock drawn and said (in stock, none, oversold, not known) and the…
- Draft orders: A draft order made for a customer in a shop's back office that reads like the order it will become. The lines lead: each with its variant and SKU or…
- Order changes: What happens to a shop order after it's placed. Edit: the order as it stands beside the requested version, each line marked new, changed (old → new…
- Special orders: Customers' special orders as demand to buy for, per outlet: To order apart from Ordered; each product's demand, what is reserved, incoming and on order…
- Order history and fills: Every order the account placed and every fill it got, for a period: totals for volume, fees, fill rate and maker share; orders with their status and how…
- Order ledger: Purchase orders as money. Each order's spend is drawn against its approved total (paid, billed, pending, what is left, and any overrun past the end…
- Ticket orders: A customer's orders inside a support ticket, each action's effect said before it's done: orders and drafts kept apart, a paid draft shown once as its…
- Record search: One search across connected records (customers, vehicles, orders) by name, phone, plate, VIN or order number. What the words look like is said (info)…
- Return queue: A queue of return cases. Search by return, order or customer, exactly (the default) or loosely; status tabs with counts, Requires attention first; a date…
- Return case: One return as one place where every act is its own. The return, its order (linked out) and the customer on three cards; the stage said on its tone. Items…
- Return request: Staff start a return from an order, and edit the reasons customers pick. New return: the order's lines as a checklist, each with its variant, price and…
- Purchase orders: A salon's purchase orders, received: the orders down the side, the chosen one beside them. Each line still due reads as a strip of received, this…
- Print quote: A print shop's quoting in three places. Quote: a group of garments that share one imprint and one quantity break, the group's pieces counted together and…
- Service estimate: An estimate for one vehicle. Services added from the catalogue (one not listed for this vehicle said on warning, fit unknown said); each with its lines…
- Job card: A technician's repair order, phone-first. The vehicle, the customer and when it's due in words (due at, due in, overdue by how long); an offline copy…
- Parts tracker: Parts across a shop's work orders: each with its number, the order and vehicle, supplier, quantity and cost (not known said), and where it is: ordered…
- Visit board: The staff board for a walk-in queue: visits move from waiting through called and serving to done today. Arrival (here or on the way), the place in the…