Skip to main content
Version: Next

Form API

import { Form } from '@editora/ui-react';

Props​

PropTypeDescription
autosaveboolean
autosaveDelaynumber
childrenReact.ReactNode
density'default' | 'compact' | 'comfortable'
descriptionstring
disabledboolean
elevation'default' | 'none' | 'low' | 'high'
errorsRecord<string, string | null | undefined> | nullErrors 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.
gapstring
guardUnsavedboolean
headingstring
headlessboolean
loadingboolean
loadingTextstring
novalidateboolean
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'
stateTextstring
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