Skip to main content

Actions

Usage

Definition

Actions are functions that work like buttons but are styled like links. Actions can apply to a whole page (e.g. Print), or a component (e.g. Add to Workbook) or be nested in a menu.

Common Characteristics

Actions function like buttons but are styled like links. Actions have hover, focused and disabled states.

Options

Actions can be text or an icon or an icon + link pair. To preserve screen real estate actions can be placed in a menu. Action menus are opened with a label + down chevron (e.g. More ⌵, Actions ⌵, etc) or a kabob icon (). Similar actions can be grouped in the menu using a horizontal divider. The Actions Menu is right-aligned with the action that opens it but can be left- or center-aligned.

Usage Guidelines

Use Action Menus to reduce clutter at the top of a page. Avoid more than two page-level actions.

Use Action Menus to reduce clutter on cards.

Actions that also indicate a status (e.g. Add to workbook or Set Lane Alert) should not be nested in a menu.

Examples

Page actions appear in the top-right of the screen.

Display no more than two actions on the page.

Nest actions in an Actions Menu when more than two are needed.

Design

Display no more than two utilities on the page.

Code

Actions are <Button variant="actionLink"/> elements with all props (other than those specified) passed through untouched. As such, onClick methods ought to be provided to each Action. This has been omitted in the examples for brevity.

Default Action

Icons can be appended to (placed before) or prepended to (placed after) the label. If no label, only the addOn(s) will show.

Live Editor
Result
Loading...

with icon on right

Live Editor
Result
Loading...

with icon on right and left

Live Editor
Result
Loading...

Actions can group many Action components

Live Editor
Result
Loading...

more than one

Live Editor
Result
Loading...

with actions prop

Live Editor
Result
Loading...

Actions adjust display count with the show prop

Live Editor
Result
Loading...

with actions prop

Live Editor
Result
Loading...

Actions adjust text display with iconOnly prop

The iconOnly prop only affects the shown actions. All actions in the menu will display with complete icons and labels.

Live Editor
Result
Loading...

with actions prop

Live Editor
Result
Loading...

Actions adjust icon display with textOnly prop

The textOnly prop only affects the shown actions. All actions in the menu will display with complete icons and label.

Live Editor
Result
Loading...

with actions prop

Live Editor
Result
Loading...

Actions menu opener label changes with the menuLabel prop

Live Editor
Result
Loading...

Actions in the menu can be visibly separated

Similar actions can be grouped by a horizontal divider.

Live Editor
Result
Loading...

with actions prop

Live Editor
Result
Loading...

Actions align menu with menuAlignment prop

menuAlignment pertains to the alignment of the link menu in relation to the opener button. Menu will always be either above or below the trigger depending on the available visible space and will align to the right edge by default.

Align "left"

Live Editor
Result
Loading...

Align "center"

Live Editor
Result
Loading...

Align "right" (default)

Live Editor
Result
Loading...

The container here is for illustrative purposes only.

Actions can be updated externally

In the following example, the labelState will update on any click of any of the Action buttons. The state is visible in the labels as On or Off and update as the buttons are interacted upon.

Live Editor
Result
Loading...

Actions can be paired with different props

This example shows how two different and unique actions may be used in a component.

Live Editor
Result
Loading...

Actions can be modified with display variants

Variant list

This example shows how to display the actions in a vertical manner, still allowing for a "more" menu to show if desired.

Live Editor
Result
Loading...

Variant panel-list

This example shows how to display the actions in a vertical manner which mimics the "more" panel, still allowing for a "more" menu to show if desired.

Live Editor
Result
Loading...

Props

Actions

NameTypeDefaultDescription
actionobjectA single Action to be displayed. All keys are passed as props to the created Action.
actionsobject[]One or more Action elements to be displayed. All keys are passed as props to the created Action.
childrennodeAction and Actions.Spacer elements.
classNamestring
iconOnlyboolTurns off text labels for Actions visible outside of the menu.
menuAlignmentstring"right"Aligns the menu panel to the menu trigger.
menuLabelstring"More"Changes the menu trigger label.
textOnlyboolTurns off icons for Actions visible outside of the menu.
shownumber, "all"2Determines the number of Actions to display in addition to a menu trigger.
variantstringWill change the display to either list or panel-list. panel-list is used to mimic the hover states of the actions in the "more" panel.

Action

NameTypeDefaultDescription
classNamestring
addOnPrependstringName of glyph to show before the label.
addOnAppendstringName of glyph to show after the label.
iconOnlyboolRemoves the label from the Action.
inlineboolRemoves minimum size constraints.
labelstringText to display in the Action.
textOnlyboolRemoves all icons from the Action.

Panel

NameTypeDefaultDescription
alignstring"left"Sets an alignment class leveraged by the Actions menu trigger.

Spacer

None available.