List
Lists contain related items that are organized vertically.
Playground
- Item 1
- Item 2
- Item 3
which goes onto multiple lines to show line height
<List><ListItem>Item 1</ListItem><ListItem>Item 2</ListItem><ListItem>Item 3<br />which goes onto multiple lines to show line height</ListItem></List>
<ul class="stylized-list"><li>Item 1</li><li>Item 2</li><li>Item 3<br />which goes onto multiple lines to show line height</li></ul>
Checkmarks
The "checkmarks" feature replaces the bullets with checkmark icons.
- Item 1
- Item 2
- Item 3
<List skin="checkmark">...</List>
<ul class="stylized-list stylized-list-skin-checkmark">...</ul>
Minimal
The "minimal" feature removes the bullets from the list. This is useful for accessibility, as it allows you to use proper list semantics without visible list styling.
- Item 1
- Item 2
- Item 3
<List minimal>...</List>
<ul class="stylized-list stylized-list-minimal">...</ul>
Ordered List
A Ordered List replaces the bullets with stylized numbers.
- Item 1
- Item 2
- Item 3
- Item 1
- Item 2
- Item 3
- Item 3a
- Item 3b
- Item 3c
- Item 4
Link List
A Link List provides standard styling for a series of links. It is a common pattern in navigation; in particular, it is used inside Left Hand Navigation.
<><LinkListHeading>Link List Heading</LinkListHeading> {/* optional element */}<LinkList>{/* note: if a LinkList has a heading, it needs an aria-labelledbyattribute whose value is the id of the heading for that list */}<ListItem><a href="somehref">Item 1</a></ListItem><ListItem><a href="somehref">Item 2</a></ListItem><ListItem><a href="somehref">Item 3</a></ListItem></LinkList></>
<h3 class="link-list-heading" id="myExampleListHeading"><!-- optional element -->Link List Heading</h3><ul class="link-list" aria-labelledby="myExampleListHeading"><li><a href="somehref">Item 1</a></li><li><a href="somehref">Item 2</a></li><li><a href="somehref">Item 3</a></li></ul>
Link List using the "shaded" skin
<LinkList skin="shaded">...</LinkList>
<ul class="link-list link-list-skin-shaded">...</ul>
A list item can be "selected", which is used by some Link Lists (especially when part of Left Hand Navigation). This will give the selected item a different visual state, indicating that it's the page that the user is currently on. This item should not have a link inside it.
<GridContainer><Row><Column span={4}><LeftHandNavigation skin="button-menu"><LinkList><ListItem selected>Item 1</ListItem><ListItem><a href="somehref">Item 2</a></ListItem><ListItem><a href="somehref">Item 3</a></ListItem><ListItem><a href="somehref">Item 4</a></ListItem></LinkList></LeftHandNavigation></Column></Row></GridContainer>
Icon Bullet List
An Icon Bullet List allows you to set a custom icon for each item instead of a "bullet". These icons should be 32x32 pixels.
- Item 1
- Item 2
- Item 3
<IconBulletList><ListItem><IconBulletListIconsrc="https://picsum.photos/400/200"width={32}height={32}alt=""/><IconBulletListItem>Item 1</IconBulletListItem></ListItem><ListItem><IconBulletListIconsrc="https://picsum.photos/400/200?q=1"width={32}height={32}alt=""/><IconBulletListItem>Item 2</IconBulletListItem></ListItem><ListItem><IconBulletListIconsrc="https://picsum.photos/400/200?q=2"width={32}height={32}alt=""/><IconBulletListItem>Item 3</IconBulletListItem></ListItem></IconBulletList>
<IconBulletList><ListItem>{/* replace NN below with the height and width of the image */}<IconBulletListIcon src="somehref" width="NN" height="NN" alt="" /><IconBulletListItem>Item 1</IconBulletListItem></ListItem></IconBulletList>
<ul class="icon-bullet-list"><li><!-- replace NN below with the height and width of the image --><imgclass="icon-bullet-list-icon"src="somehref"width="NN"height="NN"alt=""/><div class="icon-bullet-list-contents">Item 1</div></li></ul>
Components
List
Prop | Type | Default | Description |
---|---|---|---|
skin | "standard" | "checkmark" | standard | The visual style of the list |
minimal | boolean | Use minimal style of the list |
All other props are forwarded to the element specified in thecomponent
prop(default: <ul/>
)
ListItem
ListItem
has no props of its own
All props are forwarded to the element specified in thecomponent
prop(default: <li/>
)
OrderedList
Prop | Type | Default | Description |
---|---|---|---|
skin | "standard" | "minimal" | "checkmark" | "shaded" | standard | The visual style of the list |
All other props are forwarded to the element specified in thecomponent
prop(default: <ol/>
)
LinkList
Prop | Type | Default | Description |
---|---|---|---|
skin | "standard" | "shaded" | standard | The visual style of the list |
All other props are forwarded to the element specified in thecomponent
prop(default: <ul/>
)
IconBulletList
IconBulletList
has no props of its own
All props are forwarded to the element specified in thecomponent
prop(default: <ul/>
)
IconBulletListIcon
IconBulletListIcon
has no props of its own
All props are forwarded to the element specified in thecomponent
prop(default: <img/>
)
LinkListHeading
LinkListHeading
has no props of its own
All props are forwarded to the element specified in thecomponent
prop(default: <h3/>
)
Guidelines
Usage
Lists are useful, efficient, and easily digestible by users. Use lists when describing steps, instructions, or rules. When using lists, make sure items are:
logically arranged
grouped in a meaningful manner
carry the same weight of importance
approximately the same length
Designer Guidelines
Lists have no inherent font size, and can use whatever font size is appropriate for the design.
A single list item can wrap to a second line.
A list can contain nested items.
Don't make a list too long or cause unnecessary scrolling.
Keep lists uniform by keeping to single lines, double lines, or nested lists.
Try not to mix list types.
When labeling lists and list items, do not mix passive and active voices.
Accessibility Guidelines
If a Link List has a heading, the Link List itself should have an aria-labelledby
attribute whose value is the id of the heading.