ActionList

ActionList is a vertical list of interactive actions or options. It's composed of items presented in a consistent, single-column format, with room for icons, descriptions, side information, and other rich visuals.

Page navigation navigation

React
readyNot reviewed for a11y
Rails
readyReviewed for a11y

React examples

Default

The simplest usage of an ActionList

Items with leading and trailing content

ActionList items can contain render non-interactive content, typically a visual such as an icon, before or after the item content.

Items with trailing actions

Similar to a trailing visual, except it triggers a secondary action when activated.

Trailing action guidelines

Items with dividers

Item dividers guidelines

Items with inline descriptions

Items with block descriptions

With a danger item

A variant used to highlight an action that requires extra attention from the user.

Danger item guidelines

With an inactive item

Inactive items that are non-functional due to some system state such as an outage.

Inactive item guidelines

  • Item one

With a loading item

Loading item guidelines

With a disabled item

Single-select

Selection state guidelines

Multi-select

Selection state guidelines

Grouping items with a heading

  • Items

  • Listings

Grouping items with a divider

More code examples

The previous examples are a curated subset of the full capabilities of the ActionList component. For more examples, see the ActionList Storybook stories.

Props

ActionList

NameRequiredDescription
children
Required
ActionList.Item[] | ActionList.LinkItem[] | ActionList.Group[]
variant
'inset' | 'full'
`inset` children are offset (vertically and horizontally) from list edges. `full` children are flush (vertically and horizontally) with list edges
selectionVariant
'single' | 'multiple'
Whether multiple items or a single item can be selected.
showDividers
boolean
Display a divider above each `Item` in this `List` when it does not follow a `Header` or `Divider`.
role
AriaRole
ARIA role describing the function of the list. `listbox` and `menu` are a common values.
sx
SystemStyleObject

ActionList.Item

NameRequiredDescription
children
Required
React.ReactNode | ActionList.LeadingVisual | ActionList.Description | ActionList.TrailingVisual
Primary content for an Item
variant
'default' | 'danger'
`danger` indicates that the item is destructive.
onSelect
(event: React.MouseEvent<HTMLLIElement> | React.KeyboardEvent<HTMLLIElement>) => void
Callback that is called when the item is selected using either the mouse or keyboard. `event.preventDefault()` will prevent a menu from closing when within an `<ActionMenu />`. This is not called for disabled or inactive items.
selected
boolean
Indicate whether the item is selected. Only applies to items that can be selected.
active
boolean
Indicate whether the item is active. There should never be more than one active item.
disabled
boolean
Items that are disabled can not be clicked, selected, or navigated to.
inactiveText
string
Text describing why the item is inactive. This may be used when an item's usual functionality is unavailable due to a system error such as a database outage. If there is a leading visual, the alert icon will replace the leading visual. If there is a trailing visual, it will replace the trailing visual. If there is no visual passed, it will be shown in the trailing visual slot to preserve left alignment of item content. Text will appear in a tooltip triggered by the alert icon in ActionList items, but text will appear below the description or title on ActionMenu items.
loading
boolean
Whether the item is loading.
role
AriaRole
ARIA role describing the function of the item. `option` is a common value.
id
string
id to attach to the root element of the Item
sx
SystemStyleObject

ActionList.Heading

NameRequiredDescription
children
Required
React.ReactNode
Use to give a heading to list
as
h1 | h2 | h3 | h4 | h5 | h6
The level of the heading
visuallyHidden
boolean
sx
SystemStyleObject

ActionList.LinkItem

NameRequiredDescription
children
Required
React.ReactNode | ActionList.LeadingVisual | ActionList.Description | ActionList.TrailingVisual
active
boolean
Indicate whether the item is active. There should never be more than one active item.
ref
React.RefObject<HTMLAnchorElement>
as
React.ElementType
inactiveText
string
Text describing why the item is inactive. This may be used when an item's usual functionality is unavailable due to a system error such as a database outage.
sx
SystemStyleObject

ActionList.LeadingVisual

NameRequiredDescription
children
Required
React.ReactNode
Icon (or similar) positioned before item text.
sx
SystemStyleObject

ActionList.TrailingVisual

NameRequiredDescription
children
Required
React.ReactNode
Visual positioned after item text.
sx
SystemStyleObject

ActionList.TrailingAction

NameRequiredDescription
as
a | button
HTML element to render as.
label
Required
string
Acccessible name for the control.
icon
Required
string
Octicon to pass into IconButton. When this is not set, TrailingAction renders as a `Button` instead of an `IconButton`.
href
string
href when the TrailingAction is rendered as a link.

ActionList.Description

NameRequiredDescription
children
Required
React.ReactNode
variant
'inline' | 'block'
`inline` descriptions are positioned beside primary text. `block` descriptions are positioned below primary text.
sx
SystemStyleObject
className
string | undefined
CSS string
truncate
boolean
Whether the inline description should truncate the text on overflow.

ActionList.GroupHeading

NameRequiredDescription
children
Required
React.ReactNode
Use to give a heading to the groups
variant
'filled' | 'subtle'
`filled` style has a background color and top and bottom borders. Subtle style has no background or borders.
auxiliaryText
string
Secondary text which provides additional information about a `Group`.
visuallyHidden
boolean
as
h1 | h2 | h3 | h4 | h5 | h6
The level of the heading and it is only required (enforce by runtime warning) for lists. (i.e. not required for ActionMenu or listbox roles)
sx
SystemStyleObject

ActionList.Group

NameRequiredDescription
children
Required
ActionList.Item[] | ActionList.LinkItem[]
title Deprecated
string
Please use `ActionList.GroupHeading` instead.
auxiliaryText
string
Secondary text that provides additional information about the group.
variant
'filled' | 'subtle'
`inline` descriptions are positioned beside primary text. `block` descriptions are positioned below primary text.
selectionVariant
'single' | 'multiple' | false
Set `selectionVariant` at the group level.
role
AriaRole
ARIA role describing the function of the list inside the group. `listbox` and `menu` are a common values.
sx
SystemStyleObject

ActionList.Divider

NameRequiredDescription
sx
SystemStyleObject