List
Use this component to vertically group related text-only items. Use an ordered list to communicate a specific priority, hierarchy, or sequence. Use an unordered list when the order of the items is not important.
#Examples
The main difference between the two components is that the items in the ordered list component feature numbers, while the items in the unordered list feature bullets.
#Default unordered list
Here you can see an example of the default appearance of an unordered list.
- Darth Vader
- Luke Skywalker
- Princess Leia
<Ul items={["Darth Vader", "Luke Skywalker", "Princess Leia"]} />
#Default ordered list
Here you can see an example of the default appearance of an ordered list.
- Star Wars: Episode IV – A New Hope (1977)
- Star Wars: Episode V – The Empire Strikes Back (1980)
- Star Wars: Episode VI – Return of the Jedi (1983)
<Ol
items={[
"Star Wars: Episode IV – A New Hope (1977)",
"Star Wars: Episode V – The Empire Strikes Back (1980)",
"Star Wars: Episode VI – Return of the Jedi (1983)",
]}
/>
#Nested lists
List components can be nested inside each other, as you can see in the example below. Nested lists do not have to be of the same type as the parent list.
- Original trilogy
- Star Wars: Episode IV – A New Hope (1977)
- Star Wars: Episode V – The Empire Strikes Back (1980)
- Star Wars: Episode VI – Return of the Jedi (1983)
- Prequel trilogy
- Star Wars: Episode I – The Phantom Menace (1999)
- Star Wars: Episode II – Attack of the Clones (2002)
- Star Wars: Episode III – Revenge of the Sith (2005)
- Sequel trilogy
- Star Wars: Episode VII – The Force Awakens (2015)
- Star Wars: Episode VIII – The Last Jedi (2017)
- Star Wars: Episode IX – The Rise of Skywalker (2019)
<Ol
items={[
<>
Original trilogy
<Ol
items={[
"Star Wars: Episode IV – A New Hope (1977)",
"Star Wars: Episode V – The Empire Strikes Back (1980)",
"Star Wars: Episode VI – Return of the Jedi (1983)",
]}
/>
</>,
<>
Prequel trilogy
<Ol
items={[
"Star Wars: Episode I – The Phantom Menace (1999)",
"Star Wars: Episode II – Attack of the Clones (2002)",
"Star Wars: Episode III – Revenge of the Sith (2005)",
]}
/>
</>,
<>
Sequel trilogy
<Ol
items={[
"Star Wars: Episode VII – The Force Awakens (2015)",
"Star Wars: Episode VIII – The Last Jedi (2017)",
"Star Wars: Episode IX – The Rise of Skywalker (2019)",
]}
/>
</>,
]}
/>
#Properties
#Unordered list
- Darth Vader
- Luke Skywalker
- Princess Leia
Property | Description | Defined | Value |
---|---|---|---|
itemsRequired | element[] Items displayed in the list | ||
data-observe-keyOptional | string Unique string, used by external script e.g. for event tracking | ||
classNameOptional | string Custom className that's applied to the outermost element (only intended for special cases) | ||
styleOptional | object Style object to apply custom inline styles (only intended for special cases) |
#Ordered list
- Star Wars: A New Hope (1977)
- Star Wars: The Empire Strikes Back (1980)
- Star Wars: Return of the Jedi (1983)
Property | Description | Defined | Value |
---|---|---|---|
itemsRequired | element[] Items displayed in the list | ||
data-observe-keyOptional | string Unique string, used by external script e.g. for event tracking | ||
classNameOptional | string Custom className that's applied to the outermost element (only intended for special cases) | ||
styleOptional | object Style object to apply custom inline styles (only intended for special cases) |
#Guidelines
#Best practices
#Do not use when
#Accessibility
Explore detailed guidelines for this component: Accessibility Specifications