A form that uses the dynamic nature of JavaScript objects to generate and process forms.
Find a file
Jameson 59f3029a34 Searchable select and per-field placeholders; Next 16.4.6
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
2026-11-18 13:46:11 -06:00
.githooks Install §8 pre-commit hook + .prettierignore + fix stale size-limit 2026-05-29 06:30:20 -06:00
.github/workflows ci: publish to npm on a v* tag, behind the npm environment's approval 2026-10-07 15:53:58 +00:00
.storybook chore: add the AGPL SPDX header to every source file that lacked one 2026-09-30 02:51:15 -06:00
scripts fix: mark every module that calls browser-only hooks 'use client' 2026-09-30 18:26:20 -06:00
src Searchable select and per-field placeholders; Next 16.4.6 2026-11-18 13:46:11 -06:00
tests fix: mark every module that calls browser-only hooks 'use client' 2026-09-30 18:26:20 -06:00
.animation-baseline Add workspace-grade ratchets, upgrade deps (Storybook 10, TS 6, React 19) 2026-05-16 14:10:54 -06:00
.biome-baseline Drive biome 7→0: import type + Number.isNaN 2026-05-16 14:56:51 -06:00
.css-baseline Add workspace-grade ratchets, upgrade deps (Storybook 10, TS 6, React 19) 2026-05-16 14:10:54 -06:00
.depcruise-baseline Drive depcruise 2→0: wire index.ts public API, allow type-only hook→component 2026-05-16 15:01:47 -06:00
.dependency-cruiser.cjs chore: add the AGPL SPDX header to every source file that lacked one 2026-09-30 02:51:15 -06:00
.eslint-warning-baseline Drive ESLint warnings to 0 and type-coverage to 100% 2026-05-29 06:57:37 -06:00
.gitignore build: never leave dist/ empty or half built while compiling 2026-09-30 15:02:20 -06:00
.important-baseline Add workspace-grade ratchets, upgrade deps (Storybook 10, TS 6, React 19) 2026-05-16 14:10:54 -06:00
.js-coverage-baseline Add js-coverage ratchet (TypeScript adoption gate) 2026-05-08 08:34:13 -06:00
.knip-baseline Drive knip 67→0: remove 61 unused deps, ignore 5 deferred 2026-05-16 14:59:24 -06:00
.npmrc Add .npmrc confirm-modules-purge=false for headless installs 2026-05-29 05:48:31 -06:00
.prettierignore build: never leave dist/ empty or half built while compiling 2026-09-30 15:02:20 -06:00
.prettierrc.json Upgrade dependencies (except zod 3); migrate to ESLint flat config 2026-05-08 09:37:25 -06:00
.size-limit.json Install §8 pre-commit hook + .prettierignore + fix stale size-limit 2026-05-29 06:30:20 -06:00
.strict-baseline Drive strict 1→0: refactor DynamicForm for noUncheckedIndexedAccess 2026-05-16 15:49:53 -06:00
.stylelintrc.json Drive eslint 45→0, biome 8→7, prettier formatting 2026-05-16 14:55:15 -06:00
.symmetry-baseline Add 17 missing tests + drive theme spacing 2→0, fix DynamicForm render loop 2026-05-16 15:40:23 -06:00
.test-typecheck-baseline Add workspace-grade ratchets, upgrade deps (Storybook 10, TS 6, React 19) 2026-05-16 14:10:54 -06:00
.theme-baseline Add 17 missing tests + drive theme spacing 2→0, fix DynamicForm render loop 2026-05-16 15:40:23 -06:00
.tsc-error-baseline Ratchet down: tsc errors 10→0, lint warnings 50→45 2026-05-08 08:50:03 -06:00
.type-coverage-baseline fix(a11y): tell assistive tech about field errors, and make radio groups usable 2026-09-30 03:43:23 -06:00
biome.json ESLint/Biome hardening toward workspace §7.4-7.5 + baseline re-seed 2026-05-29 05:48:31 -06:00
CLAUDE.md Point agent docs at the SOP collectives 2026-10-22 19:15:59 -06:00
components.json chore(release)!: package @jgrieve/forms 0.0.1-alpha.1 for npm 2026-09-29 11:10:19 -06:00
eslint.config.mjs build: never leave dist/ empty or half built while compiling 2026-09-30 15:02:20 -06:00
knip.json Drive knip 67→0: remove 61 unused deps, ignore 5 deferred 2026-05-16 14:59:24 -06:00
LICENSE chore(release)!: package @jgrieve/forms 0.0.1-alpha.1 for npm 2026-09-29 11:10:19 -06:00
package.json Searchable select and per-field placeholders; Next 16.4.6 2026-11-18 13:46:11 -06:00
playwright.storybook.config.ts chore: add the AGPL SPDX header to every source file that lacked one 2026-09-30 02:51:15 -06:00
pnpm-lock.yaml Searchable select and per-field placeholders; Next 16.4.6 2026-11-18 13:46:11 -06:00
postcss.config.cjs chore: add the AGPL SPDX header to every source file that lacked one 2026-09-30 02:51:15 -06:00
README.md chore(release)!: package @jgrieve/forms 0.0.1-alpha.1 for npm 2026-09-29 11:10:19 -06:00
tsconfig.compile.json Add workspace-grade ratchets, upgrade deps (Storybook 10, TS 6, React 19) 2026-05-16 14:10:54 -06:00
tsconfig.json chore(deps)!: vitest 5 2026-09-29 10:03:04 -06:00
tsconfig.strict.json Add workspace-grade ratchets, upgrade deps (Storybook 10, TS 6, React 19) 2026-05-16 14:10:54 -06:00
tsconfig.test.json Drive eslint 45→0, biome 8→7, prettier formatting 2026-05-16 14:55:15 -06:00
vitest.config.ts chore: add the AGPL SPDX header to every source file that lacked one 2026-09-30 02:51:15 -06:00

@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