Action Bar Button
An action bar button is a single bulk-action trigger inside an action-bar. It uses a native <button> element and requires an accessible label so the action is unambiguously announced to assistive technology.
Use it for each bulk operation surfaced in the action bar — for example, delete, archive, move, share, or export — alongside other action bar buttons.
Implementation Notes
- Uses a native
<button>element for inherent keyboard and accessibility support labelprop is required and renders asaria-label- Defaults to
type="button"to prevent accidental form submissions - Native
disabledattribute prevents click events automatically - Children render the visual content (icon and/or text) and are decorative for AT (the
aria-labelis the source of truth)
Props
label: string (required) -- aria-labeltype: "button" | "submit" | "reset" (default: "button")disabled: boolean (default: false)onclick/onClick: callback (optional) -- click handlerchildren: slot -- the button content (icon and/or text)...restProps: any additional HTML attributes
Usage
<ActionBarButton label="Delete" onClick={handleDelete}>
Delete
</ActionBarButton>
Disabled action:
<ActionBarButton label="Move to folder" disabled>
Move
</ActionBarButton>
Keyboard Interactions
- Tab: Focus the button
- Enter: Activate the button
- Space: Activate the button
- (All handled natively by
<button>element)
ARIA
- Implicit
buttonrole from<button>element aria-labelis the accessible name (required)aria-disabledfrom nativedisabledattribute
When to Use
- Use inside an
action-barto surface a bulk operation - Use when the operation acts on the currently selected items
- Use a clear, action-verb label (e.g., "Delete", "Archive")
When Not to Use
- Do not use outside of an
action-bar— useButtonorIconButtoninstead - Do not omit
label— buttons without an accessible name fail WCAG
Composition
The action bar button is a child of action-bar:
<ActionBar label="Bulk actions" selectedCount={2} selectedCountLabel="2 selected">
<ActionBarButton label="Delete">Delete</ActionBarButton>
<ActionBarButton label="Archive">Archive</ActionBarButton>
</ActionBar>
Headless
Renders a native <button> with the required aria-label. The icon, text, focus indicator, hover state, and any visual treatment are entirely the consumer's responsibility.
Styles
Consumer CSS targets the action-bar-button class. Provide a clear focus indicator and hover/active visual feedback. Maintain a 44×44 px touch target.
Testing
- Verify the component renders a
<button>element with classaction-bar-button - Verify
aria-labelequals thelabelprop - Verify
typedefaults to"button" - Verify
disabledattribute is applied whendisabledis true - Verify the click handler fires on Enter, Space, and click
Advice
- Designers: Use a consistent visual treatment across all action bar buttons in a single bar.
- Developers: Always supply a
labelprop. Include an icon plus visible text whenever space allows.
Related components
action-bar— a contextual action bar that appears when items are selected, showing the selection count and bulk action buttons
References
- WAI-ARIA Button Pattern: https://www.w3.org/WAI/ARIA/apg/patterns/button/
- Adobe Spectrum Action Bar: https://spectrum.adobe.com/page/action-bar/
- WCAG 4.1.2 Name, Role, Value: https://www.w3.org/WAI/WCAG22/Understanding/name-role-value