List
Lists provide layout and appearance for stacked, related content.
Also known as: content list, data list, description list, item list, list group, ordered list, panel list, scrollable list, tile list, unordered list
Bolt List
Permalink to "Bolt List"A List provides a container for List Items, as well as other non-interactive content.
Basic list
Permalink to "Basic list"<bolt-list>
<bolt-list-item>First item</bolt-list-item>
<bolt-list-item>Second item</bolt-list-item>
<bolt-list-item>Third item</bolt-list-item>
<bolt-list-item>Fourth item</bolt-list-item>
</bolt-list>
List sections
Permalink to "List sections"Headings, body copy, and Dividers can be used to organize list items into sections within a single list.
Settings
Manage your account preferences
Account & Security
<bolt-list>
<p class="bolt-list__heading">
Settings
</p>
<p class="bolt-list__copy">
Manage your account preferences
</p>
<bolt-divider></bolt-divider>
<bolt-list-item subtitle="Update your personal information">
Profile
</bolt-list-item>
<bolt-list-item subtitle="Manage notification preferences">
Notifications
</bolt-list-item>
<p class="bolt-list__heading">
Account & Security
</p>
<bolt-divider></bolt-divider>
<bolt-list-item subtitle="Password and authentication">
Security
</bolt-list-item>
<bolt-list-item subtitle="Data and privacy settings">
Privacy
</bolt-list-item>
</bolt-list>
Bolt List Item
Permalink to "Bolt List Item"A List Item should always be used inside a List. At minimum, it must include text content for its label.
<bolt-list>
<bolt-list-item>List item</bolt-list-item>
</bolt-list>
Supporting text may be added below the main label using its subtitle property.
<bolt-list>
<bolt-list-item subtitle="Supporting text">List item</bolt-list-item>
</bolt-list>
Semantic configuration
Permalink to "Semantic configuration"List items are rendered as either a button (default) or as a link.
Use the default button configuration for list items that trigger actions without navigation.
<bolt-list>
<bolt-list-item subtitle="Get your latest account statement">
Download Statement
</bolt-list-item>
</bolt-list>
Add the href attribute to render the list item as a navigable link.
<bolt-list>
<bolt-list-item href="/account-summary" subtitle="View your account details">
Account Summary
</bolt-list-item>
</bolt-list>
Optional features
Permalink to "Optional features"Leading icon
Permalink to "Leading icon"Add a leading icon to provide visual context for the list item.
<bolt-list>
<bolt-list-item subtitle="You have unread messages">
<bolt-icon decorative slot="leading" name="person"></bolt-icon>
Notifications
</bolt-list-item>
</bolt-list>
Trailing icon
Permalink to "Trailing icon"Add a trailing icon to indicate navigation or actions. Commonly used with chevrons.
<bolt-list>
<bolt-list-item subtitle="View and download your policies">
Policy Documents
<bolt-icon decorative slot="trailing" name="chevron-right"></bolt-icon>
</bolt-list-item>
</bolt-list>
Badge
Permalink to "Badge"A Badge on a list item indicates one or more notifications are available.
<bolt-list>
<bolt-list-item badgecount="3" subtitle="Items waiting for your review">
Pending Approvals
</bolt-list-item>
</bolt-list>
Patterns
Permalink to "Patterns"Combine the previous options to create rich, informative UI patterns.
<bolt-list>
<bolt-list-item href="/notifications" badgecount="5">
<bolt-icon decorative slot="leading" name="bell"></bolt-icon>
Notifications
<bolt-icon decorative slot="trailing" name="chevron-right"></bolt-icon>
</bolt-list-item>
</bolt-list>
<bolt-list>
<bolt-list-item subtitle="Get your latest account statement">
<bolt-icon decorative slot="leading" name="download"></bolt-icon>
Download Statement
</bolt-list-item>
<bolt-list-item subtitle="Send documents to others">
<bolt-icon decorative slot="leading" name="mail"></bolt-icon>
Share Documents
</bolt-list-item>
Navigation
Tasks
<bolt-list>
<p class="bolt-list__heading">Navigation</p>
<bolt-divider></bolt-divider>
<bolt-list-item href="#dashboard">
<bolt-icon decorative slot="leading" name="grid"></bolt-icon>
Dashboard
<bolt-icon decorative slot="trailing" name="chevron-right"></bolt-icon>
</bolt-list-item>
<bolt-list-item subtitle="View reports and insights" href="#analytics">
<bolt-icon decorative slot="leading" name="gauge"></bolt-icon>
Analytics
<bolt-icon decorative slot="trailing" name="chevron-right"></bolt-icon>
</bolt-list-item>
<bolt-list-item subtitle="Manage team members" href="#team" badgecount="2">
<bolt-icon decorative slot="leading" name="person"></bolt-icon>
Team
<bolt-icon decorative slot="trailing" name="chevron-right"></bolt-icon>
</bolt-list-item>
<p class="bolt-list__heading">Tasks</p>
<bolt-divider></bolt-divider>
<bolt-list-item subtitle="Finished yesterday">
<bolt-icon decorative slot="leading" name="checkmark-circle"></bolt-icon>
Completed task
</bolt-list-item>
<bolt-list-item subtitle="Due tomorrow" badgecount="3">
In progress
</bolt-list-item>
<bolt-list-item subtitle="Requires immediate attention" badgecount="1">
<bolt-icon decorative slot="leading" name="exclamation-circle"></bolt-icon>
Overdue task
<bolt-icon decorative slot="trailing" name="exclamation-triangle"></bolt-icon>
</bolt-list-item>
</bolt-list>
On this page
Bolt List
Permalink to "Bolt List"Syntax
Permalink to "Syntax"<bolt-list>
<!-- Optional: Light DOM heading, subheading, or divider -->
<bolt-list-item>...</bolt-list-item>
<!-- Optional: Light DOM headings, subheadings, or dividers -->
</bolt-list>
Slots
Permalink to "Slots"- default slot
- Accepts the following as children:
<bolt-list-item>elements<bolt-divider>elements- Light DOM content with the following classes:
.bolt-list__heading- Custom heading element.bolt-list__copy- Custom body copy element
- Accepts the following as children:
Bolt List Item
Permalink to "Bolt List Item"Syntax
Permalink to "Syntax"<bolt-list-item
[badgecolor="..."]
[badgecount="..."]
[datatestlistitem="..."]
[disabled]
[href="..."]
[subtitle="..."]
...
>
<!-- leading slot: optional bolt-icon -->
Label text
<!-- trailing slot: optional bolt-icon -->
</bolt-list-item>
Properties
Permalink to "Properties"In addition to global HTML attributes, the <bolt-list-item> custom element supports the following properties.
- badgecolor (optional)
- Sets the badge color.
- Values:
darkerror(default)light
- badgecount (optional)
- Configures the number count shown on the badge.
- Values:
1 ≤ badgecount- A minimum value of
1is required for the badge to appear. - Values below
2are not shown on the badge.
- A minimum value of
- datatestlistitem (optional)
- Configures the
[data-test]attribute on the underlying primary interactive element. - Default:
"list-item" - See also "Test selectors"
- Configures the
- disabled (optional)
- Boolean flag used to disable the list item.
- href (optional)
- Sets a URL to navigate to when the list item is clicked.
- This should only be used if the list item is being used as a link.
- When set, the component renders as an anchor element.
- subtitle (optional)
- Supporting text displayed below the main label text.
- Provides additional context or description for the list item.
Slots
Permalink to "Slots"-
default slot
- Accepts text content as the list item's label.
-
leading slot
- Accepts a
<bolt-icon>component.<bolt-icon>should be decorative.
- Displays on the left side of the list item.
- Accepts a
-
trailing slot
- Accepts a
<bolt-icon>component.<bolt-icon>should be decorative.
- Displays on the right side of the list item.
- Accepts a
Events
Permalink to "Events"click- Standard DOM click event emitted when the list item is clicked.
- Can be prevented by calling
preventDefault()on the event.
Internals
Permalink to "Internals"Test selectors
Permalink to "Test selectors"[data-test="list-item"]- Targets the primary interactive element.
- Value is configurable via the
datatestlistitemproperty.
Related components
Permalink to "Related components"Bolt List
Permalink to "Bolt List"General guidelines
Permalink to "General guidelines"- Lists provide layout patterns for stacked, related content. They can contain List items, Dividers, or non-interactive text.
- Lists commonly exist in Dialogs, but can also exist in other containers like panels and drawers or as standalone content on a page.
- Elements should remain in vertical alignment between List items.
- If one item in a List has a leading element and others do not, the label and supporting text within items without a leading element should be indented.
- Similarly in the trailing elements, if multiple items have Badges, but one had a trailing Icon and another does not, the Badges should remain vertically aligned.
- Headings and dividers should not be indented. Typically, headings should remain left aligned, and Dividers should fill the available width.
Generic lists
Permalink to "Generic lists"- Lists may contain several different types of elements, but most commonly a List item.
- Non-interactive headings, body copy or Dividers can also be used.
- It is recommended to use these sparingly.
- Avoid two headings appearing consecutively and two dividers appearing consecutively.
When to use
Permalink to "When to use"- Use when it is desired to present a specific set of options in specific areas of a page, instead of in the main navigation.
- Use when there are multiple actions or paths (at least 2-3 is advised) a user could take on a page and they have some relation to one another. For example, a profile dropdown could contain a List with links to messages, settings, and a log out button.
When not to use
Permalink to "When not to use"- Avoid using a List when the options are the main way users navigate or complete primary tasks for the page.
Do
- Do group similar options together and utilize Dividers or headings to organize the options.
- Do keep the number of options under 8-10, generally.
Don't
- Don't add a link to List headings or body copy.
- Don't use two headings or two dividers consecutively.
- Don't indent headings and dividers.
Content guidelines
Permalink to "Content guidelines"- Keep labels concise and direct by using action-oriented, easily understood language.
Bolt List Item
Permalink to "Bolt List Item"General guidelines
Permalink to "General guidelines"- A List item provides a consistent layout and appearance for semantic links and buttons in a List.
- List items should live inside a List component.
- List items should be interactive and only have one click target inside them.
- The whole element should be clickable.
- The structure of the List item includes:
- Leading element: area for leading Icon
- Body: area for List item label (required) and optional supporting text
- Trailing elements: area for a Badge and a separate area for a trailing Icon
- Elements should remain in vertical alignment between List items.
- If one item in a List has a leading element and others do not, the label and supporting text within items without a leading element should be indented.
- Similarly in the trailing elements, if multiple items have Badges, but one had a trailing Icon and another does not, the Badges should remain vertically aligned.
When to use
Permalink to "When to use"- When creating a List and an interactive element is needed.
When not to use
Permalink to "When not to use"- Avoid using List items outside of a List.
Do
- Do be mindful of label text length. Keep labels clear and concise.
- Do be mindful of how far apart List item labels and trailing elements get on larger screens. Large distances can lead to a loss of text/icon association.
Don't
- Don't try to make a List Item non-interactive.
Content guidelines
Permalink to "Content guidelines"- Keep labels concise and direct by using action-oriented, easily understood language.
- Labels should use sentence case unless there is a business line precedent.
- Avoid using ellipses if content gets cut off due to container size limitations. It is preferred to shorten the text or allow the text to wrap to multiple lines.
Best Practices
Permalink to "Best Practices"- Always use list items in a list. The
<bolt-list>component provides a semantic container for list items. - Include headings and body copy to provide clear context for the list's purpose when appropriate.
- List items automatically render as either a
<button>or<a>element depending on whether anhrefis provided.- Use
hreffor navigation actions (moving to a new page or section). - Use button mode (without
href) for in-page actions (filtering, selecting, opening dialogs, etc.).
- Use
- Ensure list items have clear, descriptive labels to help users understand their purpose.
- Avoid nesting interactive elements inside list items, as this can create accessibility issues.
Semantic structure
Permalink to "Semantic structure"- The
<bolt-list>component renders list items in a semantically appropriate container. - When using
<bolt-list-item>components within the list, ensure they are configured as either buttons or links depending on their function. - Screen readers will announce the list structure and navigate through items appropriately.
Content guidelines
Permalink to "Content guidelines"- Keep headings and list item labels concise and descriptive.
- Avoid relying solely on visual cues like icons or colors to convey meaning.
- When using dividers to separate content, ensure the grouping is also conveyed through headings or logical organization.
Built-in behavior
Permalink to "Built-in behavior"Button mode
Permalink to "Button mode"- When no
hrefis provided, the component renders as a semantic<button>element.- Buttons are included in the tab order and can be activated with keyboard (Space or Enter keys).
- Buttons receive visual focus indicators by default.
- Buttons emit a custom
clickevent that can be prevented by callingpreventDefault().
Link mode
Permalink to "Link mode"- When an
hrefis provided, the component renders as a semantic<a>element.- Links are included in the tab order and can be activated with keyboard (Enter key).
- Links receive visual focus indicators by default.
- Links support standard browser navigation features (right-click, open in new tab, etc.).
Keyboard navigation
Permalink to "Keyboard navigation"- Tab - Moves focus to the list item
- Shift+Tab - Moves focus to the previous focusable element
- Space - Activates the list item (button mode only)
- Enter - Activates the list item (both button and link modes)
Screen readers
Permalink to "Screen readers"- The slotted text is announced as the accessible name of the button or link.
- The optional
subtitletext is announced as additional descriptive content. - Badge counts are announced by screen readers when using the
badgecountattribute. - A slotted Icon's title will be announced by screen readers, unless it is marked as
decorative.
Known issues
Permalink to "Known issues"None at this time.
All Bolt components have gone through accessibility testing, but please keep our accessibility guidelines in mind.