ul

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 left padding 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.

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.

Custom Markers

Use the data-marker attribute to replace default bullets with character tokens. Available markers: check, arrow, dash, and star.

Attribute Value Marker Color
data-marker="check" ✔ (check mark) --color-success
data-marker="arrow" ➤ (arrow) --color-interactive
data-marker="dash" ⁃ (dash) currentColor
data-marker="star" ★ (star) --color-interactive

Metadata List

The .meta class creates an inline list with separator characters between items. Ideal for article bylines, breadcrumbs, or tag displays.

Attribute Separator
(default) · (middle dot)
data-separator="pipe" | (pipe)
data-separator="dash" – (en dash)
data-separator="slash" / (slash)

Nested Lists

Lists can be nested to create hierarchical structures. Nested lists automatically change their bullet style at each level.

Navigation Usage

Unordered lists are commonly used for navigation menus. Wrap the list in a <nav> element for proper semantics.

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 class removes visual bullets but preserves list semantics. In Safari/VoiceOver, list-style: none may remove list semantics. To preserve them explicitly:

CSS Properties

Property Value Description
padding-inline-start var(--size-l) Left 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

Related

  • <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