Action Bar is composed of Actions which are typically used for core operations in the interface.
Overview
The design of Action Bar accommodates actions in vertical, horizontal, and grid layouts. Built from a group of Actions, the Action Bar handles properties like positioning, light/dark modes, and expansion controls.
Action Bar was created to be placed on the edges of an interface. For a floating group of Actions, enable the floating property. To prevent the automatic overflowing of Actions when there is limited space, enable the overflow property.
When using Action Bar, its parent should use the CSS Flexbox layout, like so:
html,
body {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
body {
display: flex;
}Sample
Usage
- Core functions and menus in an application
- Toolbar for the interface
- Set of Actions in a focused view
Text display behavior
In Action Bar, text visibility is controlled by both the Action Bar component and its child Action components.
- Action Bar's
expandedproperty togglestextfor all child ActionsEnabled - On initial load, Action's
textproperty determines whether an Action’s text is shown when the Action Bar is not expandedEnabled
The component only updates child text values when the expanded state is toggled. The Action Bar does not automatically manage text on initial render or when Actions are added dynamically, rather text should be set on each Action as needed.
When the Action Bar is not expanded, only Actions with text will display text, allowing for mixed configurations of labeled and icon-only Actions.
Accessibility
Keyboard navigation
| Key | Function |
|---|---|
Space | Presses the selected calcite-action. |
Enter | Presses the selected calcite-action. |
Tab | Move focus to next non-disabled calcite-action. If the currently focused step is the last step, the focus will leave the component. |
Tab and Shift | Move focus to previous non-disabled calcite-action. If the currently focused step is the first step, the focus will leave the component. |
Writing and copy
Refer to Action for writing and copy guidelines.
API reference
Properties
| Property | Attribute | Description | Type | Default |
|---|---|---|---|---|
| actionsEndGroupLabel | actions-end-group-label | Specifies an accessible name for the last | string | undefined | |
| actionsStartGroupLabel | actions-start-group-label | Specifies an accessible name for the first | string | undefined | |
| expandDisabled | expand-disabled | When | boolean | false |
| expanded | expanded | When | boolean | false |
| expandPosition | expand-position | Specifies the position of the expand | Extract<"start" | "end", Position> | "end" |
| floating | floating | When | boolean | false |
| layout | layout | Specifies the layout direction of the actions. | Extract<"horizontal" | "vertical" | "grid", Layout> | "vertical" |
| messageOverrides | Overrides individual strings used by the component. | Record<string, unknown> | undefined | ||
| overflowActionsDisabled | overflow-actions-disabled | When | boolean | false |
| overlayPositioning | overlay-positioning | Specifies the type of positioning to use for overlaid content, where:
| OverlayPositioning | "absolute" |
| position | position | When
When | Extract<"start" | "end", Position> | undefined | |
| scale | scale | Specifies the size of the expand | Scale | "m" |
| selectionAppearance | selection-appearance | Specifies the selection appearance of the component | Extract<"neutral" | "highlight", SelectionAppearance> | "neutral" |
Slots
| Name | Description |
|---|---|
| default (unnamed) | A slot for adding |
| actions-end | A slot for adding |
| actions-start | A slot for adding |
| expand-tooltip | A slot to set the |
Styles
| Name | Description |
|---|---|
| --calcite-action-bar-background-color | Specifies the component's background color. |
| --calcite-action-bar-corner-radius | Specifies the component's border radius when |
| --calcite-action-bar-expanded-max-width | When |
| --calcite-action-bar-items-space | Specifies the space between slotted components in the component. |
| --calcite-action-bar-shadow | Specifies the component's shadow when |
Events
| Name | Description | Behavior |
|---|---|---|
| calciteActionBarCollapse | Fires when the component's content area is collapsed. | |
| calciteActionBarExpand | Fires when the component's content area is expanded. | |
| calciteActionBarToggle | Fires when the |
Methods
| Name | Description | Signature |
|---|---|---|
| componentOnReady | Creates a promise that resolves once the component is fully loaded. | componentOnReady(): Promise<this> |
| setFocus | Sets focus on the component's first focusable element. | setFocus(options?: FocusOptions): Promise<void> |