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
- Editing keys and selection - the keys, the selection and the clipboard
- Form - what it submits
- Button - for an action that is not a form submission