Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Enrolment Steps Contact Block for React

An enrolment request for a day school in four steps: the student, the programme, the parent and a review where every answer has an Edit button.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

An enrolment section for React with Base UI, laid out as a start-aligned header over a frame with a hairline band of admissions details under it. Inside the frame, a rail lists four steps (the student, the programme, the parent, a review) beside the open step's panel, and Back and Next sit on a band at the panel's foot. The student has a name, a grade in a Select and a date of birth typed into a month, day and year field; the programme has up to three interests as pressed chips and an entry term in a Segment Group; the parent has a name, an email and a phone number. The review lists every answer in three groups, each with its own Edit button that reopens that step. Each step checks its fields before Next, shows each problem under its field and moves focus to the first one; sending turns the frame into a confirmation in the same space, which takes focus. The rails and top rule come from the Guides spine, so the block lines up with its neighbours in a stack. It's built from Steps, Frame, Field, Input, Select, Date Input, Toggle Group, Segment Group, Guides, Shine Button and Button, with CSS transitions for the entrances and your theme's tokens for every colour. For schools, colleges, nurseries and any place that takes applications in a few short stages.

FAQ

Where does the form send its data?

Nowhere yet. The submit handler waits 800 milliseconds, as a stand-in for a request, then shows the confirmation. Replace that timer in submit with a call to your admissions inbox or student information system: details holds the student's name, grade and date of birth, the interests, the entry term and the parent's name, email and phone. Show the confirmation when the request succeeds, and an error line in the form when it doesn't. The confirmation says only what the visitor sent; the reply time is the school's to publish.

How do the steps work, and can a visitor go back?

Next checks the current step and opens the next one; an answer never advances on its own, so arrow keys can't skip a question. The rail's steps past the furthest one reached are unavailable until Next gets there, and any step already reached can be reopened from the rail, with Back, or from the review's Edit buttons. Whatever you typed stays. The panels keep one height (an unseen copy of all four sets it), so moving between steps never moves what is below. After a click, Next, Back or Edit, focus goes to the new step's heading and a polite status line says "Step 2 of 4"; nothing moves focus on load. Up and Down move along the rail.

What does each step check?

The form has noValidate, so the block shows its own messages. Step one needs both names, a grade and a complete date of birth: the date must not be in the future and must give an age of about 10 to 19 (grades 6 to 12), measured against today when the visitor presses Next. Step two needs at least one interest. Step three needs the parent's name, an email with an @ and a domain, and a phone number of 7 to 15 digits. A problem appears under its field, the control gets aria-invalid and a description that points to it, and focus moves to the first one; sending from the review re-checks every step and reopens the first that fails. Typing clears a message, and leaving a filled field checks it.

How does the date of birth field work?

It is the catalog Date Input: three segments (month, day, year) you type into or step with the arrow keys, with no calendar to open. It is the same Ark-built control on every base, so it behaves identically everywhere. The value is read once all three segments are filled; until then the step reports "Enter the date of birth". Going Back to the student keeps what was typed.

How are the grade select and the interest chips labelled?

The label above the grade select names its button for screen readers, and focus lands on that button when the grade is missing. The select's trigger takes the id, and the label points to it with htmlFor. The interests are a multiple Toggle Group of pressed buttons. The chips allow three: a fourth press is ignored, and the line under them counts "3 of 3 chosen" and says to unpick one first.

How does it fit on a phone?

Below lg the rail sits above the panel as a compact list that shows only each step's name (the one-line descriptions and the "have to hand" note appear from lg). The first and last names, the grade and date, the parent's email and phone go one per row below sm, and the entry term fills the width. The admissions details stack one per row. The email address wraps rather than scrolling, so nothing scrolls sideways at 320 pixels. The header and the frame fade up once on load; with reduced motion they simply appear. The email, phone and hours are fictional (.example is a reserved domain, 555-0100 to 0199 a reserved range): replace EMAIL, PHONE, PHONE_HREF and HOURS at the top of the file.

  • Pro

    A centered signup hero whose form is a three-step wizard in a card in card, account, plan and payment, that checks each step's fields before the next and ends on a confirmation.

  • Pro

    Order Lookup Contact

    Support and feedback

    An order desk that looks the order up first: a number and email, a read-only timeline with dates counted from today, then a help form that wakes once an order is found.

  • Pro

    A restaurant reservation in a card in card: a party size stepper, a date picker that closes Mondays and past days, five sittings as choices and a form that checks itself and confirms in place.

  • Pro

    A place request for a day nursery in a card in card: a birthday in a segmented date field names the room the child belongs in, and five day toggles price the week at example rates.

  • Pro

    A talk-to-sales split for a scheduling platform: what happens next as three numbered steps and a band of contact details beside a form that checks itself, shows each problem under its field and confirms in place.

  • Pro

    An adoption application that starts with four animal cells on shared hairlines and a slider for the hours a home is empty, with a list of the animals that suit you narrowing beside the form.