Skip to content
SuprakasPublic

About

Accessible form builder in React: add and reorder fields, live validation preview, JSON export, plus a keyboard-friendly component kit (modal, tabs, toast).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

FormForge

Accessible components, and a form builder made from them. A small UI kit (Button, TextField, Modal, Tabs, Toast) written from scratch with no UI library, plus a form builder that uses those same components.

Live demo: https://form-forge-three.vercel.app

Form builder with validation errors

Features

Form builder

  • Add text, email, number and dropdown fields
  • Edit each field's label, options, min/max and whether it's required
  • Reorder fields (↑ / ↓) or delete them
  • Live preview: a real, working form with validation (required, email format, number range)
  • On a failed submit, focus jumps to the first invalid field and a toast says how many to fix
  • Export the form as JSON; your form is saved in the browser and survives a refresh

UI kit (Components tab)

Component Accessibility details
Button Defaults to type="button" so it never submits a form by accident
TextField <label for>, aria-invalid, aria-describedby linking the hint or error
Modal role="dialog", focus trap, Esc and backdrop close, focus returned to the opener, rendered in a portal
Tabs WAI-ARIA tabs pattern: roving tabindex, ← / → / Home / End
Toast aria-live region, auto-dismiss after 4 s, timers cleaned up

Component gallery

Tech stack

React 19 · CSS Modules · Vite · Vitest + React Testing Library · no UI library

Getting started

npm install
npm run dev     # http://localhost:5173
npm test        # 8 tests: validation, reducer, Modal keyboard, Tabs keyboard
npm run build

Project structure

src/
  components/   Button, TextField, Modal, Tabs, Toast (+ .module.css each)
  hooks/        useFocusTrap, useStoredReducer (useReducer + localStorage)
  builder/      Builder, FieldEditor, FormPreview, fields, validate, fieldsReducer
  gallery/      Gallery (the Components tab)
tests/          validate, fieldsReducer, Modal (keyboard), Tabs (keyboard)

Deploy (Vercel)

Import the repo on vercel.com → framework preset Vite → Deploy. No config needed: it's a single page with no routes.


Built by Suprakash Ballav.

About

Accessible form builder in React: add and reorder fields, live validation preview, JSON export, plus a keyboard-friendly component kit (modal, tabs, toast).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages