Skip to content

ActionButtonProps

ActionButtonProps = object & Omit<ButtonSlotProps, ActionButtonControlledProps>

Defined in: packages/ui/src/types.ts:1162

Props for the ActionButton component.

Wraps a @cfast/actions action with permission-aware behavior and optional confirmation dialog. Extends ButtonSlotProps (excluding internally controlled props) so all button styling options are available.

action: ActionHookResult

Action hook result from useActions(), providing permission status and submit function.

children: ReactNode

Button label content.

optional confirmation: string | ConfirmOptions

Confirmation message or options shown before executing the action.

optional href: string

When provided, renders a permission-gated link instead of a form button. The link navigates to href when the action is permitted.

optional input: Record<string, string | number | boolean | null | undefined>

When provided, submits a form with these values as hidden fields via action.submit(). Eliminates manual <Form> + <input type="hidden">.

optional whenForbidden: WhenForbidden

Behavior when the action is not permitted. Defaults to “disable”.