Skip to content

feat: add ui layout field, custom field types, and defineField helpers - #153

Merged
ladparth merged 11 commits into
mainfrom
feat/ui-field-custom-types
Jun 2, 2026
Merged

feat: add ui layout field, custom field types, and defineField helpers#153
ladparth merged 11 commits into
mainfrom
feat/ui-field-custom-types

Conversation

@ladparth

@ladparth ladparth commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Description

This PR introduces the new ui layout field, implements support for custom/unregistered fields in both the core compiler and React renderer, provides helper functions (defineField / defineFields) for type safety outside defineSchema, documents these new layouts/unregistered field types, and compiles shadcn registry json assets. It also resolves Next.js build compilation and linting errors on the documentation site.

Key Changes

Core (form-core)

  • UI Layout Field (UiField): Added support for inline HTML/React markup layouts via the ui field type, including isLayoutField type guard updates.
  • Custom / Unregistered Fields: Extended type definitions (FieldInput, CustomFieldInput) to allow unregistered field types to bypass strict union types and fallback to unknown in InferType without compilation errors.
  • Type Narrowing Helpers: Added defineField and defineFields identity functions for modular and type-safe schema splitting.
  • FormSchema: Updated fields property from readonly Field[] to readonly FieldInput[] to natively support custom fields.
  • Unit Testing: Added define-helpers.test.ts and updated schema validator, field meta, and type inference test suites.

React Adapter (form-react)

  • UI Layout Support: Wired up UiField layout rendering within the headless form rendering stack.
  • Exports: Exported type narrowing helpers (defineField, defineFields) and input schema types (FieldInput, CustomFieldInput).

Docs / Web (apps/web)

  • Registry Components: Implemented the ui layout field renderer inside the shadcn registry component set (apps/web/registry/shadcn/fields/ui.tsx).
  • Examples: Created a new "Theme Builder" form example (ui-and-custom-fields-form.tsx) showcasing both the ui markup layout field and unregistered custom components.
  • Compiled Assets: Re-compiled shadcn registry metadata and JSON distributions (all.json, registry.json, ui-and-custom-fields-form.json, ui.json).
  • Documentation: Documented custom fields and UI layout components inside custom-fields.mdx and a new ui.mdx file.
  • Compilation & Linting Fixes:
    • Removed unused first-form-demos.tsx and fixed a TypeScript mismatch inside form-manager-saved-panel.tsx by casting document.fields.
    • Escaped the apostrophe in ui-and-custom-fields-form.tsx description to satisfy the react/no-unescaped-entities rule, and regenerated the compiled registry JSON schemas.

Type of change

  • feat (New feature)
  • fix (Bug fix)
  • docs (Documentation changes)
  • refactor (Refactoring code without changing behavior)

Related Issues

@vercel

vercel Bot commented Jun 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
buzzform Ready Ready Preview, Comment Jun 2, 2026 11:25pm

@ladparth ladparth changed the title feat: introduce defineField helpers and document custom layout types feat: add ui layout field, custom field types, and defineField helpers Jun 2, 2026
@ladparth
ladparth merged commit 05dde69 into main Jun 2, 2026
3 checks passed
@ladparth
ladparth deleted the feat/ui-field-custom-types branch June 2, 2026 23:27
@github-actions github-actions Bot mentioned this pull request Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Add a markup field to allow adding custom markup and React elements between the form fields

1 participant