Form API
import { Form } from '@editora/ui-react';
Props
| Prop | Type | Description |
|---|---|---|
autosave | boolean | |
autosaveDelay | number | |
children | React.ReactNode | |
density | 'default' | 'compact' | 'comfortable' | |
description | string | |
disabled | boolean | |
elevation | 'default' | 'none' | 'low' | 'high' | |
errors | Record<string, string | null | undefined> | null | Errors to show on the named fields, typically from a server response ({ email: 'Already registered' }). Each new object is applied once and focuses the first field with an error; an error clears when its field is edited or the form is submitted again. The element's setErrors() / clearErrors() do the same imperatively. |
gap | string | |
guardUnsaved | boolean | |
heading | string | |
headless | boolean | |
loading | boolean | |
loadingText | string | |
novalidate | boolean | |
onAutosave | (values: Record<string, any>) => void | |
onDirtyChange | (dirty: boolean, values: Record<string, any>) => void | |
onInvalid | (errors: Record<string, string | undefined>, values: Record<string, any>) => void | |
onSubmit | (values: Record<string, any>) => void | |
onValidate | (result: { valid: boolean; errors: Record<string, string | undefined> }) => void | |
shape | 'default' | 'square' | 'soft' | |
state | 'default' | 'success' | 'warning' | 'error' | |
stateText | string | |
tone | 'default' | 'brand' | 'success' | 'warning' | 'danger' | |
variant | 'default' | 'surface' | 'outline' | 'soft' | 'contrast' | 'minimal' | 'elevated' |
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Form.Actions props
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Form.Status props
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Form.Title props
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Element: <ui-form>
Form renders the ui-form custom element from @editora/ui-core, which can also be used without React.
Attributes: aria-label, aria-labelledby, autosave, autosave-delay, density, description, dirty, disabled, elevation, gap, guard-unsaved, heading, headless, loading, loading-text, novalidate, shape, state, state-text, title, tone, variant
Events: autosave, dirty-change, invalid, submit, validate