Skip to content

ActionMenubar

ActionMenubar renders a flat set of command actions from @cratis/components/Common. Use it for page-level actions; use Toolbar for a canvas-style tool palette with active tools, groups, folders, or fan-out panels.

import { ActionMenubar } from '@cratis/components/Common';
<ActionMenubar
aria-label='Project actions'
model={[
{ label: 'Create project', command: createProject },
{ label: 'Archive', command: archiveProject, severity: 'warn' },
{ label: 'Delete', command: deleteProject, severity: 'danger', disabled: true },
]}
/>;

The root is a div with role='toolbar' and data-cratis-part='root'. Pass aria-label to set the toolbar’s accessible name.

FieldTypePurpose
labelstringVisible button label.
iconReactNodeContent rendered before the label.
command() => voidInvoked when the action is activated.
disabledbooleanDisables the action button.
classNamestringExtra class name for the action button.
severityButtonSeverityMaps the action severity to a button tone.
template(item: ActionMenuItem) => ReactNodeFully replaces rendering for this menu item.

When template is present, ActionMenubar renders its result directly instead of rendering a Components Button. The item’s severity, disabled, and className, the shared pt, and the normal button label, icon, and command wiring therefore do not apply unless the template implements them.

PropTypeRequiredPurpose
modelActionMenuItem[]YesActions rendered from left to right.
classNamestringNoExtra class name for the toolbar root.
aria-labelstringNoAccessible name for the toolbar.
ptButtonPartsNoPart attributes applied to every non-template action button.
ptOptionsobjectNoDeprecated, retained for source compatibility, and ignored.
unstyledbooleanNoDeprecated, retained for source compatibility, and ignored.

pt is the ButtonParts surface, not a toolbar-root parts object. It is passed to each Button created from the model. Use className to identify the ActionMenubar root.

  • DataPage — the list-page composition that uses ActionMenubar for its action row
  • Toolbar — canvas-style tool palettes
  • Stable component parts — Components-owned parts and state attributes