Form Progress

Counts required fields still empty or invalid and jumps to the next one, so people aren't left wondering why a form won't submit.

StopsForm won't submit, field unknown

Installation

pnpm dlx shadcn@latest add https://bollard-ui.vercel.app/r/form-progress.json

The files land in your project. They're yours to edit.

Usage

form-progress-usage.tsx
import { FormProgress } from "@/components/ui/form-progress"

<FormProgress formRef={formRef} className="sticky top-2 z-10" />

What it catches

  • Required fields left empty
  • Fields failing native validation (pattern, minlength and similar)
  • Fields off-screen, by jumping to them

Props

FormProgress props
PropTypeDefault
formRef* (required)

The form to watch.

React.RefObject<HTMLFormElement | null>—
nextLabel

Button text.

string"Next missing"
doneLabel

Shown once every required field is valid.

string"All required fields done"
labels

Override any other string.

Partial<typeof FORM_PROGRESS_LABELS>—

* required. Also accepts the native props of <div> (className, aria-*, data-*…), passed through to it.

Accessibility

  • Field names come from their <label> (or aria-label/name)
  • Next missing moves focus to the field
  • Updates when required, disabled, hidden or inert attributes change

Only what the source does. Test with your own screen reader and content before shipping.

Limitations

  • Relies on native required and constraint validation; custom validation isn't seen
  • Skips disabled, hidden and inert fields

What it stops

Form won't submit, field unknown

Also known as

required fields · form progress · progress bar · validation · next missing · kyc form · application form · react hook form

Dependencies

Pairs well with