form
converting
Section titled “converting”effectValidator
Section titled “effectValidator”const effectValidator: <S>( self, options?,) => StandardSchemaV1<S["Encoded"], S["Type"]> & S = Schema.toStandardSchemaV1;Effect’s maintained Standard Schema adapter, including nested issue paths.
Returns a “Standard Schema” object conforming to the Standard Schema v1 specification.
Details
This function creates a schema whose validate method attempts to decode and
validate the provided input synchronously. If the underlying Schema includes
any asynchronous components (e.g., asynchronous message resolutions or checks),
then validation will necessarily return a Promise instead.
Example (Creating a standard schema from a regular schema)
import { Schema } from "effect";
// Define custom hook functions for error formattingconst leafHook = (issue: any) => { switch (issue._tag) { case "InvalidType": return "Expected different type"; case "InvalidValue": return "Invalid value provided"; case "MissingKey": return "Required property missing"; case "UnexpectedKey": return "Unexpected property found"; case "Forbidden": return "Operation not allowed"; case "OneOf": return "Multiple valid options available"; default: return "Validation error"; }};
// Create a standard schema from a regular schemaconst PersonSchema = Schema.Struct({ name: Schema.NonEmptyString, age: Schema.Finite.check(Schema.isBetween({ minimum: 0, maximum: 150 })),});
const standardSchema = Schema.toStandardSchemaV1(PersonSchema, { leafHook,});
// The standard schema can be used with any Standard Schema v1 compatible libraryconst validResult = standardSchema["~standard"].validate({ name: "Alice", age: 30,});const invalidResult = standardSchema["~standard"].validate({ name: "", age: 200,});
if (validResult instanceof Promise || invalidResult instanceof Promise) { throw new Error("Expected synchronous validation");}if ("value" in validResult) { validResult.value; // => { name: "Alice", age: 30 }}invalidResult.issues?.map((issue) => issue.path); // => [["name"], ["age"]]Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
S extends ConstraintDecoder<unknown, never> |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
self |
S |
options? |
{ } |
Returns
Section titled “Returns”StandardSchemaV1<S["Encoded"], S["Type"]> & S
Stability
Section titled “Stability”stable
4.0.0
fieldError()
Section titled “fieldError()”function fieldError(meta): string | undefined;First readable TanStack string error or Standard Schema issue.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
meta |
{ errors: readonly unknown[]; } |
meta.errors |
readonly unknown[] |
Returns
Section titled “Returns”string | undefined
FormFieldsProps
Section titled “FormFieldsProps”type FormFieldsProps<V> = object;Props accepted by FormFields.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
V extends FormValues |
Properties
Section titled “Properties”model: SchemaFormModel<V>;names?
Section titled “names?”optional names?: readonly keyof V & string[];Render only these fields, in this order, without section headings.
disabled?
Section titled “disabled?”optional disabled?: boolean;Disable every field, such as while an uncertain request is retried.
FormFields()
Section titled “FormFields()”function FormFields<V>(__namedParameters): (Element | null)[];Render a schema form’s fields from its schema: every section in order, or only
names (for placing fields in Screen cells or custom layouts).
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
V extends Readonly<Record<string, FieldInput>> |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
__namedParameters |
FormFieldsProps<V> |
Returns
Section titled “Returns”(Element | null)[]
FieldInput
Section titled “FieldInput”type FieldInput = | string | number | boolean | null | undefined | readonly string[] | readonly File[];The raw input one field holds: text, a number (or empty), a flag, or a set of chosen values or files. The schema turns it into the domain value at submit.
FormValues
Section titled “FormValues”type FormValues = Readonly<Record<string, FieldInput>>;The raw values a schema form holds: one entry per field name.
FieldKind
Section titled “FieldKind”type FieldKind = | "text" | "email" | "url" | "tel" | "textarea" | "secret" | "money" | "date" | "number" | "select" | "combobox" | "file" | "radio" | "icon-radio" | "checkbox" | "switch" | "checkboxes" | "icon-checkboxes";Every control a schema field can render as.
OptionAnnotation
Section titled “OptionAnnotation”type OptionAnnotation = object;One choice’s presentation, keyed by its value in options.
Properties
Section titled “Properties”label?
Section titled “label?”readonly optional label?: string;description?
Section titled “description?”readonly optional description?: string;A sentence under the label; radio options with one render as cards.
readonly optional meta?: string;A short readout on a radio card’s trailing edge, such as a price.
readonly optional icon?: ReactNode;A Sigil or App icon: choices with icons render as icon keys.
caption?
Section titled “caption?”readonly optional caption?: string;The short legend on an icon key; label stays the accessible name.
disabled?
Section titled “disabled?”readonly optional disabled?: boolean;FieldRenderProps
Section titled “FieldRenderProps”type FieldRenderProps<T> = object;What a render annotation receives: the same wiring every built-in kind gets.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
T extends FieldInput |
FieldInput |
Properties
Section titled “Properties”readonly name: string;readonly label: string;readonly help: ReactNode;readonly value: T;onBlur
Section titled “onBlur”readonly onBlur: () => void;Mark the field visited, so its error shows.
Returns
Section titled “Returns”void
readonly error: string | undefined;The visible error, after the person leaves the field or submits.
disabled
Section titled “disabled”readonly disabled: boolean;readonly id: string;Put these on the control so the Field’s label, help and error name it.
aria-describedby
Section titled “aria-describedby”readonly aria-describedby: string | undefined;aria-invalid
Section titled “aria-invalid”readonly aria-invalid: boolean;Methods
Section titled “Methods”onChange()
Section titled “onChange()”onChange(value): void;Set the field’s raw value; validation runs as it would for a built-in kind.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
value |
T |
Returns
Section titled “Returns”void
FieldAnnotation
Section titled “FieldAnnotation”type FieldAnnotation<T> = object;Presentation for one schema field. The schema stays the single source.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
T extends FieldInput |
FieldInput |
Properties
Section titled “Properties”label?
Section titled “label?”readonly optional label?: string;The visible label and accessible name; defaults to the humanized key.
readonly optional help?: string;readonly optional kind?: FieldKind;Overrides the kind inferred from the schema type.
placeholder?
Section titled “placeholder?”readonly optional placeholder?: string;section?
Section titled “section?”readonly optional section?: string;The sections key this field sits in; unsectioned fields come first.
order?
Section titled “order?”readonly optional order?: number;Sort position within its section; fields keep schema order otherwise.
layout?
Section titled “layout?”readonly optional layout?: "stacked" | "row";row puts the control opposite its label (a settings row).
required?
Section titled “required?”readonly optional required?: boolean;optional?
Section titled “optional?”readonly optional optional?: boolean;Marks an optional field in a mostly required form.
readonly optional icon?: ReactNode;A decorative Sigil or App icon before the label.
options?
Section titled “options?”readonly optional options?: Readonly<Record<string, string | OptionAnnotation>>;Labels, help and icons for literal choices, keyed by value.
currency?
Section titled “currency?”readonly optional currency?: string;readonly optional unit?: string;readonly optional min?: number;readonly optional max?: number;readonly optional step?: number;readonly optional wrap?: boolean;readonly optional rows?: number;maxLength?
Section titled “maxLength?”readonly optional maxLength?: number;autoComplete?
Section titled “autoComplete?”readonly optional autoComplete?: string;accept?
Section titled “accept?”readonly optional accept?: string;Native file-picker filter; the schema owns file-type validation.
multiple?
Section titled “multiple?”readonly optional multiple?: boolean;maxBytes?
Section titled “maxBytes?”readonly optional maxBytes?: number;Per-file byte limit, enforced by the field’s schema check.
readOnly?
Section titled “readOnly?”readonly optional readOnly?: boolean;Methods
Section titled “Methods”when()?
Section titled “when()?”optional when(values): boolean;Show the field only while this holds for the current raw values.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
values |
FormValues |
Returns
Section titled “Returns”boolean
render()?
Section titled “render()?”optional render(field): ReactNode;The bailout: draw this field’s control yourself. Caps still owns the label, help, error, layout, validation and save bar.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
field |
FieldRenderProps<T> |
Returns
Section titled “Returns”ReactNode
SectionAnnotation
Section titled “SectionAnnotation”type SectionAnnotation = object;A titled group of fields, declared on the struct.
Properties
Section titled “Properties”readonly title: string;description?
Section titled “description?”readonly optional description?: string;FieldMeta
Section titled “FieldMeta”Holds a field annotation inside schema annotations (Effect or Zod).
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new FieldMeta(annotation): FieldMeta;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
annotation |
FieldAnnotation |
Returns
Section titled “Returns”Properties
Section titled “Properties”annotation
Section titled “annotation”readonly annotation: FieldAnnotation;SectionsMeta
Section titled “SectionsMeta”Holds the section list inside a struct’s annotations.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new SectionsMeta(sections): SectionsMeta;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
sections |
Readonly<Record<string, SectionAnnotation>> |
Returns
Section titled “Returns”Properties
Section titled “Properties”sections
Section titled “sections”readonly sections: Readonly<Record<string, SectionAnnotation>>;FieldAnnotations
Section titled “FieldAnnotations”type FieldAnnotations = Record<`caps/form:${number}`, FieldMeta> & object;Schema annotations for one field: Effect .annotate() or Zod .meta().
Type Declaration
Section titled “Type Declaration”| Name | Type |
|---|---|
title? |
string |
description? |
string |
SectionAnnotations
Section titled “SectionAnnotations”type SectionAnnotations = object;Schema annotations for a struct’s sections.
Properties
Section titled “Properties”caps/form
Section titled “caps/form”readonly caps/form: SectionsMeta;field()
Section titled “field()”function field<T>(annotation): FieldAnnotations;Annotate a schema field for forms. Works with Effect
(Schema.String.annotate(field({ … }))) and Zod
(z.string().meta(field({ … }))). label and help also become the schema’s
title and description.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
T extends FieldInput |
FieldInput |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
annotation |
FieldAnnotation<T> |
Returns
Section titled “Returns”sections()
Section titled “sections()”function sections(list): SectionAnnotations;Annotate a struct with its sections, in display order.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
list |
Readonly<Record<string, SectionAnnotation>> |
Returns
Section titled “Returns”Secret
Section titled “Secret”const Secret: brand<String, "Secret">;A key or token: masked, never autofilled, with a reveal key.
ResolvedOption
Section titled “ResolvedOption”type ResolvedOption = object;One choice, resolved for rendering.
Properties
Section titled “Properties”readonly value: string;readonly label: string;description
Section titled “description”readonly description: string | undefined;readonly meta: string | undefined;readonly icon: ReactNode;caption
Section titled “caption”readonly caption: string | undefined;disabled
Section titled “disabled”readonly disabled: boolean;ResolvedField
Section titled “ResolvedField”type ResolvedField = Omit<FieldAnnotation, "options" | "kind" | "help"> & object;One field, resolved from the schema for rendering.
Type Declaration
Section titled “Type Declaration”| Name | Type |
|---|---|
help |
string | undefined |
name |
string |
label |
string |
kind |
FieldKind |
options |
readonly ResolvedOption[] |
optionalInSchema |
boolean |
index |
number |
ResolvedSection
Section titled “ResolvedSection”type ResolvedSection = object;A section and its fields, in display order.
Properties
Section titled “Properties”readonly id: string | null;readonly title: string | undefined;description
Section titled “description”readonly description: string | undefined;fields
Section titled “fields”readonly fields: readonly ResolvedField[];FormDescription
Section titled “FormDescription”type FormDescription = object;Everything a form needs from its schema.
Properties
Section titled “Properties”sections
Section titled “sections”readonly sections: readonly ResolvedSection[];fields
Section titled “fields”readonly fields: readonly ResolvedField[];defaults
Section titled “defaults”readonly defaults: FormValues;describeSchema()
Section titled “describeSchema()”function describeSchema(schema): FormDescription;Read a form’s fields, sections and empty defaults from its schema.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
schema |
| ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>> | Top |
Returns
Section titled “Returns”FormSchema
Section titled “FormSchema”type FormSchema<V, Out> = Schema.Codec<Out, V> | z.ZodType<Out, V>;A form schema: an Effect Schema.Struct (the house path) or a Zod object. V
is the raw input the controls hold; Out is what the submit receives.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
V extends FormValues |
FormValues |
Out |
unknown |
standardSchema()
Section titled “standardSchema()”function standardSchema<V, Out>(schema): StandardSchemaV1<V, Out>;The schema as a Standard Schema validator for TanStack Form.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
V extends Readonly<Record<string, FieldInput>> |
Out |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
schema |
FormSchema<V, Out> |
Returns
Section titled “Returns”StandardSchemaV1<V, Out>
FormField()
Section titled “FormField()”function FormField< TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync, TFormOnServer, TSubmitMeta,>(__namedParameters): Element;TanStack field binding with Caps labels, descriptions, errors, and control ARIA.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
TParentData |
TName extends string |
TData |
TOnMount extends FieldValidateOrFn<TParentData, TName, TData> | undefined |
TOnChange extends FieldValidateOrFn<TParentData, TName, TData> | undefined |
TOnChangeAsync extends FieldAsyncValidateOrFn<TParentData, TName, TData> | undefined |
TOnBlur extends FieldValidateOrFn<TParentData, TName, TData> | undefined |
TOnBlurAsync extends FieldAsyncValidateOrFn<TParentData, TName, TData> | undefined |
TOnSubmit extends FieldValidateOrFn<TParentData, TName, TData> | undefined |
TOnSubmitAsync extends FieldAsyncValidateOrFn<TParentData, TName, TData> | undefined |
TOnDynamic extends FieldValidateOrFn<TParentData, TName, TData> | undefined |
TOnDynamicAsync extends FieldAsyncValidateOrFn<TParentData, TName, TData> | undefined |
TFormOnMount extends FormValidateOrFn<TParentData> | undefined |
TFormOnChange extends FormValidateOrFn<TParentData> | undefined |
TFormOnChangeAsync extends FormAsyncValidateOrFn<TParentData> | undefined |
TFormOnBlur extends FormValidateOrFn<TParentData> | undefined |
TFormOnBlurAsync extends FormAsyncValidateOrFn<TParentData> | undefined |
TFormOnSubmit extends FormValidateOrFn<TParentData> | undefined |
TFormOnSubmitAsync extends FormAsyncValidateOrFn<TParentData> | undefined |
TFormOnDynamic extends FormValidateOrFn<TParentData> | undefined |
TFormOnDynamicAsync extends FormAsyncValidateOrFn<TParentData> | undefined |
TFormOnServer extends FormAsyncValidateOrFn<TParentData> | undefined |
TSubmitMeta |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
__namedParameters |
FieldComponentProps<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync, TFormOnServer, TSubmitMeta, { }> & Pick<FieldProps, | "required" | "optional" | "orientation" | "className" | "label" | "description"> |
Returns
Section titled “Returns”Element
SubmissionState
Section titled “SubmissionState”type SubmissionState = object;Values read by the submit action from TanStack’s form store.
Properties
Section titled “Properties”canSubmit
Section titled “canSubmit”canSubmit: boolean;isSubmitting
Section titled “isSubmitting”isSubmitting: boolean;SubmitFooterProps
Section titled “SubmitFooterProps”type SubmitFooterProps = Omit<FormFooterProps, "children"> & object;Footer presentation plus the submit action; TanStack owns availability and busy state.
Type Declaration
Section titled “Type Declaration”| Name | Type | Description |
|---|---|---|
form |
object |
- |
form.Subscribe() |
(props) => ReactNode |
TanStack’s reactive selector component. |
label |
ReactNode |
- |
disabled? |
boolean |
- |
buttonProps? |
Omit<ButtonProps, "type" | "disabled" | "loading" | "children" | "onClick" | "asChild"> |
- |
SubmitFooter()
Section titled “SubmitFooter()”function SubmitFooter(__namedParameters): Element;Submit button subscribed to TanStack’s canSubmit/isSubmitting store state.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
__namedParameters |
SubmitFooterProps |
Returns
Section titled “Returns”Element
SubmitResult
Section titled “SubmitResult”type SubmitResult<V> = | { kind: "saved"; values?: V; message?: string; } | { kind: "refused"; error?: string; fields?: Partial<Readonly<Record<keyof V & string, string>>>; };What a submit handler reports. Return nothing (or saved) when the change
landed; return refused with a form-level error and/or per-field fields
messages when the server said no. Field messages clear when that field changes;
the form message clears on the next change anywhere.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
V extends FormValues |
Union Members
Section titled “Union Members”Type Literal
Section titled “Type Literal”{ kind: "saved"; values?: V; message?: string;}| Name | Type | Description |
|---|---|---|
kind |
"saved" |
- |
values? |
V |
The new baseline; defaults to the submitted values. Clear secrets here. |
message? |
string |
Replaces the default “Saved” readout. |
Type Literal
Section titled “Type Literal”{ kind: "refused"; error?: string; fields?: Partial<Readonly<Record<keyof V & string, string>>>;}SchemaFormOptions
Section titled “SchemaFormOptions”type SchemaFormOptions<V, Out> = object;Options accepted by useSchemaForm and an unbound SchemaForm.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
V extends FormValues |
Out |
Properties
Section titled “Properties”schema
Section titled “schema”schema: FormSchema<V, Out>;The single source: an Effect Schema.Struct (house path) or a Zod object. It
validates raw input, parses the submitted value, and its annotations (field,
sections) give labels, kinds, help, options, order and grouping.
defaultValues
Section titled “defaultValues”defaultValues: V;The raw values to start from, such as the saved settings.
onSubmit
Section titled “onSubmit”onSubmit: (value, raw) => | Promise<SubmitResult<V> | undefined> | Promise<void> | SubmitResult<V> | undefined;Receives the parsed value, never the raw input.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
value |
Out |
raw |
V |
Returns
Section titled “Returns”| Promise<SubmitResult<V> | undefined> |
Promise<void> | SubmitResult<V> | undefined
Validator
Section titled “Validator”type Validator<V> = StandardSchemaV1<V, unknown>;The schema as TanStack validates it: raw values in, any output.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
V |
SchemaFormApi
Section titled “SchemaFormApi”type SchemaFormApi<V> = ReactFormExtendedApi< V, undefined, Validator<V>, undefined, undefined, undefined, Validator<V>, undefined, undefined, undefined, undefined, unknown>;The TanStack form a schema form owns: typed values, schema validators.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
V extends FormValues |
SchemaFormModel
Section titled “SchemaFormModel”type SchemaFormModel<V> = object;The model returned by useSchemaForm and read by SchemaForm, FormFields and SaveBar.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
V extends FormValues |
Properties
Section titled “Properties”description
Section titled “description”readonly description: FormDescription;The fields, kinds and sections read from the schema.
readonly form: SchemaFormApi<V>;TanStack’s typed form: read values with useSelector(model.form.store, …).
readonly error: string | null;The last refused submit’s form-level message.
readonly saved: string | null;The last landed submit’s readout, until the next change.
discard
Section titled “discard”readonly discard: () => void;Restore the baseline values and clear every message.
Returns
Section titled “Returns”void
submit
Section titled “submit”readonly submit: () => Promise<void>;Submit through the schema; the same path as the native submit event.
Returns
Section titled “Returns”Promise<void>
useSchemaForm()
Section titled “useSchemaForm()”function useSchemaForm<V, Out>(options): SchemaFormModel<V>;One form, declared by its schema. TanStack owns field state and timing; the
schema owns validation and parses the submitted value; the handler only sees
parsed data and reports saved or refused.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
V extends Readonly<Record<string, FieldInput>> |
Out |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
SchemaFormOptions<V, Out> |
Returns
Section titled “Returns”SchemaFormStatus
Section titled “SchemaFormStatus”type SchemaFormStatus = object;Live status for leave guards and save bars.
Properties
Section titled “Properties”dirty: boolean;Values differ from the baseline.
submitting
Section titled “submitting”submitting: boolean;canSubmit
Section titled “canSubmit”canSubmit: boolean;Validation allows a submit right now.
useSchemaFormStatus()
Section titled “useSchemaFormStatus()”function useSchemaFormStatus<V>(model): SchemaFormStatus;Subscribe to a schema form’s dirty and submitting state.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
V extends Readonly<Record<string, FieldInput>> |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
model |
SchemaFormModel<V> |
Returns
Section titled “Returns”SchemaFormPresentation
Section titled “SchemaFormPresentation”type SchemaFormPresentation = object & Omit<FormProps, "busy" | "onSubmit" | "noValidate" | "children">;How a SchemaForm presents its actions and state.
Type Declaration
Section titled “Type Declaration”| Name | Type | Description |
|---|---|---|
submitLabel? |
ReactNode |
The primary action’s label; defaults to “Save changes”. |
discardLabel? |
ReactNode |
Show a Discard action while there are unsaved changes. |
allowClean? |
boolean |
Keep the primary action available on a clean form (create forms). |
footer? |
ReactNode |
Replaces the SaveBar, such as a footer with a retry key; null drops it. |
children? |
ReactNode |
Replaces the generated field list, for custom layouts such as Screen cells: place fields with <FormFields model names={[…]} />. |
disabled? |
boolean |
Disable every field, such as while an uncertain request is retried. |
SchemaFormProps
Section titled “SchemaFormProps”type SchemaFormProps<V, Out> = SchemaFormPresentation & | { model: SchemaFormModel<V>;}| SchemaFormOptions<V, Out>;Props accepted by SchemaForm: a model from useSchemaForm, or its options.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
V extends FormValues |
Out |
SchemaForm()
Section titled “SchemaForm()”function SchemaForm<V, Out>(props): Element;A whole form from its schema: fields, sections, validation, busy state and the
SaveBar. Pass schema, defaultValues and onSubmit, or a model from
useSchemaForm when the page needs its status or a custom layout.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
V extends Readonly<Record<string, FieldInput>> |
Out |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
props |
SchemaFormProps<V, Out> |
Returns
Section titled “Returns”Element
SaveBarProps
Section titled “SaveBarProps”type SaveBarProps<V> = object & Omit<FormFooterProps, "children" | "error" | "status">;Props accepted by SaveBar.
Type Declaration
Section titled “Type Declaration”| Name | Type | Description |
|---|---|---|
model |
SchemaFormModel<V> |
- |
label |
ReactNode |
The primary action, such as “Save changes” or “Create Team”. |
discardLabel? |
ReactNode |
Show a Discard action while there are unsaved changes. |
allowClean? |
boolean |
Keep the primary action available on a clean form (create forms that may submit their defaults). By default a clean form has nothing to save. |
dirtyLabel? |
ReactNode |
The quiet readout while there are unsaved changes. |
buttonProps? |
Omit<ButtonProps, "type" | "disabled" | "loading" | "children" | "onClick" | "asChild"> |
- |
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
V extends FormValues |
SaveBar()
Section titled “SaveBar()”function SaveBar<V>(__namedParameters): Element;The form’s action row: the refused-submit error, a quiet “Unsaved changes” or “Saved” readout, an optional Discard, and the one primary submit.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
V extends Readonly<Record<string, FieldInput>> |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
__namedParameters |
SaveBarProps<V> |
Returns
Section titled “Returns”Element