ActionButton
ActionButton(
props):Element|null
Defined in: packages/ui/src/components/action-button.tsx:29
Permission-aware button that submits a @cfast/actions action.
Accepts an ActionHookResult from useActions() and renders a button
via the UI plugin’s button slot. The button’s visibility and disabled
state are controlled by the action’s permission status. Extra props are
forwarded to the underlying button component.
whenForbidden="hide"— hidden when not permittedwhenForbidden="disable"— shown but disabled when not permitted (default)whenForbidden="show"— shown and clickable regardless of permission
Parameters
Section titled “Parameters”See ActionButtonProps.
Returns
Section titled “Returns”Element | null
Example
Section titled “Example”<ActionButton action={publishPost} whenForbidden="disable" confirmation="Publish this post?"> Publish</ActionButton>