FormActions

The submit and cancel row, already laid out.

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

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

Props

| Prop | Type | Default | | | — | — | — | — | | submitLabel | string | 'Submit' | | | cancelLabel | string | '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

  • Form - what it submits
  • Button - for an action that is not a form submission

Back to top

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