Web · Components
Form
Form that manages validation together with Field.
Live example
Preview
Code
Events
- Events appear here when you interact with the preview.
Error display: without resizing (icon + tooltip) or with reserved space
Loading: skeleton until data arrives, overlay while saving
Field: connect your own element with label and validation
Password: press and hold, toggle or off
Preview
Code
Events
- Events appear here when you interact with the preview.
Nested names and defaultValues
Import
Form that manages validation together with Field. Supports all props of the native <form> (including action for server actions).
If the submit is invalid:
- The browser's error bubbles are hidden; messages appear under the fields.
- The first invalid field is focused and scrolled to the middle of the screen; on mobile it doesn't stay under the opened keyboard.
Validation is done with browser rules (required, minLength…) or with schema (Zod, Valibot… see FormProps.schema); both work together too. Server errors are given with state and distributed by field name.
- With
defaultValuesthe initial value of all fields is given in one place. - With
draftentered values are stored as a draft and come back after a reload. - With
loadingthe form turns into a skeleton, is disabled or covered by a scrim; withsubmitLoadingthis happens automatically while submitting.
Examples
Accessibly links any form element with its label, description and error message. For text and select boxes use TextField or SelectField directly; Field is for your own elements (e.g. a date picker, a Checkbox group).
- Validation uses the browser's rules (
required,type,minLength,pattern,min/max…); no extra library needed. - The error is shown when the user leaves the field or tries to submit the form; it doesn't say "invalid" early while typing.
- A red asterisk appears on the label of
requiredelements. - Server errors come via
erroror from the nearestForm'sstatebyname.
Examples
Single-line text field with its label, description and error message. It combines Field and Input itself. Icons can be placed inside the field with icon/iconEnd.
- Validation uses the browser's rules (
required,type,minLength,pattern…); the error is shown when the user leaves the field. - A red asterisk appears on the label of
requiredfields. - Server errors come from the
Form'sstatebyname. - With
multilineit becomes a<textarea>(takes props likeautoResize). type="password"fields get an eye button at the end; holding it shows the value.reveal="toggle"makes it a toggle,reveal={false}disables it.- With
mask, patterned input such as phone, plate or IBAN (seeMaskProp); for an incomplete or checksum-failing value the error appears under the field. - With
floatingLabelthe label goes inside the field and moves up when typing.
Examples
NumberInput with its label, description and error message. Takes all props of NumberInput (min, max, step, decimals, fixedDecimals, stepper, prefix, suffix…). classNames.control is given to the field's container.
- The value enters
FormDatawithout separators, with a dot ("1234.56"). required,min,maxandstepare checked by browser validation; change their messages withmessages(valueMissing,rangeUnderflow,rangeOverflow,stepMismatch).
Examples
OtpInput with its label, description and error message. Takes all props of OtpInput (length, charset, casing, groups, mask, autoSubmit, onResend…). Clicking the label focuses the first empty box; classNames.control is given to the boxes' container.
- The code itself enters
FormData. - An incomplete code gives a
patternMismatcherror, and an emptyrequiredone avalueMissingerror; change the messages withmessages. - The server's "wrong code" response comes from the
Form'sstate; the boxes shake briefly and the error disappears when the user types a new code.
Examples
Select box with its label, description and error message. It combines Field and Select itself; takes all props of Select (items, loadItems, search, multiple, clearable…). Clicking the label opens the list.
Examples
Autocomplete with its label, description and error message. Takes all props of Autocomplete (items, loadItems, multiple, allowCustomValue…). Clicking the label focuses the text field.
Examples
FileUpload with its label, description and error message. Takes all props of FileUpload (layout, multiple, accept, maxSize, maxFiles, upload…). Clicking the label opens the file dialog; in required fields the form is not submitted without a file and the error is written under the field. The reason for files whose type or size doesn't fit is listed separately.
Examples
DatePicker with its label, description and error message. Takes all props of DatePicker (min, max, isDateDisabled, time, presets, format…). Clicking the label opens the calendar.
- If
required, the form is not submitted without a date; values outsidemin/maxgive arangeUnderflow/rangeOverflowerror. "YYYY-MM-DD"(with time"YYYY-MM-DDTHH:mm") entersFormData; on the server convert it to aDatewithparseISODate.
Examples
DateRangePicker with its label, description and error message. Takes all props of DateRangePicker (presets, minDays, maxDays, months…). Clicking the label opens the calendar; required needs both ends.
"2026-10-01/2026-10-07" enters FormData; on the server split it with parseDateRange.
Examples
TimePicker with its label, description and error message. Takes all props of TimePicker (min, max, minuteStep…). "HH:mm" enters FormData.
Examples
MonthPicker with its label, description and error message. "YYYY-MM" enters FormData; on the server convert it to a Date with parseISOMonth.
Examples
YearPicker with its label, description and error message. "YYYY" enters FormData.
Examples
MentionInput with its label, description and error message. The stored format (@[Name](id)) enters FormData; on the server parse it with parseMentions.
Examples
TreeSelect with its label, description and error message. The selected id(s) enter FormData; for multiple selection use getAll(name).
Examples
Cascader with its label, description and error message. The path enters FormData as "istanbul/kadikoy".
Examples
Transfer with its label, description and error message. Each selected value enters FormData separately; getAll(name).
Examples
Checkbox with its label beside it and its description and error message below. In forms it behaves like TextField: if required, the form is not submitted unless checked, the error is written under the box (e.g. "You must accept the terms"), and server errors come from the Form's state by name. The whole label is clickable.
If checked, value (default "on") enters FormData under name; if unchecked, nothing does.
Examples
On/off switch with its label beside it and its description and error message below. In forms it behaves like TextField: if required, the form is not submitted unless it is on and the error is written below; server errors come from the Form's state by name.
If on, value (default "on") enters FormData under name; if off, nothing does. On the server read it with data.get("notifications") === "on".
Examples
Option group with its label, description and error message: only one of the options is selected. Takes all props of RadioGroup (options, variant, orientation, deselectable…) and behaves like TextField in forms:
- If
required, the form is not submitted without a selection; the error is written under the group and the first option is focused. - Server errors come from the
Form'sstatebyname; they disappear when the user picks an option. - The label is linked to the group with
aria-labelledby; screen readers read "Plan, radio group". The description sits right under the label.
If selected, the option's value enters FormData under name; if none is selected, nothing does.
Examples
Button that submits the form. While the form is submitted with an action (action) it shows loading automatically and prevents a second submit (useFormStatus). Not needed inside a ready-made Dialog; its confirm button already does this.
Examples
Rating with its label, description and error message. Takes all props of Rating (max, step, icon, labels, showValue…). Screen readers read the rating together with the label; in a required field the form is not submitted without a rating and the error is written below. Server errors come via error or from the nearest Form's state by name.
Examples
TagInput with its label, description and error message. Takes all props of TagInput (items, separators, max, validate…). Clicking the label focuses the text field; in a required field the form is not submitted until at least one tag is added.
Examples
SignaturePad with its label, description and error message. Takes all props of SignaturePad (format, color, ref…). In a required field the form is not submitted without a signature and the error is written below. Server errors come via error or from the nearest Form's state by name.
Examples
Slider with its label, value display, description and error message. Takes all props of Slider (min, max, step, marks, format, an array value for a range…).
- The selected value (or range) is written live to the right of the label; screen readers read the value from the thumb.
- Clicking the label focuses the first thumb; in a range each thumb is read with the label as "Start" / "End".
- Server errors come via
erroror from the nearestForm'sstatebyname; they disappear when the value changes.
Examples
useFormError
functionReturns a field's server error from the state value of the nearest Form. TextField and SelectField use it themselves; useful when writing your own field component.
useFormDefault
functionReturns the field's initial value from the defaultValues (or restored draft) of the nearest Form. Ready-made fields use it themselves; the name can be nested like "address.city".
readFormDraft
functionReads the draft; null if corrupt or expired.
clearFormDraft
functionDeletes the draft (e.g. when the user says "Discard draft").
formDataToValues
functionTurns FormData into a nested object. Works both in the browser and on the server.
address.city→{ address: { city } },items[0].name→{ items: [{ name }] }.- Multiple values with the same name (multi-select, tags) → an array.
- An empty file input is skipped. React's internal fields (
$ACTION_…) are skipped. - If the schema types are known, numbers, booleans and arrays are converted; an unchecked checkbox becomes
false.
Examples
validateForm
functionValidates the submitted FormData with the schema; used in a server action. If it returns errors, the result can be passed directly as the Form's state: the messages appear under the fields.
Examples
parseFieldName
functionConverts a field name to a path: "address.city" → ["address", "city"], "items[0].name" → ["items", 0, "name"], "tags[]" → ["tags", undefined].
formatFieldName
functionConverts a path to a field name: ["items", 0, "name"] → "items[0].name".
getIn
functionReads a value from an object by field name: getIn(values, "address.city").
toJsonSchema
functionReturns the schema's JSON Schema (via Standard JSON Schema; otherwise null). Computed once per schema.
unwrapJsonSchema
functionReturns the effective shape of the node: the first non-null option in anyOf/oneOf, or the allOf merge. The nullable flag is returned separately.
jsonType
functionType of the node ("string", "number", "boolean", "array", "object"…).
issuesToErrors
functionConverts Standard Schema issues into errors by field name. An error on an array item (e.g. tags[2]) is also written under the array's own name (tags), so arrays shown as a single field also show the error.
validateValues
functionValidates values with a schema. Returns synchronously for sync schemas and a Promise for async ones.
ErrorDisplay
typeHow a field error is shown. Set with the field's errorDisplay prop, Form errorDisplay and UIProvider errorDisplay; the nearest one wins.
"message": the message is written below the field (classic). When an error appears the field grows by one line; elements below shift."reserve": the message is still below, but one line of space is reserved up front; nothing shifts when an error appears (the field grows for messages longer than two lines)."icon": a red ⓘ icon appears left of the label and the message shows in a tooltip (on hover, on field focus, or on tap on mobile). The field size never changes. Screen readers still read the message as the field's description (aria-describedby)."icon-end": like"icon", with the icon right of the label.
ValidityKey
typeError keys in the browser's validity state (ValidityState).
FormState
interfaceForm state returned by a server action (e.g. useActionState). Only errors and formErrors are read; the rest is free. The result of validateForm is already in this shape.
| Name | Type | Description |
|---|---|---|
errors? | Record<string, string | readonly string[] | undefined> | null | undefined | Error messages by field name (name). If an array is given, the first message is shown (compatible with Zod's flatten().fieldErrors shape). |
formErrors? | readonly string[] | null | undefined | Errors that don't belong to any field; shown in a box above the form. |
FormDraftOptions
interfaceForm draft options.
| Name | Type | Default | Description |
|---|---|---|---|
key | string | Storage key; must be unique for each form with a draft on the page. | |
storage? | "local" | "session" | "local" | Where it is stored: "local" survives closing the browser, "session" is deleted when the tab closes. |
exclude? | readonly string[] | Field names not written to the draft. Password and file fields are never written. | |
maxAge? | number | 7 days | The draft is not restored if older than this (milliseconds). |
FormLoadingMode
typeHow the Form looks while loading.
skeleton: fields, labels and buttons turn into pale boxes at the same place and size (same asSkeletonloading). To show the form before the data arrives; nothing shifts when the data comes.disabled: all fields and buttons are disabled (with their own disabled look); the form stays readable as is.overlay: a semi-transparent scrim with a spinner in the middle covers the form; the scrim blocks clicks. In a long form the spinner stays on screen.
In all three the fields cannot be reached by keyboard or touch (inert) and the form is aria-busy.
FormLoadingOptions
interfaceDetailed options of FormProps.loading.
| Name | Type | Default | Description |
|---|---|---|---|
mode? | FormLoadingMode | "skeleton" | Look. See FormLoadingMode. |
text? | ReactNode | overlay: text next to the spinner (e.g. "Saving…"). | |
animation? | SkeletonAnimation | "pulse" | skeleton: animation of the boxes. See SkeletonAnimation. |
delay? | number | 0 | overlay: time to wait before the scrim appears (milliseconds). For short tasks the scrim doesn't blink on and off; clicks are still blocked immediately. |
FormSubmitLoadingOptions
interfaceDetailed options of FormProps.submitLoading.
| Name | Type | Default | Description |
|---|---|---|---|
mode? | "disabled" | "overlay" | "disabled" | Look: disabled or overlay. See FormLoadingMode. |
text? | ReactNode | overlay: text next to the spinner (e.g. "Saving…"). | |
delay? | number | 150 | overlay: time to wait before the scrim appears (milliseconds). |
FormProps
interfaceProps of the Form component.
Extends: Omit<ComponentProps<"form">, "defaultValue">
| Name | Type | Default | Description |
|---|---|---|---|
state? | FormState | null | undefined | State returned by a server action. Its errors are distributed by field name to fields like TextField and SelectField automatically; you don't need to pass error to each field. formErrors are shown above the form. | |
schema? | Schema | Validation schema: Zod, Valibot, ArkType… (any library supporting Standard Schema). No extra package needed. - Fields are validated as you type; the message appears under the field when the user leaves it or tries to submit (same as browser rules). - If invalid, the form is not submitted and the first invalid field is focused. - The error is found by matching the field name (name) with the path in the schema: address.city, items[0].name. Errors without a field appear above the form. - If the schema also offers Standard JSON Schema (Zod 4.2+), values are converted to their types: a number field becomes number, a checkbox boolean, a multi-select an array; z.coerce is not needed. - Async schemas (refine(async …)) are supported. On the server use validateForm with the same schema. | |
onValidSubmit? | (data: FormValues<Schema>, formData: FormData) => void | Promise<void> | Called when the schema passes; data is the schema's output (typed). If no action is given the page does not reload. If async, SubmitButton shows loading until it finishes. If it throws, the entered values are kept. Without a schema, data is the object extracted from the FormData. | |
defaultValues? | Partial<StandardSchemaV1.InferInput<Schema>> | Record<string, unknown> | Initial values of the fields by field name ({ name: "Ayşe", address: { city: "İzmir" } }). Ready-made fields take their value from here; if a field is also given defaultValue, that wins. | |
draft? | string | FormDraftOptions | Stores the entered values as a draft in the browser; they come back even if the page reloads or closes. Deleted on a successful submit and when the form is reset. Password and file fields are not stored. A string is used as the storage key. | |
onDraftRestore? | (values: Record<string, unknown>) => void | Called when the draft is restored (e.g. for a "Draft restored" notice). | |
onValidationError? | (errors: FormErrors, formErrors: string[]) => void | To see schema errors before they are distributed to the fields. Errors without a field are in formErrors. | |
loading? | boolean | FormLoadingMode | FormLoadingOptions | Shows the form as loading: true or "skeleton" turns fields into pale boxes, "disabled" disables everything, "overlay" puts a click-blocking scrim on top. See FormLoadingMode. For details pass an object: { mode: "overlay", text: "Fetching…" }. With disabled and overlay the fields are not rebuilt: typed values and selections are kept, and focus returns to the focused field when done. After skeleton the fields are rebuilt once, so defaultValues arriving with the data reach the fields. | |
submitLoading? | boolean | "disabled" | "overlay" | FormSubmitLoadingOptions | false` (only {@link SubmitButton} shows loading) | Look of the form while submitting (while the action or an async onValidSubmit runs): "disabled" (or true) disables the fields, "overlay" puts a scrim. So the user cannot change values while submitting. If loading is given, it wins. |
errorDisplay? | ErrorDisplay | "message"` (message under the field) | Error display mode of all fields in the form. A field's own errorDisplay overrides this, and this overrides UIProvider errorDisplay. See ErrorDisplay. |
FieldClassNames
interfaceClasses that can be passed to the inner parts of ready-made fields.
| Name | Type | Description |
|---|---|---|
root? | string | Container wrapping the field. |
label? | string | Label. |
control? | string | The form element itself (<input>, <textarea>, <select>). |
description? | string | Help text. |
error? | string | Error message. |
FieldOwnProps
interfaceShared props of ready-made fields.
| Name | Type | Default | Description |
|---|---|---|---|
label | ReactNode | Visible label of the field. Required; the accessible name comes from it. | |
description? | ReactNode | Help text under the field. | |
tooltip? | TooltipProp | Hint shown with an ⓘ icon next to the label. For extra info that doesn't need to be visible all the time; write important info in description. Screen readers read it when reaching the icon. See TooltipProp. | |
error? | string | Error from outside (e.g. a server action). If omitted, it is taken from the nearest Form's state.errors by the field's name. | |
messages? | Partial<Record<ValidityKey, ReactNode>> | Custom messages per validation rule. For rules not given, the browser's message (in the user's language) is shown. | |
errorDisplay? | ErrorDisplay | "message" | How the error is shown: "message" (below), "reserve" (below, with space reserved up front), "icon" / "icon-end" (an icon left/right of the label, message in the tooltip; the field's size never changes). If omitted, Form or UIProvider errorDisplay. See ErrorDisplay. |
className? | string | Classes added to the container. | |
classNames? | FieldClassNames | Classes added to the inner parts. |
FieldProps
interfaceProps of the Field component.
| Name | Type | Default | Description |
|---|---|---|---|
children | ReactElement | A single form element: Input, Textarea, Select, Checkbox or your own component. The id, aria-describedby and aria-invalid are given to it automatically; name, required and id are read from it. | |
label | ReactNode | Visible label of the field. Required; the accessible name comes from it. | |
description? | ReactNode | Help text under the field. | |
tooltip? | TooltipProp | Hint shown with an ⓘ icon next to the label. For extra info that doesn't need to be visible all the time; write important info in description. Screen readers read it when reaching the icon. See TooltipProp. | |
error? | string | Error from outside (e.g. a server action). If omitted, it is taken from the nearest Form's state.errors by the field's name. | |
messages? | Partial<Record<ValidityKey, ReactNode>> | Custom messages per validation rule. For rules not given, the browser's message (in the user's language) is shown. | |
errorDisplay? | ErrorDisplay | "message" | How the error is shown: "message" (below), "reserve" (below, with space reserved up front), "icon" / "icon-end" (an icon left/right of the label, message in the tooltip; the field's size never changes). If omitted, Form or UIProvider errorDisplay. See ErrorDisplay. |
className? | string | Classes added to the container. | |
classNames? | FieldClassNames | Classes added to the inner parts. |
TextFieldProps
typeProps of the TextField component.
Extends: Omit<InputProps, "className" | "label" | "floatingLabel"> | Omit<TextareaProps, "className">
| Name | Type | Default | Description |
|---|---|---|---|
label | ReactNode | Visible label of the field. Required; the accessible name comes from it. | |
description? | ReactNode | Help text under the field. | |
tooltip? | TooltipProp | Hint shown with an ⓘ icon next to the label. For extra info that doesn't need to be visible all the time; write important info in description. Screen readers read it when reaching the icon. See TooltipProp. | |
error? | string | Error from outside (e.g. a server action). If omitted, it is taken from the nearest Form's state.errors by the field's name. | |
messages? | Partial<Record<ValidityKey, ReactNode>> | Custom messages per validation rule. For rules not given, the browser's message (in the user's language) is shown. | |
errorDisplay? | ErrorDisplay | "message" | How the error is shown: "message" (below), "reserve" (below, with space reserved up front), "icon" / "icon-end" (an icon left/right of the label, message in the tooltip; the field's size never changes). If omitted, Form or UIProvider errorDisplay. See ErrorDisplay. |
className? | string | Classes added to the container. | |
classNames? | FieldClassNames | Classes added to the inner parts. | |
multiline? | false | true | If true, it becomes a multi-line text area (<textarea>). | |
floatingLabel? | FloatingLabel | false` (label above the field) | Puts the label inside the field (floating label): while the field is * empty it sits inside like a placeholder, and on focus or when filled it * shrinks and moves up. The description and error message still appear * below the field. * * - true: by appearance: on the top border for outline fields, at the * top inside the box for filled/underline/ghost fields. * - "border": on the top border in every appearance. * - "inside": at the top inside the box (the field becomes 48 px). * * The app-wide default is set in one place with UIProvider * floatingLabel; this prop overrides it. See FloatingLabel. * *(({ /** If `true`, it becomes a multi-line text area (`<textarea>`). */ multiline?: false; /** * Puts the label inside the field (floating label): while the field is * empty it sits inside like a placeholder, and on focus or when filled it * shrinks and moves up. The description and error message still appear * below the field. * * - `true`: by appearance: on the top border for `outline` fields, at the * top inside the box for `filled`/`underline`/`ghost` fields. * - `"border"`: on the top border in every appearance. * - `"inside"`: at the top inside the box (the field becomes 48 px). * * The app-wide default is set in one place with {@link UIProvider} * `floatingLabel`; this prop overrides it. See {@link FloatingLabel}. * * @defaultValue `false` (label above the field) */ floatingLabel?: FloatingLabel; } & Omit<InputProps, "className" | "label" | "floatingLabel">)) |
NumberFieldProps
typeProps of the NumberField component.
Extends: Omit<NumberInputProps, "className">
| Name | Type | Default | Description |
|---|---|---|---|
label | ReactNode | Visible label of the field. Required; the accessible name comes from it. | |
description? | ReactNode | Help text under the field. | |
tooltip? | TooltipProp | Hint shown with an ⓘ icon next to the label. For extra info that doesn't need to be visible all the time; write important info in description. Screen readers read it when reaching the icon. See TooltipProp. | |
error? | string | Error from outside (e.g. a server action). If omitted, it is taken from the nearest Form's state.errors by the field's name. | |
messages? | Partial<Record<ValidityKey, ReactNode>> | Custom messages per validation rule. For rules not given, the browser's message (in the user's language) is shown. | |
errorDisplay? | ErrorDisplay | "message" | How the error is shown: "message" (below), "reserve" (below, with space reserved up front), "icon" / "icon-end" (an icon left/right of the label, message in the tooltip; the field's size never changes). If omitted, Form or UIProvider errorDisplay. See ErrorDisplay. |
className? | string | Classes added to the container. | |
classNames? | FieldClassNames | Classes added to the inner parts. |
OtpFieldProps
typeProps of the OtpField component.
Extends: Omit<OtpInputProps, "className">
| Name | Type | Default | Description |
|---|---|---|---|
label | ReactNode | Visible label of the field. Required; the accessible name comes from it. | |
description? | ReactNode | Help text under the field. | |
tooltip? | TooltipProp | Hint shown with an ⓘ icon next to the label. For extra info that doesn't need to be visible all the time; write important info in description. Screen readers read it when reaching the icon. See TooltipProp. | |
error? | string | Error from outside (e.g. a server action). If omitted, it is taken from the nearest Form's state.errors by the field's name. | |
messages? | Partial<Record<ValidityKey, ReactNode>> | Custom messages per validation rule. For rules not given, the browser's message (in the user's language) is shown. | |
errorDisplay? | ErrorDisplay | "message" | How the error is shown: "message" (below), "reserve" (below, with space reserved up front), "icon" / "icon-end" (an icon left/right of the label, message in the tooltip; the field's size never changes). If omitted, Form or UIProvider errorDisplay. See ErrorDisplay. |
className? | string | Classes added to the container. | |
classNames? | FieldClassNames | Classes added to the inner parts. |
SelectFieldProps
typeProps of the SelectField component.
Extends: Omit<SelectProps, "className">
| Name | Type | Default | Description |
|---|---|---|---|
label | ReactNode | Visible label of the field. Required; the accessible name comes from it. | |
description? | ReactNode | Help text under the field. | |
tooltip? | TooltipProp | Hint shown with an ⓘ icon next to the label. For extra info that doesn't need to be visible all the time; write important info in description. Screen readers read it when reaching the icon. See TooltipProp. | |
error? | string | Error from outside (e.g. a server action). If omitted, it is taken from the nearest Form's state.errors by the field's name. | |
messages? | Partial<Record<ValidityKey, ReactNode>> | Custom messages per validation rule. For rules not given, the browser's message (in the user's language) is shown. | |
errorDisplay? | ErrorDisplay | "message" | How the error is shown: "message" (below), "reserve" (below, with space reserved up front), "icon" / "icon-end" (an icon left/right of the label, message in the tooltip; the field's size never changes). If omitted, Form or UIProvider errorDisplay. See ErrorDisplay. |
className? | string | Classes added to the container. | |
classNames? | FieldClassNames | Classes added to the inner parts. |
Props of the AutocompleteField component.
Extends: Omit<AutocompleteProps, "className">
| Name | Type | Default | Description |
|---|---|---|---|
label | ReactNode | Visible label of the field. Required; the accessible name comes from it. | |
description? | ReactNode | Help text under the field. | |
tooltip? | TooltipProp | Hint shown with an ⓘ icon next to the label. For extra info that doesn't need to be visible all the time; write important info in description. Screen readers read it when reaching the icon. See TooltipProp. | |
error? | string | Error from outside (e.g. a server action). If omitted, it is taken from the nearest Form's state.errors by the field's name. | |
messages? | Partial<Record<ValidityKey, ReactNode>> | Custom messages per validation rule. For rules not given, the browser's message (in the user's language) is shown. | |
errorDisplay? | ErrorDisplay | "message" | How the error is shown: "message" (below), "reserve" (below, with space reserved up front), "icon" / "icon-end" (an icon left/right of the label, message in the tooltip; the field's size never changes). If omitted, Form or UIProvider errorDisplay. See ErrorDisplay. |
className? | string | Classes added to the container. | |
classNames? | FieldClassNames | Classes added to the inner parts. |
FileFieldProps
typeProps of the FileField component.
Extends: Omit<FileUploadProps, "className" | "classNames" | "tooltip">
| Name | Type | Default | Description |
|---|---|---|---|
label | ReactNode | Visible label of the field. Required; the accessible name comes from it. | |
description? | ReactNode | Help text under the field. | |
tooltip? | TooltipProp | Hint shown with an ⓘ icon next to the label. For extra info that doesn't need to be visible all the time; write important info in description. Screen readers read it when reaching the icon. See TooltipProp. | |
error? | string | Error from outside (e.g. a server action). If omitted, it is taken from the nearest Form's state.errors by the field's name. | |
messages? | Partial<Record<ValidityKey, ReactNode>> | Custom messages per validation rule. For rules not given, the browser's message (in the user's language) is shown. | |
errorDisplay? | ErrorDisplay | "message" | How the error is shown: "message" (below), "reserve" (below, with space reserved up front), "icon" / "icon-end" (an icon left/right of the label, message in the tooltip; the field's size never changes). If omitted, Form or UIProvider errorDisplay. See ErrorDisplay. |
className? | string | Classes added to the container. | |
classNames? | FieldClassNames & FileUploadClassNames | Classes added to the inner parts: the field's parts (FieldClassNames; * control is the upload area's container) and the upload area's parts * (dropzone, list, item). |
Classes that can be passed to the inner parts of date and time fields.
Extends: PickerClassNames
| Name | Type | Description |
|---|---|---|
root? | string | Container wrapping the field. |
label? | string | Label. |
control? | string | The form element itself (<input>, <textarea>, <select>). |
description? | string | Help text. |
error? | string | Error message. |
DateFieldProps
typeProps of the DateField component.
Extends: Omit<DatePickerProps, "className" | "classNames">
| Name | Type | Default | Description |
|---|---|---|---|
label | ReactNode | Visible label of the field. Required; the accessible name comes from it. | |
description? | ReactNode | Help text under the field. | |
tooltip? | TooltipProp | Hint shown with an ⓘ icon next to the label. For extra info that doesn't need to be visible all the time; write important info in description. Screen readers read it when reaching the icon. See TooltipProp. | |
error? | string | Error from outside (e.g. a server action). If omitted, it is taken from the nearest Form's state.errors by the field's name. | |
messages? | Partial<Record<ValidityKey, ReactNode>> | Custom messages per validation rule. For rules not given, the browser's message (in the user's language) is shown. | |
errorDisplay? | ErrorDisplay | "message" | How the error is shown: "message" (below), "reserve" (below, with space reserved up front), "icon" / "icon-end" (an icon left/right of the label, message in the tooltip; the field's size never changes). If omitted, Form or UIProvider errorDisplay. See ErrorDisplay. |
className? | string | Classes added to the container. | |
classNames? | PickerFieldClassNames | Classes added to the inner parts: the field's parts (FieldClassNames; * control is the picker's container) and the picker's parts (box, * input, content). |
Props of the DateRangeField component.
Extends: Omit<DateRangePickerProps, "className" | "classNames">
| Name | Type | Default | Description |
|---|---|---|---|
label | ReactNode | Visible label of the field. Required; the accessible name comes from it. | |
description? | ReactNode | Help text under the field. | |
tooltip? | TooltipProp | Hint shown with an ⓘ icon next to the label. For extra info that doesn't need to be visible all the time; write important info in description. Screen readers read it when reaching the icon. See TooltipProp. | |
error? | string | Error from outside (e.g. a server action). If omitted, it is taken from the nearest Form's state.errors by the field's name. | |
messages? | Partial<Record<ValidityKey, ReactNode>> | Custom messages per validation rule. For rules not given, the browser's message (in the user's language) is shown. | |
errorDisplay? | ErrorDisplay | "message" | How the error is shown: "message" (below), "reserve" (below, with space reserved up front), "icon" / "icon-end" (an icon left/right of the label, message in the tooltip; the field's size never changes). If omitted, Form or UIProvider errorDisplay. See ErrorDisplay. |
className? | string | Classes added to the container. | |
classNames? | PickerFieldClassNames | Classes added to the inner parts: the field's parts (FieldClassNames; * control is the picker's container) and the picker's parts (box, * input, content). |
TimeFieldProps
typeProps of the TimeField component.
Extends: Omit<TimePickerProps, "className" | "classNames">
| Name | Type | Default | Description |
|---|---|---|---|
label | ReactNode | Visible label of the field. Required; the accessible name comes from it. | |
description? | ReactNode | Help text under the field. | |
tooltip? | TooltipProp | Hint shown with an ⓘ icon next to the label. For extra info that doesn't need to be visible all the time; write important info in description. Screen readers read it when reaching the icon. See TooltipProp. | |
error? | string | Error from outside (e.g. a server action). If omitted, it is taken from the nearest Form's state.errors by the field's name. | |
messages? | Partial<Record<ValidityKey, ReactNode>> | Custom messages per validation rule. For rules not given, the browser's message (in the user's language) is shown. | |
errorDisplay? | ErrorDisplay | "message" | How the error is shown: "message" (below), "reserve" (below, with space reserved up front), "icon" / "icon-end" (an icon left/right of the label, message in the tooltip; the field's size never changes). If omitted, Form or UIProvider errorDisplay. See ErrorDisplay. |
className? | string | Classes added to the container. | |
classNames? | PickerFieldClassNames | Classes added to the inner parts: the field's parts (FieldClassNames; * control is the picker's container) and the picker's parts (box, * input, content). |
MonthFieldProps
typeProps of the MonthField component.
Extends: Omit<MonthPickerProps, "className" | "classNames">
| Name | Type | Default | Description |
|---|---|---|---|
label | ReactNode | Visible label of the field. Required; the accessible name comes from it. | |
description? | ReactNode | Help text under the field. | |
tooltip? | TooltipProp | Hint shown with an ⓘ icon next to the label. For extra info that doesn't need to be visible all the time; write important info in description. Screen readers read it when reaching the icon. See TooltipProp. | |
error? | string | Error from outside (e.g. a server action). If omitted, it is taken from the nearest Form's state.errors by the field's name. | |
messages? | Partial<Record<ValidityKey, ReactNode>> | Custom messages per validation rule. For rules not given, the browser's message (in the user's language) is shown. | |
errorDisplay? | ErrorDisplay | "message" | How the error is shown: "message" (below), "reserve" (below, with space reserved up front), "icon" / "icon-end" (an icon left/right of the label, message in the tooltip; the field's size never changes). If omitted, Form or UIProvider errorDisplay. See ErrorDisplay. |
className? | string | Classes added to the container. | |
classNames? | PickerFieldClassNames | Classes added to the inner parts: the field's parts (FieldClassNames; * control is the picker's container) and the picker's parts (box, * input, content). |
YearFieldProps
typeProps of the YearField component.
Extends: Omit<YearPickerProps, "className" | "classNames">
| Name | Type | Default | Description |
|---|---|---|---|
label | ReactNode | Visible label of the field. Required; the accessible name comes from it. | |
description? | ReactNode | Help text under the field. | |
tooltip? | TooltipProp | Hint shown with an ⓘ icon next to the label. For extra info that doesn't need to be visible all the time; write important info in description. Screen readers read it when reaching the icon. See TooltipProp. | |
error? | string | Error from outside (e.g. a server action). If omitted, it is taken from the nearest Form's state.errors by the field's name. | |
messages? | Partial<Record<ValidityKey, ReactNode>> | Custom messages per validation rule. For rules not given, the browser's message (in the user's language) is shown. | |
errorDisplay? | ErrorDisplay | "message" | How the error is shown: "message" (below), "reserve" (below, with space reserved up front), "icon" / "icon-end" (an icon left/right of the label, message in the tooltip; the field's size never changes). If omitted, Form or UIProvider errorDisplay. See ErrorDisplay. |
className? | string | Classes added to the container. | |
classNames? | PickerFieldClassNames | Classes added to the inner parts: the field's parts (FieldClassNames; * control is the picker's container) and the picker's parts (box, * input, content). |
Props of the MentionField component.
Extends: Omit<MentionInputProps, "className" | "classNames">
| Name | Type | Default | Description |
|---|---|---|---|
label | ReactNode | Visible label of the field. Required; the accessible name comes from it. | |
description? | ReactNode | Help text under the field. | |
tooltip? | TooltipProp | Hint shown with an ⓘ icon next to the label. For extra info that doesn't need to be visible all the time; write important info in description. Screen readers read it when reaching the icon. See TooltipProp. | |
error? | string | Error from outside (e.g. a server action). If omitted, it is taken from the nearest Form's state.errors by the field's name. | |
messages? | Partial<Record<ValidityKey, ReactNode>> | Custom messages per validation rule. For rules not given, the browser's message (in the user's language) is shown. | |
errorDisplay? | ErrorDisplay | "message" | How the error is shown: "message" (below), "reserve" (below, with space reserved up front), "icon" / "icon-end" (an icon left/right of the label, message in the tooltip; the field's size never changes). If omitted, Form or UIProvider errorDisplay. See ErrorDisplay. |
className? | string | Classes added to the container. | |
classNames? | FieldClassNames & MentionInputProps["classNames"] | Classes added to the inner parts (control is the mention box's container). |
Props of the TreeSelectField component.
Extends: TreeSelectProps extends infer P ? P extends unknown ? Omit<P, "className" | "classNames"> : never : never
| Name | Type | Default | Description |
|---|---|---|---|
label | ReactNode | Visible label of the field. Required; the accessible name comes from it. | |
description? | ReactNode | Help text under the field. | |
tooltip? | TooltipProp | Hint shown with an ⓘ icon next to the label. For extra info that doesn't need to be visible all the time; write important info in description. Screen readers read it when reaching the icon. See TooltipProp. | |
error? | string | Error from outside (e.g. a server action). If omitted, it is taken from the nearest Form's state.errors by the field's name. | |
messages? | Partial<Record<ValidityKey, ReactNode>> | Custom messages per validation rule. For rules not given, the browser's message (in the user's language) is shown. | |
errorDisplay? | ErrorDisplay | "message" | How the error is shown: "message" (below), "reserve" (below, with space reserved up front), "icon" / "icon-end" (an icon left/right of the label, message in the tooltip; the field's size never changes). If omitted, Form or UIProvider errorDisplay. See ErrorDisplay. |
className? | string | Classes added to the container. | |
classNames? | FieldClassNames & TreeSelectProps["classNames"] | Classes added to the inner parts (control is the picker's container). |
Props of the CascaderField component.
Extends: Omit<CascaderProps, "className" | "classNames">
| Name | Type | Default | Description |
|---|---|---|---|
label | ReactNode | Visible label of the field. Required; the accessible name comes from it. | |
description? | ReactNode | Help text under the field. | |
tooltip? | TooltipProp | Hint shown with an ⓘ icon next to the label. For extra info that doesn't need to be visible all the time; write important info in description. Screen readers read it when reaching the icon. See TooltipProp. | |
error? | string | Error from outside (e.g. a server action). If omitted, it is taken from the nearest Form's state.errors by the field's name. | |
messages? | Partial<Record<ValidityKey, ReactNode>> | Custom messages per validation rule. For rules not given, the browser's message (in the user's language) is shown. | |
errorDisplay? | ErrorDisplay | "message" | How the error is shown: "message" (below), "reserve" (below, with space reserved up front), "icon" / "icon-end" (an icon left/right of the label, message in the tooltip; the field's size never changes). If omitted, Form or UIProvider errorDisplay. See ErrorDisplay. |
className? | string | Classes added to the container. | |
classNames? | FieldClassNames & CascaderProps["classNames"] | Classes added to the inner parts (control is the picker's container). |
Props of the TransferField component.
Extends: Omit<TransferProps, "className" | "classNames">
| Name | Type | Default | Description |
|---|---|---|---|
label | ReactNode | Visible label of the field. Required; the accessible name comes from it. | |
description? | ReactNode | Help text under the field. | |
tooltip? | TooltipProp | Hint shown with an ⓘ icon next to the label. For extra info that doesn't need to be visible all the time; write important info in description. Screen readers read it when reaching the icon. See TooltipProp. | |
error? | string | Error from outside (e.g. a server action). If omitted, it is taken from the nearest Form's state.errors by the field's name. | |
messages? | Partial<Record<ValidityKey, ReactNode>> | Custom messages per validation rule. For rules not given, the browser's message (in the user's language) is shown. | |
errorDisplay? | ErrorDisplay | "message" | How the error is shown: "message" (below), "reserve" (below, with space reserved up front), "icon" / "icon-end" (an icon left/right of the label, message in the tooltip; the field's size never changes). If omitted, Form or UIProvider errorDisplay. See ErrorDisplay. |
className? | string | Classes added to the container. | |
classNames? | FieldClassNames & TransferProps["classNames"] | Classes added to the inner parts (control is the transfer box's container). |
Props of the CheckboxField component.
Extends: Omit<CheckboxProps, "label" | "description" | "tooltip" | "className">
| Name | Type | Default | Description |
|---|---|---|---|
label | ReactNode | Visible label of the field. Required; the accessible name comes from it. | |
description? | ReactNode | Help text under the field. | |
tooltip? | TooltipProp | Hint shown with an ⓘ icon next to the label. For extra info that doesn't need to be visible all the time; write important info in description. Screen readers read it when reaching the icon. See TooltipProp. | |
error? | string | Error from outside (e.g. a server action). If omitted, it is taken from the nearest Form's state.errors by the field's name. | |
messages? | Partial<Record<ValidityKey, ReactNode>> | Custom messages per validation rule. For rules not given, the browser's message (in the user's language) is shown. | |
errorDisplay? | ErrorDisplay | "message" | How the error is shown: "message" (below), "reserve" (below, with space reserved up front), "icon" / "icon-end" (an icon left/right of the label, message in the tooltip; the field's size never changes). If omitted, Form or UIProvider errorDisplay. See ErrorDisplay. |
className? | string | Classes added to the container. | |
classNames? | Pick<FieldClassNames, "root" | "label" | "error"> | Classes added to the inner parts: root is the container, label the * clickable label row, error the error message. |
SwitchFieldProps
typeProps of the SwitchField component.
Extends: Omit<SwitchProps, "label" | "description" | "tooltip" | "className">
| Name | Type | Default | Description |
|---|---|---|---|
label | ReactNode | Visible label of the field. Required; the accessible name comes from it. | |
description? | ReactNode | Help text under the field. | |
tooltip? | TooltipProp | Hint shown with an ⓘ icon next to the label. For extra info that doesn't need to be visible all the time; write important info in description. Screen readers read it when reaching the icon. See TooltipProp. | |
error? | string | Error from outside (e.g. a server action). If omitted, it is taken from the nearest Form's state.errors by the field's name. | |
messages? | Partial<Record<ValidityKey, ReactNode>> | Custom messages per validation rule. For rules not given, the browser's message (in the user's language) is shown. | |
errorDisplay? | ErrorDisplay | "message" | How the error is shown: "message" (below), "reserve" (below, with space reserved up front), "icon" / "icon-end" (an icon left/right of the label, message in the tooltip; the field's size never changes). If omitted, Form or UIProvider errorDisplay. See ErrorDisplay. |
className? | string | Classes added to the container. | |
classNames? | Pick<FieldClassNames, "root" | "label" | "error"> | Classes added to the inner parts: root is the container, label the * clickable label row, error the error message. |
RadioFieldProps
typeProps of the RadioField component.
Extends: Omit<RadioGroupProps, "className">
| Name | Type | Default | Description |
|---|---|---|---|
label | ReactNode | Visible label of the field. Required; the accessible name comes from it. | |
description? | ReactNode | Help text under the field. | |
tooltip? | TooltipProp | Hint shown with an ⓘ icon next to the label. For extra info that doesn't need to be visible all the time; write important info in description. Screen readers read it when reaching the icon. See TooltipProp. | |
error? | string | Error from outside (e.g. a server action). If omitted, it is taken from the nearest Form's state.errors by the field's name. | |
messages? | Partial<Record<ValidityKey, ReactNode>> | Custom messages per validation rule. For rules not given, the browser's message (in the user's language) is shown. | |
errorDisplay? | ErrorDisplay | "message" | How the error is shown: "message" (below), "reserve" (below, with space reserved up front), "icon" / "icon-end" (an icon left/right of the label, message in the tooltip; the field's size never changes). If omitted, Form or UIProvider errorDisplay. See ErrorDisplay. |
className? | string | Classes added to the container. | |
classNames? | FieldClassNames | Classes added to the inner parts. |
Props of the SubmitButton component.
RatingFieldProps
typeProps of the RatingField component.
Extends: Omit<RatingProps, "className" | "classNames">
| Name | Type | Default | Description |
|---|---|---|---|
label | ReactNode | Visible label of the field. Required; the accessible name comes from it. | |
description? | ReactNode | Help text under the field. | |
tooltip? | TooltipProp | Hint shown with an ⓘ icon next to the label. For extra info that doesn't need to be visible all the time; write important info in description. Screen readers read it when reaching the icon. See TooltipProp. | |
error? | string | Error from outside (e.g. a server action). If omitted, it is taken from the nearest Form's state.errors by the field's name. | |
messages? | Partial<Record<ValidityKey, ReactNode>> | Custom messages per validation rule. For rules not given, the browser's message (in the user's language) is shown. | |
errorDisplay? | ErrorDisplay | "message" | How the error is shown: "message" (below), "reserve" (below, with space reserved up front), "icon" / "icon-end" (an icon left/right of the label, message in the tooltip; the field's size never changes). If omitted, Form or UIProvider errorDisplay. See ErrorDisplay. |
className? | string | Classes added to the container. | |
classNames? | FieldClassNames | Classes added to the inner parts. |
TagFieldProps
typeProps of the TagField component.
Extends: Omit<TagInputProps, "className" | "classNames">
| Name | Type | Default | Description |
|---|---|---|---|
label | ReactNode | Visible label of the field. Required; the accessible name comes from it. | |
description? | ReactNode | Help text under the field. | |
tooltip? | TooltipProp | Hint shown with an ⓘ icon next to the label. For extra info that doesn't need to be visible all the time; write important info in description. Screen readers read it when reaching the icon. See TooltipProp. | |
error? | string | Error from outside (e.g. a server action). If omitted, it is taken from the nearest Form's state.errors by the field's name. | |
messages? | Partial<Record<ValidityKey, ReactNode>> | Custom messages per validation rule. For rules not given, the browser's message (in the user's language) is shown. | |
errorDisplay? | ErrorDisplay | "message" | How the error is shown: "message" (below), "reserve" (below, with space reserved up front), "icon" / "icon-end" (an icon left/right of the label, message in the tooltip; the field's size never changes). If omitted, Form or UIProvider errorDisplay. See ErrorDisplay. |
className? | string | Classes added to the container. | |
classNames? | FieldClassNames & TagInputClassNames | Classes added to the inner parts: the field's parts (FieldClassNames; * control is the tag box's frame) and the tag input's parts * (input, tag, message, content, item). |
StandardSchemaV1
interfaceStandard Schema interface (v1). Schemas from libraries such as Zod, Valibot and ArkType satisfy it out of the box.
FormDataToValuesOptions
interfaceformDataToValues options.
| Name | Type | Description |
|---|---|---|
schema? | StandardSchemaV1 | null | Schema to read the types from. If it offers Standard JSON Schema, values are converted; otherwise they stay strings (an empty string becomes undefined). |
jsonSchema? | JsonSchema | null | A JSON Schema directly (instead of a schema). |
arrays? | Readonly<Record<string, { length: number; object?: boolean; }>> | Arrays with a known row count (e.g. FieldArray), by name. An array with no rows left becomes []; with object: true rows with all fields left empty are also kept as {}, so the row count and order don't shift. |
JsonSchemaConverter
interfaceStandard JSON Schema converter.
| Name | Type | Description |
|---|---|---|
input | (options: { /** Target version. */ readonly target: string; /** Library-specific options. */ readonly libraryOptions?: Record<string, unknown>; }) => Record<string, unknown> | JSON Schema of the input side of the schema. |
FormValues
typeValue type produced by a form schema.
FormErrors
typeError messages by field name (name). Same shape as FormState errors; can be returned directly from a server action.
FormValidation
typeResult of validateForm.
| Name | Type | Description |
|---|---|---|
success | true | false | Values are valid. |
data? | Output | undefined | Value returned by the schema (transformed, typed). |
errors? | undefined | FormErrors | Empty on success. |
formErrors? | undefined | string[] | Empty on success. |
JsonSchema
typeSimplified JSON Schema node.
| Name | Type | Description |
|---|---|---|
type? | string | string[] | Type ("string", "number"…) or a list of types. |
properties? | Record<string, JsonSchema> | Object properties. |
required? | string[] | Required property names. |
items? | JsonSchema | Schema of the array items. |
prefixItems? | JsonSchema[] | Tuple items. |
anyOf? | JsonSchema[] | At least one of the options. |
oneOf? | JsonSchema[] | Exactly one of the options. |
allOf? | JsonSchema[] | All of them at once. |
enum? | unknown[] | Allowed values. |
const? | unknown | The single allowed value. |
$ref? | string | Reference to another definition. |
$defs? | Record<string, JsonSchema> | Definitions. |
definitions? | Record<string, JsonSchema> | Definitions (old name). |
default? | unknown | Default value. |
Props of the SignatureField component.
Extends: Omit<SignaturePadProps, "className" | "classNames">
| Name | Type | Default | Description |
|---|---|---|---|
label | ReactNode | Visible label of the field. Required; the accessible name comes from it. | |
description? | ReactNode | Help text under the field. | |
tooltip? | TooltipProp | Hint shown with an ⓘ icon next to the label. For extra info that doesn't need to be visible all the time; write important info in description. Screen readers read it when reaching the icon. See TooltipProp. | |
error? | string | Error from outside (e.g. a server action). If omitted, it is taken from the nearest Form's state.errors by the field's name. | |
messages? | Partial<Record<ValidityKey, ReactNode>> | Custom messages per validation rule. For rules not given, the browser's message (in the user's language) is shown. | |
errorDisplay? | ErrorDisplay | "message" | How the error is shown: "message" (below), "reserve" (below, with space reserved up front), "icon" / "icon-end" (an icon left/right of the label, message in the tooltip; the field's size never changes). If omitted, Form or UIProvider errorDisplay. See ErrorDisplay. |
className? | string | Classes added to the container. | |
classNames? | FieldClassNames | Classes added to the inner parts. |
SliderFieldProps
typeProps of the SliderField component.
Extends: Omit<SliderProps<V>, "className">
| Name | Type | Default | Description |
|---|---|---|---|
label | ReactNode | Visible label of the field. Required; the accessible name comes from it. | |
description? | ReactNode | Help text under the field. | |
tooltip? | TooltipProp | Hint shown with an ⓘ icon next to the label. For extra info that doesn't need to be visible all the time; write important info in description. Screen readers read it when reaching the icon. See TooltipProp. | |
error? | string | Error from outside (e.g. a server action). If omitted, it is taken from the nearest Form's state.errors by the field's name. | |
messages? | Partial<Record<ValidityKey, ReactNode>> | Custom messages per validation rule. For rules not given, the browser's message (in the user's language) is shown. | |
errorDisplay? | ErrorDisplay | "message" | How the error is shown: "message" (below), "reserve" (below, with space reserved up front), "icon" / "icon-end" (an icon left/right of the label, message in the tooltip; the field's size never changes). If omitted, Form or UIProvider errorDisplay. See ErrorDisplay. |
className? | string | Classes added to the container. | |
classNames? | FieldClassNames | Classes added to the inner parts. | |
showValue? | boolean | ((value: V) => ReactNode) | true | Show the selected value to the right of the label? If true, it is * written with format (for a range ₺500 – ₺2.500); with a function, the * returned content is shown. |