A form that uses the dynamic nature of JavaScript objects to generate and process forms.
A field can now be a searchable select (`searchable`), for long lists such as timezones: an ARIA combobox whose text box filters a listbox, with Up/Down, Enter and Escape, and no new dependencies. A field can also set its own `placeholder`, so an empty select says something better than "Select an option". Both are opt-in; existing forms are unchanged. The field wrapper's vertical margin moves to the form's gap, so forms space their fields evenly. next and eslint-config-next go to ^16.4.6, past the security advisory on 16.4.3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BLgGinkLq2xcVoDyfVkbdD |
||
|---|---|---|
| .githooks | ||
| .github/workflows | ||
| .storybook | ||
| scripts | ||
| src | ||
| tests | ||
| .animation-baseline | ||
| .biome-baseline | ||
| .css-baseline | ||
| .depcruise-baseline | ||
| .dependency-cruiser.cjs | ||
| .eslint-warning-baseline | ||
| .gitignore | ||
| .important-baseline | ||
| .js-coverage-baseline | ||
| .knip-baseline | ||
| .npmrc | ||
| .prettierignore | ||
| .prettierrc.json | ||
| .size-limit.json | ||
| .strict-baseline | ||
| .stylelintrc.json | ||
| .symmetry-baseline | ||
| .test-typecheck-baseline | ||
| .theme-baseline | ||
| .tsc-error-baseline | ||
| .type-coverage-baseline | ||
| biome.json | ||
| CLAUDE.md | ||
| components.json | ||
| eslint.config.mjs | ||
| knip.json | ||
| LICENSE | ||
| package.json | ||
| playwright.storybook.config.ts | ||
| pnpm-lock.yaml | ||
| postcss.config.cjs | ||
| README.md | ||
| tsconfig.compile.json | ||
| tsconfig.json | ||
| tsconfig.strict.json | ||
| tsconfig.test.json | ||
| vitest.config.ts | ||
@jgrieve/forms
Schema-driven forms for React 19, plus the shadcn-style UI primitives they are built from.
Install
pnpm add @jgrieve/forms react react-dom
react and react-dom are peer dependencies. The components are styled with Tailwind CSS 4 utility classes and ship no stylesheet of their own, so add the package to your Tailwind sources:
@import 'tailwindcss';
@source '../node_modules/@jgrieve/forms/dist';
Usage
import { DynamicForm } from '@jgrieve/forms';
<DynamicForm
fields={{
email: { type: 'text', display: 'E-Mail', value: '' },
password: { type: 'password', display: 'Password', value: '' },
}}
onConfirm={(values) => console.warn(values)}
/>;
| Layer | Exports |
|---|---|
| Form | DynamicForm |
| Field | Field (label, error and layout; dispatches on type) |
| Primitive | TextField, PasswordField, SelectField, RadioField, CheckField |
UI primitives and hooks are importable by path, e.g. @jgrieve/forms/components/ui/button and @jgrieve/forms/hooks/useToast.
The package is ESM, compiled for bundlers (Next.js, Vite).
License
AGPL-3.0-or-later