The unordered list element represents a collection of items where the sequence does not matter.
Description
The <ul> element creates a bulleted list of items. Each item is wrapped in an <li> element. Use unordered lists when the order of items is not meaningful or does not affect the content's meaning.
By default, items are displayed with disc-style bullet markers and start-side padding (left in left-to-right text, right in right-to-left) for indentation.
When to Use
- Feature lists or bullet points
- Navigation menus (wrap in
<nav>)
- Collections of links or resources
- Tag or category listings
- Metadata lines (
.meta variant)
- Any group where sequence does not matter
When Not to Use
- For sequential steps or ranked items — use
<ol>
- For term-definition pairs — use
<dl>
- For groups of action buttons — use
<menu>
- For tabular data — use
<table>
Default
Standard unordered list with bullet markers.
123456
<ul> <li>First item in the list</li> <li>Second item in the list</li> <li>Third item in the list</li> <li>Fourth item in the list</li></ul>
Variants
.inline
Display list items horizontally using flexbox. Removes bullets and arranges items in a row with gap spacing.
.unstyled
Remove bullets and indentation for custom styling or navigation menus.
123456
<ul class="inline" role="list"> <li>Home</li> <li>About</li> <li>Services</li> <li>Contact</li></ul>
123456
<ul class="unstyled" role="list"> <li>No bullets here</li> <li>Just plain text</li> <li>Useful for navigation</li> <li>Or custom layouts</li></ul>
Custom Markers
Use the data-marker attribute to replace default bullets with character tokens. Available markers: check, arrow, dash, and star. The marker applies only to the list's direct items, so a nested list keeps its own bullets or numbers. In right-to-left text the arrow points left, using the mirrored glyph of the same pair.
The markers are decorative. Each glyph has empty alternative text (content: "✔" / ""), so screen readers announce the item text, not "heavy check mark". A data-marker="check" list therefore carries no state: it says nothing to assistive technology about whether anything is done. For a real task list use checkboxes, for example <input type="checkbox"> inside <form-field> or a <label>.
1234567891011121314151617
<ul data-marker="check"> <li>Free shipping</li> <li>30-day returns</li></ul> <ul data-marker="arrow"> <li>Navigate here</li> <li>Go to settings</li></ul> <ul data-marker="dash"> <li>Minimal style</li></ul> <ul data-marker="star"> <li>Featured item</li></ul>
| Attribute Value |
Marker |
Token |
Color |
data-marker="check" |
✔ (check mark) |
--marker-check |
--color-success |
data-marker="arrow" |
▸ (right-pointing triangle; ◂ in RTL) |
--marker-arrow, --marker-arrow-rtl |
--color-interactive |
data-marker="dash" |
⁃ (hyphen bullet) |
--marker-dash |
currentColor |
data-marker="star" |
★ (star) |
--marker-star |
--color-interactive |
Metadata List
The .meta class creates an inline list with separator characters between items. Ideal for article bylines, version facts or tag displays. The separators are decorative and have empty alternative text, so screen readers do not read "dot" or "slash" between items.
Not for breadcrumbs: a breadcrumb trail is navigation, with an ordered list, aria-current="page" and direction-aware separators. Use nav.breadcrumb or <bread-crumb>.
12345678910
<ul class="meta" role="list"> <li>Jane Smith</li> <li><time datetime="2024-01-15">Jan 15, 2024</time></li> <li>5 min read</li></ul> <ul class="meta" role="list" data-separator="pipe">...</ul><ul class="meta" role="list" data-separator="dash">...</ul><ul class="meta" role="list" data-separator="slash">...</ul>
| Attribute |
Separator |
Token |
| (default) |
· (middle dot) |
--sep-list |
data-separator="pipe" |
| (pipe) |
--sep-pipe |
data-separator="dash" |
– (en dash) |
--sep-ndash |
data-separator="slash" |
/ (slash) |
--sep-slash |
Nested Lists
Lists can be nested to create hierarchical structures. Nested lists automatically change their bullet style at each level.
12345678910111213141516
<ul> <li>Fruits <ul> <li>Apples</li> <li>Oranges</li> <li>Bananas</li> </ul> </li> <li>Vegetables <ul> <li>Carrots</li> <li>Broccoli</li> </ul> </li> <li>Grains</li></ul>
Navigation Usage
Unordered lists are commonly used for navigation menus. Wrap the list in a <nav> element for proper semantics.
12345678
<nav aria-label="Example navigation"> <ul class="unstyled"> <li><a href="#">Home</a></li> <li><a href="#">Products</a></li> <li><a href="#">About Us</a></li> <li><a href="#">Contact</a></li> </ul></nav>
Accessibility
Screen Reader Behavior
- Announced as "list" with item count (e.g., "list, 4 items")
- Each item announced as "list item" with position
- Nested lists are announced with their own item counts
Best Practices
- Use semantic list markup instead of styled elements for list content
- Do not remove list semantics with
role="presentation" unless intentional
- For navigation, wrap in
<nav> with aria-label
- Avoid deeply nested lists (3+ levels) as they become hard to navigate
Safari / VoiceOver
The .unstyled, .inline and .meta classes remove the visual bullets with list-style: none. Most browsers still expose the list, but Safari with VoiceOver may stop announcing it as one. Add role="list" to keep the semantics explicitly, as every sample on this page does. Safari keeps list semantics for a list inside <nav>, so navigation menus do not need it:
123
<ul class="unstyled" role="list"> <li>Item with explicit list role</li></ul>
CSS Properties
| Property |
Value |
Description |
padding-inline-start |
var(--size-l) |
Start-side indentation for list items |
Variant: .inline
| Property |
Value |
display |
flex |
flex-wrap |
wrap |
gap |
var(--size-s) |
list-style |
none |
Variant: .unstyled
| Property |
Value |
padding-inline-start |
0 |
list-style |
none |
Variant: .meta
| Property |
Value |
display |
flex (wrapping, items centred) |
color |
var(--color-text-muted) |
font-size |
var(--font-size-s) |
list-style |
none |
li + li::before |
content: var(--sep-list) / "", padding-inline: 0.35em |
.inline, .unstyled and .meta work on <ol> as well. data-marker is for <ul> only.
Custom Properties
The separator and marker glyphs are character tokens defined in src/tokens/characters.css. Override them on :root or on a single list:
| Property |
Default |
Used by |
--sep-list |
· (U+00B7) |
.meta |
--sep-pipe |
| (U+007C) |
.meta[data-separator="pipe"] |
--sep-ndash |
– (U+2013) |
.meta[data-separator="dash"] |
--sep-slash |
/ (U+002F) |
.meta[data-separator="slash"] |
--marker-check |
✔ (U+2714) |
data-marker="check" |
--marker-arrow |
▸ (U+25B8) |
data-marker="arrow" |
--marker-arrow-rtl |
◂ (U+25C2) |
data-marker="arrow" under :dir(rtl) |
--marker-dash |
⁃ (U+2043) |
data-marker="dash" |
--marker-star |
★ (U+2605) |
data-marker="star" |
1234
.byline { --sep-list: "\2022";}
Related
- Typography guide — marker variants, metadata lists and the character tokens behind them
<ol> — Ordered list for sequential items
<li> — List item element (required child)
<dl> — Definition list for term-description pairs
<menu> — Semantic container for action button groups
<nav> — Navigation landmark for menu lists