v5.0.0-alpha.8
Pre-release
Pre-release
·
30 commits
to main
since this release
Breaking Changes
Checkbox and radio inputs now nest inside labels (#408)
Checkbox and radio <input> elements are now rendered inside their <label>, following MDN best practice. This eliminates click "blind areas" between inputs and their label text.
The checkboxWrapper and radioWrapper component slots have been removed (16 → 14 slots), as the label now serves as the wrapper.
Before:
<div class="wrapper">
<input type="checkbox" id="agree" />
<label for="agree">I agree</label>
</div>After:
<label>
<input type="checkbox" />
I agree
</label>Field now accepts SmartInput props directly; wrapper props move to fieldProps (#411)
Field accepts type-safe props from the inferred SmartInput slot directly — no children render prop needed for simple cases:
// Before — children render prop just to pass rows:
<Field name="bio" multiline>
{({ SmartInput }) => <SmartInput rows={5} />}
</Field>
// After — rows goes directly on Field:
<Field name="bio" multiline rows={5} />Wrapper customization (e.g. className, style) moves to an explicit fieldProps prop:
<Field name="bio" multiline rows={5} fieldProps={{ className: "wrapper" }} />New peer dependency: @remix-run/form-data-parser (#417)
File upload support introduces a new peer dependency. Install it alongside remix-forms:
pnpm add @remix-run/form-data-parserBumped peer dependencies (#417)
coerce-form-databumped from>=2to>=2.1schema-infobumped from>=0.3.0to>=0.4.1
New Features
- First-class file upload support (#417) —
z.instanceof(File)auto-renders<input type="file">, auto-setsencType="multipart/form-data", validates file size/type on the client, and integrates with@remix-run/form-data-parseron the server via a newuploadHandleroption. NewfileInputcomponent slot andacceptform-level prop. Fieldscomponent (#412) — Automatic field rendering inside custom layouts. Use<Fields />without children for the default layout, or with<Field>children as overrides.renderFormprop (#413) — Customize the default form layout when nochildrenare provided, following the same pattern asrenderField. Also available as a factory option viamakeSchemaForm.renderFieldinmakeSchemaFormoptions (#415) — Set a globalrenderFieldat the factory level; per-formrenderFieldoverrides it.- Auto-render hidden fields with custom children (#416) — Hidden fields declared via
hiddenFieldsare now automatically rendered even when using customchildrenwithout<Fields />. checkboxLabelandradioLabelcomponent slots (#407) — Independent styling of checkbox/radio option labels vs the field-levellabel.- Schema-level
autoCompleteprop (#403) — Per-fieldautoCompleteattribute, same pattern aslabelsandplaceholders. - Field wrapper props inferred from component slot (#409) —
FieldPropsnow infers wrapper props from the resolvedfieldcomponent instead of hardcoding div props.
Bug Fixes
- Fix button
name/valuenot serialized on client-side submit (#404) — Closes #158 - Strip
defaultValue/defaultCheckedfrom user-facing children components (#405) — Closes #168 - Pass
type="hidden"to inputs when Field is hidden (#406) — Closes #227 - Forward all
makeFieldprops to Field with custom children (#410)
What's Changed
- Add schema-level autoComplete prop to SchemaForm by @danielweinmann in #403
- Fix button name/value not serialized on client-side submit by @danielweinmann in #404
- Strip defaultValue/defaultChecked from user-facing children components by @danielweinmann in #405
- Pass type="hidden" to inputs when Field is hidden by @danielweinmann in #406
- Add checkboxLabel and radioLabel component slots by @danielweinmann in #407
- BREAKING: Nest checkbox and radio inputs inside labels by @danielweinmann in #408
- Infer Field wrapper props from the field component slot by @danielweinmann in #409
- Forward all makeField props to Field with custom children by @danielweinmann in #410
- BREAKING: Add inferred props to Field, move wrapper props to fieldProps by @danielweinmann in #411
- Add Fields component for automatic field rendering in custom layouts by @danielweinmann in #412
- Add renderForm prop to SchemaForm by @danielweinmann in #413
- Add renderField to makeSchemaForm options by @danielweinmann in #415
- Auto-render hidden fields with custom children by @danielweinmann in #416
- Add first-class file upload support by @danielweinmann in #417
Full Changelog: v5.0.0-alpha.7...v5.0.0-alpha.8