FormActions

The submit and cancel row, already laid out.

import { FormActions } from '@textui/widgets';

<FormActions submitLabel="Save" onCancel={() => {}} />

Props

| Prop | Type | Default | | | — | — | — | — | | submitLabel | string | i18n.t('textui.formActions.submit', undefined, 'Submit') | | | cancelLabel | string | i18n.t('textui.formActions.cancel', undefined, 'Cancel') | | | onCancel | () => void | | | | tone | 'default' \| 'primary' \| 'secondary' \| 'accent' \| 'success' \| 'warning' \| 'danger' \| 'info' \| 'muted' | 'primary' | | | requireDirty | boolean | false | Disable submit until something changed. |

Plus everything on BoxProps.

Inside a Form it wires itself to the form’s submit and disables the button while the form is invalid or submitting - which is why the initial values are validated immediately, so form.valid is usable from the first frame rather than only after a keystroke.

requireDirty additionally disables submit until something has changed, for a settings screen where saving an unedited form is a pointless write.

See also


Back to top

MIT licensed. Pre-1.0 - the surface is still moving.