List

A component for displaying ordered or unordered lists with customizable markers and indicators.

Anatomy

<script>
  import { List, ListItem, ListIndicator } from "@saas-ui/svelte/components/list";
</script>

<List.Root>
  <ListItem>
    <ListIndicator />
    First item
  </ListItem>
  <ListItem>
    <ListIndicator />
    Second item
  </ListItem>
</List.Root>

Examples

Basic Accessibility

Basic unordered List with default marker style.

Nested Accessibility

Nested List structure with multiple levels of indentation.

Ordered Accessibility

Ordered list with numbered markers using the as="ol" prop.

With Icon Accessibility

List with custom icons as indicators using the ListIndicator component.

Props

Prop Type Default Description
variant marker | plain marker The visual style of the list.
align start | center | end start The alignment of list item content with indicators.
as ul | ol ul The HTML element to render.
class text - Additional CSS classes to apply.