Forms

Form workflow.

Validation, pending state and recoverable saves around your own service.

LIVE PREVIEWTry it. It works.

Install the source

Terminal
npx shadcn@latest add https://ui.bld8.dev/r/form.json

Registry setup · Examples · API and behavior · Open the playground

COMPLETE EXAMPLES

Use it in context.

Each example includes its imports, data and state. The preview runs that same source. Include the stylesheet once in your application.

Validate a small local workflow

The form adapter owns draft state and feedback; the supplied submit callback keeps the result in memory.

Loads this example when you need it.

Keyboard

  • Submit focuses the first invalid named field.
  • Native input editing and clipboard commands remain available.

States covered

  • Pristine
  • Dirty
  • Invalid
  • Saved

Install this complete example and its component dependencies.

Terminal
npx shadcn@latest add https://ui.bld8.dev/r/example-basic-form.json
Complete source
React / TypeScript
/*!
MIT License

Copyright (c) 2026 Jaison

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
'use client';
import {useState} from 'react';
import {Button,Field,Form,FormErrorSummary,Input,useForm} from '@bld8/ui';
import '@bld8/ui/styles.css';
export default function FormExample(){const [result,setResult]=useState('');const form=useForm({initialValues:{name:''},validate:values=>({name:values.name.trim()?undefined:'Enter an example project name.'}),onSubmit:async(values,{signal})=>{if(signal.aborted)return;setResult(values.name);}});return <Form form={form}><FormErrorSummary error={form.error} errors={form.errors}/><Field label="Example project name" error={form.errors.name}><Input name="name" value={form.values.name} onChange={event=>form.setField('name',event.target.value)}/></Field><Button type="submit" loading={form.pending}>Save local form example</Button><p role="status">{result?'Local result: '+result:''}</p></Form>;}

Quick reference

React / TypeScript
const form = useForm({
  initialValues: {name: ""},
  validate: values => ({name: values.name ? undefined : "Enter a name."}),
  onSubmit: (values, {signal}) => saveWorkspace(values, signal)
});
<Form form={form}>
  <Field label="Name" error={form.errors.name}>
    <Input name="name" value={form.values.name}
      onChange={event => form.setField("name", event.target.value)} />
  </Field>
  <Button type="submit" loading={form.pending}>Save</Button>
</Form>

In the workspace or ZIP starter, import components from @bld8/ui and include @bld8/ui/styles.css once. Registry installations use your local bld8/ source path. Wrap overlays in UIProvider.

API & behaviour

useForm accepts synchronous or async validation, an abortable submission callback and onSuccess. Return fieldErrors/error for service validation, or normalised values on success. It prevents duplicate submissions, rejects stale completions, tracks dirty/saved state and focuses the first invalid named field. FormErrorSummary shows a service error; use Field for per-field messages. useUnsavedChanges adds a browser leave warning; in-app dismissal confirmation belongs to your composition. Values should be serialisable. Changing initialValues does not reset a mounted form; call reset explicitly.

Form

Form public properties
PropTypeDefault
formRequired{ values: T; errors: Partial<Record<keyof T, string>>; error: string; pending: boolean; saved: boolean; dirty: boolean; setField: <K extends keyof T>(key: K, value: T[K]) => void; reset: (next?: T) => void; submit: (event?: FormEvent) => Promise<boolean>; formRef: RefObject<HTMLFormElement | null>; }—
Forwarded React / HTML props 286
Form native public properties
PropTypeDefault
aboutstring | undefined—
acceptCharsetstring | undefined—
accessKeystring | undefined—
actionstring | ((formData: FormData) => void | Promise<void>) | undefined—
aria-activedescendantstring | undefined

Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.

—
aria-atomicBooleanish | undefined

Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute.

—
aria-autocomplete"none" | "list" | "inline" | "both" | undefined

Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be presented if they are made.

—
aria-braillelabelstring | undefined

Defines a string value that labels the current element, which is intended to be converted into Braille.

—
aria-brailleroledescriptionstring | undefined

Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille.

—
aria-busyBooleanish | undefined—
aria-checkedboolean | "true" | "false" | "mixed" | undefined

Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.

—
aria-colcountnumber | undefined

Defines the total number of columns in a table, grid, or treegrid.

—
aria-colindexnumber | undefined

Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.

—
aria-colindextextstring | undefined

Defines a human readable text alternative of aria-colindex.

—
aria-colspannumber | undefined

Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.

—
aria-controlsstring | undefined

Identifies the element (or elements) whose contents or presence are controlled by the current element.

—
aria-currentboolean | "true" | "false" | "page" | "step" | "location" | "date" | "time" | undefined

Indicates the element that represents the current item within a container or set of related elements.

—
aria-describedbystring | undefined

Identifies the element (or elements) that describes the object.

—
aria-descriptionstring | undefined

Defines a string value that describes or annotates the current element.

—
aria-detailsstring | undefined

Identifies the element that provides a detailed, extended description for the object.

—
aria-disabledBooleanish | undefined

Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.

—
aria-dropeffect"none" | "link" | "copy" | "execute" | "move" | "popup" | undefined

Indicates what functions can be performed when a dragged object is released on the drop target.

—
aria-errormessagestring | undefined

Identifies the element that provides an error message for the object.

—
aria-expandedBooleanish | undefined

Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.

—
aria-flowtostring | undefined

Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion, allows assistive technology to override the general default of reading in document source order.

—
aria-grabbedBooleanish | undefined

Indicates an element's "grabbed" state in a drag-and-drop operation.

—
aria-haspopupboolean | "true" | "false" | "dialog" | "grid" | "listbox" | "menu" | "tree" | undefined

Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.

—
aria-hiddenBooleanish | undefined

Indicates whether the element is exposed to an accessibility API.

—
aria-invalidboolean | "true" | "false" | "grammar" | "spelling" | undefined

Indicates the entered value does not conform to the format expected by the application.

—
aria-keyshortcutsstring | undefined

Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.

—
aria-labelstring | undefined

Defines a string value that labels the current element.

—
aria-labelledbystring | undefined

Identifies the element (or elements) that labels the current element.

—
aria-levelnumber | undefined

Defines the hierarchical level of an element within a structure.

—
aria-live"off" | "assertive" | "polite" | undefined

Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.

—
aria-modalBooleanish | undefined

Indicates whether an element is modal when displayed.

—
aria-multilineBooleanish | undefined

Indicates whether a text box accepts multiple lines of input or only a single line.

—
aria-multiselectableBooleanish | undefined

Indicates that the user may select more than one item from the current selectable descendants.

—
aria-orientation"horizontal" | "vertical" | undefined

Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous.

—
aria-ownsstring | undefined

Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship between DOM elements where the DOM hierarchy cannot be used to represent the relationship.

—
aria-placeholderstring | undefined

Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. A hint could be a sample value or a brief description of the expected format.

—
aria-posinsetnumber | undefined

Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.

—
aria-pressedboolean | "true" | "false" | "mixed" | undefined

Indicates the current "pressed" state of toggle buttons.

—
aria-readonlyBooleanish | undefined

Indicates that the element is not editable, but is otherwise operable.

—
aria-relevant"text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined

Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.

—
aria-requiredBooleanish | undefined

Indicates that user input is required on the element before a form may be submitted.

—
aria-roledescriptionstring | undefined

Defines a human-readable, author-localized description for the role of an element.

—
aria-rowcountnumber | undefined

Defines the total number of rows in a table, grid, or treegrid.

—
aria-rowindexnumber | undefined

Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.

—
aria-rowindextextstring | undefined

Defines a human readable text alternative of aria-rowindex.

—
aria-rowspannumber | undefined

Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.

—
aria-selectedBooleanish | undefined

Indicates the current "selected" state of various widgets.

—
aria-setsizenumber | undefined

Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.

—
aria-sort"none" | "ascending" | "descending" | "other" | undefined

Indicates if items in a table or grid are sorted in ascending or descending order.

—
aria-valuemaxnumber | undefined

Defines the maximum allowed value for a range widget.

—
aria-valueminnumber | undefined

Defines the minimum allowed value for a range widget.

—
aria-valuenownumber | undefined

Defines the current value for a range widget.

—
aria-valuetextstring | undefined

Defines the human readable text alternative of aria-valuenow for a range widget.

—
autoCapitalize"off" | "none" | "on" | "sentences" | "words" | "characters" | (string & {}) | undefined—
autoCompletestring | undefined—
autoCorrectstring | undefined—
autoFocusboolean | undefined—
autoSavestring | undefined—
childrenReactNode—
classNamestring | undefined—
colorstring | undefined—
contentstring | undefined—
contentEditableBooleanish | "inherit" | "plaintext-only" | undefined—
contextMenustring | undefined—
dangerouslySetInnerHTML{ __html: string | TrustedHTML; } | undefined—
datatypestring | undefined—
defaultCheckedboolean | undefined—
defaultValuestring | number | readonly string[] | undefined—
dirstring | undefined—
draggableBooleanish | undefined—
encTypestring | undefined—
enterKeyHint"enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined—
exportpartsstring | undefined—
hiddenboolean | undefined—
idstring | undefined—
inertboolean | undefined—
inlistany—
inputMode"none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined

Hints at the type of data that might be entered by the user while editing the element or its contents

—
isstring | undefined

Specify that a standard HTML element should behave like a defined custom built-in element

—
itemIDstring | undefined—
itemPropstring | undefined—
itemRefstring | undefined—
itemScopeboolean | undefined—
itemTypestring | undefined—
keyKey | null | undefined—
langstring | undefined—
methodstring | undefined—
namestring | undefined—
noncestring | undefined—
noValidateboolean | undefined—
onAbortReactEventHandler<HTMLFormElement> | undefined—
onAbortCaptureReactEventHandler<HTMLFormElement> | undefined—
onAnimationEndAnimationEventHandler<HTMLFormElement> | undefined—
onAnimationEndCaptureAnimationEventHandler<HTMLFormElement> | undefined—
onAnimationIterationAnimationEventHandler<HTMLFormElement> | undefined—
onAnimationIterationCaptureAnimationEventHandler<HTMLFormElement> | undefined—
onAnimationStartAnimationEventHandler<HTMLFormElement> | undefined—
onAnimationStartCaptureAnimationEventHandler<HTMLFormElement> | undefined—
onAuxClickMouseEventHandler<HTMLFormElement> | undefined—
onAuxClickCaptureMouseEventHandler<HTMLFormElement> | undefined—
onBeforeInputInputEventHandler<HTMLFormElement> | undefined—
onBeforeInputCaptureInputEventHandler<HTMLFormElement> | undefined—
onBeforeToggleToggleEventHandler<HTMLFormElement> | undefined—
onBlurFocusEventHandler<HTMLFormElement> | undefined—
onBlurCaptureFocusEventHandler<HTMLFormElement> | undefined—
onCanPlayReactEventHandler<HTMLFormElement> | undefined—
onCanPlayCaptureReactEventHandler<HTMLFormElement> | undefined—
onCanPlayThroughReactEventHandler<HTMLFormElement> | undefined—
onCanPlayThroughCaptureReactEventHandler<HTMLFormElement> | undefined—
onChangeChangeEventHandler<HTMLFormElement, Element> | undefined—
onChangeCaptureChangeEventHandler<HTMLFormElement, Element> | undefined—
onClickMouseEventHandler<HTMLFormElement> | undefined—
onClickCaptureMouseEventHandler<HTMLFormElement> | undefined—
onCompositionEndCompositionEventHandler<HTMLFormElement> | undefined—
onCompositionEndCaptureCompositionEventHandler<HTMLFormElement> | undefined—
onCompositionStartCompositionEventHandler<HTMLFormElement> | undefined—
onCompositionStartCaptureCompositionEventHandler<HTMLFormElement> | undefined—
onCompositionUpdateCompositionEventHandler<HTMLFormElement> | undefined—
onCompositionUpdateCaptureCompositionEventHandler<HTMLFormElement> | undefined—
onContextMenuMouseEventHandler<HTMLFormElement> | undefined—
onContextMenuCaptureMouseEventHandler<HTMLFormElement> | undefined—
onCopyClipboardEventHandler<HTMLFormElement> | undefined—
onCopyCaptureClipboardEventHandler<HTMLFormElement> | undefined—
onCutClipboardEventHandler<HTMLFormElement> | undefined—
onCutCaptureClipboardEventHandler<HTMLFormElement> | undefined—
onDoubleClickMouseEventHandler<HTMLFormElement> | undefined—
onDoubleClickCaptureMouseEventHandler<HTMLFormElement> | undefined—
onDragDragEventHandler<HTMLFormElement> | undefined—
onDragCaptureDragEventHandler<HTMLFormElement> | undefined—
onDragEndDragEventHandler<HTMLFormElement> | undefined—
onDragEndCaptureDragEventHandler<HTMLFormElement> | undefined—
onDragEnterDragEventHandler<HTMLFormElement> | undefined—
onDragEnterCaptureDragEventHandler<HTMLFormElement> | undefined—
onDragExitDragEventHandler<HTMLFormElement> | undefined—
onDragExitCaptureDragEventHandler<HTMLFormElement> | undefined—
onDragLeaveDragEventHandler<HTMLFormElement> | undefined—
onDragLeaveCaptureDragEventHandler<HTMLFormElement> | undefined—
onDragOverDragEventHandler<HTMLFormElement> | undefined—
onDragOverCaptureDragEventHandler<HTMLFormElement> | undefined—
onDragStartDragEventHandler<HTMLFormElement> | undefined—
onDragStartCaptureDragEventHandler<HTMLFormElement> | undefined—
onDropDragEventHandler<HTMLFormElement> | undefined—
onDropCaptureDragEventHandler<HTMLFormElement> | undefined—
onDurationChangeReactEventHandler<HTMLFormElement> | undefined—
onDurationChangeCaptureReactEventHandler<HTMLFormElement> | undefined—
onEmptiedReactEventHandler<HTMLFormElement> | undefined—
onEmptiedCaptureReactEventHandler<HTMLFormElement> | undefined—
onEncryptedReactEventHandler<HTMLFormElement> | undefined—
onEncryptedCaptureReactEventHandler<HTMLFormElement> | undefined—
onEndedReactEventHandler<HTMLFormElement> | undefined—
onEndedCaptureReactEventHandler<HTMLFormElement> | undefined—
onErrorReactEventHandler<HTMLFormElement> | undefined—
onErrorCaptureReactEventHandler<HTMLFormElement> | undefined—
onFocusFocusEventHandler<HTMLFormElement> | undefined—
onFocusCaptureFocusEventHandler<HTMLFormElement> | undefined—
onGotPointerCapturePointerEventHandler<HTMLFormElement> | undefined—
onGotPointerCaptureCapturePointerEventHandler<HTMLFormElement> | undefined—
onInputInputEventHandler<HTMLFormElement> | undefined—
onInputCaptureInputEventHandler<HTMLFormElement> | undefined—
onInvalidReactEventHandler<HTMLFormElement> | undefined—
onInvalidCaptureReactEventHandler<HTMLFormElement> | undefined—
onKeyDownKeyboardEventHandler<HTMLFormElement> | undefined—
onKeyDownCaptureKeyboardEventHandler<HTMLFormElement> | undefined—
onKeyPressKeyboardEventHandler<HTMLFormElement> | undefined—
onKeyPressCaptureKeyboardEventHandler<HTMLFormElement> | undefined—
onKeyUpKeyboardEventHandler<HTMLFormElement> | undefined—
onKeyUpCaptureKeyboardEventHandler<HTMLFormElement> | undefined—
onLoadReactEventHandler<HTMLFormElement> | undefined—
onLoadCaptureReactEventHandler<HTMLFormElement> | undefined—
onLoadedDataReactEventHandler<HTMLFormElement> | undefined—
onLoadedDataCaptureReactEventHandler<HTMLFormElement> | undefined—
onLoadedMetadataReactEventHandler<HTMLFormElement> | undefined—
onLoadedMetadataCaptureReactEventHandler<HTMLFormElement> | undefined—
onLoadStartReactEventHandler<HTMLFormElement> | undefined—
onLoadStartCaptureReactEventHandler<HTMLFormElement> | undefined—
onLostPointerCapturePointerEventHandler<HTMLFormElement> | undefined—
onLostPointerCaptureCapturePointerEventHandler<HTMLFormElement> | undefined—
onMouseDownMouseEventHandler<HTMLFormElement> | undefined—
onMouseDownCaptureMouseEventHandler<HTMLFormElement> | undefined—
onMouseEnterMouseEventHandler<HTMLFormElement> | undefined—
onMouseLeaveMouseEventHandler<HTMLFormElement> | undefined—
onMouseMoveMouseEventHandler<HTMLFormElement> | undefined—
onMouseMoveCaptureMouseEventHandler<HTMLFormElement> | undefined—
onMouseOutMouseEventHandler<HTMLFormElement> | undefined—
onMouseOutCaptureMouseEventHandler<HTMLFormElement> | undefined—
onMouseOverMouseEventHandler<HTMLFormElement> | undefined—
onMouseOverCaptureMouseEventHandler<HTMLFormElement> | undefined—
onMouseUpMouseEventHandler<HTMLFormElement> | undefined—
onMouseUpCaptureMouseEventHandler<HTMLFormElement> | undefined—
onPasteClipboardEventHandler<HTMLFormElement> | undefined—
onPasteCaptureClipboardEventHandler<HTMLFormElement> | undefined—
onPauseReactEventHandler<HTMLFormElement> | undefined—
onPauseCaptureReactEventHandler<HTMLFormElement> | undefined—
onPlayReactEventHandler<HTMLFormElement> | undefined—
onPlayCaptureReactEventHandler<HTMLFormElement> | undefined—
onPlayingReactEventHandler<HTMLFormElement> | undefined—
onPlayingCaptureReactEventHandler<HTMLFormElement> | undefined—
onPointerCancelPointerEventHandler<HTMLFormElement> | undefined—
onPointerCancelCapturePointerEventHandler<HTMLFormElement> | undefined—
onPointerDownPointerEventHandler<HTMLFormElement> | undefined—
onPointerDownCapturePointerEventHandler<HTMLFormElement> | undefined—
onPointerEnterPointerEventHandler<HTMLFormElement> | undefined—
onPointerLeavePointerEventHandler<HTMLFormElement> | undefined—
onPointerMovePointerEventHandler<HTMLFormElement> | undefined—
onPointerMoveCapturePointerEventHandler<HTMLFormElement> | undefined—
onPointerOutPointerEventHandler<HTMLFormElement> | undefined—
onPointerOutCapturePointerEventHandler<HTMLFormElement> | undefined—
onPointerOverPointerEventHandler<HTMLFormElement> | undefined—
onPointerOverCapturePointerEventHandler<HTMLFormElement> | undefined—
onPointerUpPointerEventHandler<HTMLFormElement> | undefined—
onPointerUpCapturePointerEventHandler<HTMLFormElement> | undefined—
onProgressReactEventHandler<HTMLFormElement> | undefined—
onProgressCaptureReactEventHandler<HTMLFormElement> | undefined—
onRateChangeReactEventHandler<HTMLFormElement> | undefined—
onRateChangeCaptureReactEventHandler<HTMLFormElement> | undefined—
onResetReactEventHandler<HTMLFormElement> | undefined—
onResetCaptureReactEventHandler<HTMLFormElement> | undefined—
onScrollUIEventHandler<HTMLFormElement> | undefined—
onScrollCaptureUIEventHandler<HTMLFormElement> | undefined—
onScrollEndUIEventHandler<HTMLFormElement> | undefined—
onScrollEndCaptureUIEventHandler<HTMLFormElement> | undefined—
onSeekedReactEventHandler<HTMLFormElement> | undefined—
onSeekedCaptureReactEventHandler<HTMLFormElement> | undefined—
onSeekingReactEventHandler<HTMLFormElement> | undefined—
onSeekingCaptureReactEventHandler<HTMLFormElement> | undefined—
onSelectReactEventHandler<HTMLFormElement> | undefined—
onSelectCaptureReactEventHandler<HTMLFormElement> | undefined—
onStalledReactEventHandler<HTMLFormElement> | undefined—
onStalledCaptureReactEventHandler<HTMLFormElement> | undefined—
onSubmitCaptureSubmitEventHandler<HTMLFormElement> | undefined—
onSuspendReactEventHandler<HTMLFormElement> | undefined—
onSuspendCaptureReactEventHandler<HTMLFormElement> | undefined—
onTimeUpdateReactEventHandler<HTMLFormElement> | undefined—
onTimeUpdateCaptureReactEventHandler<HTMLFormElement> | undefined—
onToggleToggleEventHandler<HTMLFormElement> | undefined—
onTouchCancelTouchEventHandler<HTMLFormElement> | undefined—
onTouchCancelCaptureTouchEventHandler<HTMLFormElement> | undefined—
onTouchEndTouchEventHandler<HTMLFormElement> | undefined—
onTouchEndCaptureTouchEventHandler<HTMLFormElement> | undefined—
onTouchMoveTouchEventHandler<HTMLFormElement> | undefined—
onTouchMoveCaptureTouchEventHandler<HTMLFormElement> | undefined—
onTouchStartTouchEventHandler<HTMLFormElement> | undefined—
onTouchStartCaptureTouchEventHandler<HTMLFormElement> | undefined—
onTransitionCancelTransitionEventHandler<HTMLFormElement> | undefined—
onTransitionCancelCaptureTransitionEventHandler<HTMLFormElement> | undefined—
onTransitionEndTransitionEventHandler<HTMLFormElement> | undefined—
onTransitionEndCaptureTransitionEventHandler<HTMLFormElement> | undefined—
onTransitionRunTransitionEventHandler<HTMLFormElement> | undefined—
onTransitionRunCaptureTransitionEventHandler<HTMLFormElement> | undefined—
onTransitionStartTransitionEventHandler<HTMLFormElement> | undefined—
onTransitionStartCaptureTransitionEventHandler<HTMLFormElement> | undefined—
onVolumeChangeReactEventHandler<HTMLFormElement> | undefined—
onVolumeChangeCaptureReactEventHandler<HTMLFormElement> | undefined—
onWaitingReactEventHandler<HTMLFormElement> | undefined—
onWaitingCaptureReactEventHandler<HTMLFormElement> | undefined—
onWheelWheelEventHandler<HTMLFormElement> | undefined—
onWheelCaptureWheelEventHandler<HTMLFormElement> | undefined—
partstring | undefined—
popover"" | "auto" | "manual" | "hint" | undefined—
popoverTargetstring | undefined—
popoverTargetAction"toggle" | "show" | "hide" | undefined—
prefixstring | undefined—
propertystring | undefined—
radioGroupstring | undefined—
relstring | undefined—
resourcestring | undefined—
resultsnumber | undefined—
revstring | undefined—
roleAriaRole | undefined—
securitystring | undefined—
slotstring | undefined—
spellCheckBooleanish | undefined—
styleCSSProperties | undefined—
suppressContentEditableWarningboolean | undefined—
suppressHydrationWarningboolean | undefined—
tabIndexnumber | undefined—
targetstring | undefined—
titlestring | undefined—
translate"yes" | "no" | undefined—
typeofstring | undefined—
unselectable"off" | "on" | undefined—
vocabstring | undefined—

useForm

useForm public properties
PropTypeDefault
initialValuesRequiredT—
onSubmitRequired(values: T, context: { signal: AbortSignal; }) => Promise<void | FormResult<T>>—
onSuccess((values: T) => void) | undefined—
validate((values: T, context: { signal: AbortSignal; }) => Partial<Record<keyof T, string>> | Promise<Partial<Record<keyof T, string>>>) | undefined—

FormOptions

FormOptions public properties
PropTypeDefault
initialValuesRequiredT—
onSubmitRequired(values: T, context: { signal: AbortSignal; }) => Promise<FormResult<T> | void>—
onSuccess((values: T) => void) | undefined—
validate((values: T, context: { signal: AbortSignal; }) => FormErrors<T> | Promise<FormErrors<T>>) | undefined—

FormResult

FormResult public properties
PropTypeDefault
errorstring | undefined—
fieldErrorsPartial<Record<keyof T, string>> | undefined—
valuesT | undefined—

FormErrorSummary

FormErrorSummary public properties
PropTypeDefault
errorstring | undefined—
errorsRecord<string, string | undefined> | undefined—
fieldIdsRecord<string, string> | undefined

Map error keys to stable visible-control IDs. Named native controls also resolve automatically.

—
fieldLabelsRecord<string, string> | undefined—
formIdstring | undefined

Scope named-control lookup to this native form, including externally associated inputs.

—
onFocusField((name: string) => void) | undefined

Optional application-owned focus (for example React Hook Form setFocus).

—

FormErrorSummaryProps

FormErrorSummaryProps public properties
PropTypeDefault
errorstring | undefined—
errorsRecord<string, string | undefined> | undefined—
fieldIdsRecord<string, string> | undefined

Map error keys to stable visible-control IDs. Named native controls also resolve automatically.

—
fieldLabelsRecord<string, string> | undefined—
formIdstring | undefined

Scope named-control lookup to this native form, including externally associated inputs.

—
onFocusField((name: string) => void) | undefined

Optional application-owned focus (for example React Hook Form setFocus).

—

Tables come from the public TypeScript declarations. Related types and function parameters are shown alongside their component. A dash means no default is declared at the public function boundary.

Related controls

Notes to self

Test this component with real content, keyboard input and both themes. The example is a starting point; labels, error handling and behaviour still need to fit the application.