Skip to content

Lists - AvList

✨ Introduction

The AvList component is a flexible and accessible container for displaying collections of items. It provides a structured way to present data in a vertical list format with extensive customization options for styling, sizing, and accessibility.

The AvList component is designed to work seamlessly with AvListItem components, offering consistent spacing, styling, and interaction patterns. It supports various visual configurations including borders, dividers, different sizes, and full accessibility compliance.

🏗️ Structure

The list consists of the following elements:

  • The container (div with role), mandatory: Main wrapper that contains all list items with proper semantic structure
  • List items (slot content), mandatory: Individual items rendered within the list, typically AvListItem components

The list integrates:

  • Flexible sizing system for different use cases
  • Optional visual enhancements (borders, dividers)
  • Full accessibility support with ARIA attributes
  • Customizable styling through CSS custom properties

🏷️ Props

NameTypeDefaultMandatoryDescription
backgroundColorstring'transparent'Background color of the list container.
borderColorstring'var(--stroke)'Border color used for borders and dividers.
borderRadiusstring'0'Border radius of the list container.
borderedbooleanfalseWhether to show a border around the entire list.
dividedbooleanfalseWhether to show dividers between list items.
size'xsmall' | 'small' | 'medium' | 'large''small'Size variant that controls item padding.
paddingstring'0'Custom padding for the list container.
ariaLabelstringAccessible label for the list.
ariaLabelledbystringID of an element that labels the list.
ariaDescribedbystringID of an element that describes the list.
role'list' | 'menu' | 'listbox' | 'group''list'Semantic role of the list for accessibility.

🔊 Events

None.

🎨 Slots

NameDescription
defaultDefault slot for AvListItem components or other content.

🚀 Storybook demos

You can find examples of use and demo of the component on its dedicated Storybook page.

💡 Examples of use

Basic List

vue
<template>
  <AvList>
    <AvListItem title="First Item" />
    <AvListItem title="Second Item" />
    <AvListItem title="Third Item" />
  </AvList>
</template>

Bordered List with Dividers

vue
<template>
  <AvList
    bordered
    divided
    size="medium"
    border-radius="var(--radius-md)"
  >
    <AvListItem
      title="Item 1"
      icon="mdi:home"
    />
    <AvListItem
      title="Item 2"
      icon="mdi:user"
    />
    <AvListItem
      title="Item 3"
      icon="mdi:settings"
    />
  </AvList>
</template>

Custom Styled List

vue
<template>
  <AvList
    background-color="var(--surface-alt)"
    border-color="var(--primary)"
    padding="var(--spacing-md)"
    size="large"
    aria-label="Navigation menu"
  >
    <AvListItem
      title="Dashboard"
      clickable
    />
    <AvListItem
      title="Profile"
      clickable
    />
    <AvListItem
      title="Settings"
      clickable
    />
  </AvList>
</template>
vue
<template>
  <AvList
    role="menu"
    aria-labelledby="menu-title"
    divided
    size="medium"
  >
    <AvListItem
      title="New Document"
      clickable
    />
    <AvListItem
      title="Open File"
      clickable
    />
    <AvListItem
      title="Save"
      clickable
    />
  </AvList>
</template>