Skip to content

List

An enterprise-grade list component based on BrConfigProvider for global theme configuration, supporting grouping, selection, and virtual scrolling.

Features

  • 📦 Comprehensive Capabilities: Supports list grouping, dividers, loading states, empty states, nested collapsing, and other enterprise-grade requirements.
  • 🎨 Theme Configuration: Based on BrConfigProvider, supports global variable configuration and seamless dark mode switching.
  • Virtual Scrolling: Built-in virtual scrolling capability to easily handle large data rendering.
  • ⌨️ Keyboard Navigation: Perfect accessibility experience, supports up/down key navigation, and Enter to trigger selection.

Basic List and Interactive States

Provides basic list layout and supports interactive states such as hoverable and clickable.

Notification Settings
Messages
System Announcements
Preferences
You can change these settings at any time
Example

Grouped List and Dividers

Use BrListGroup and BrListDivider for list item partitioning and separation.

R&D Department
Zhang San (Frontend Engineer)
Li Si (Backend Engineer)
Design Department
Wang Wu (UI Designer)
Zhao Liu (UX Designer)
Example

Selectable and Active States

Supports single or multiple selection logic, distinguishing the current list item through selected and active states.

Shanghai
Beijing
Guangzhou
Shenzhen
Example

Virtual Scrolling Large Data List

For scenarios with thousands or tens of thousands of data items, enable virtualScroll to achieve high-performance scrolling.

Example

API

BrList

The core container component.

PropertyTypeDefaultDescription
size'sm' | 'default' | 'lg''default'Global size of the list
variant'default' | 'bordered' | 'ghost''default'Appearance variant of the list
hoverablebooleanfalseGlobally enable hover effects for list items
clickablebooleanfalseGlobally enable clickable effects for list items
selectablebooleanfalseGlobally enable selectable effects for list items
stripedbooleanfalseWhether to show zebra stripes
loadingbooleanfalseWhether to show the loading state
disabledbooleanfalseGlobally disable the list
virtualScrollbooleanfalseWhether to enable virtual scrolling
itemsany[][]Data source for virtual scrolling
itemHeightnumber40Estimated height of list items for virtual scrolling

BrListItem

The list item component.

PropertyTypeDefaultDescription
align'start' | 'center' | 'end''center'Internal alignment
disabledbooleanfalseDisable the current item
activebooleanfalseActive state style
selectedbooleanfalseSelected state style

Slots

  • default: Main content
  • extra: Extra content on the right (action buttons/badges)
  • nested: Nested sub-list content
  • expand-icon: Custom expand icon

BrListGroup

The list group component.

PropertyTypeDefaultDescription
titlestring-Group title

BrListHeader / BrListFooter / BrListDivider / BrListEmpty / BrListLoading

Auxiliary structural components, supporting custom styles via class.

Theme Customization

BrList is deeply integrated with BrConfigProvider, supporting the following two levels of theme customization:

1. Global Configuration (BrConfigProvider)

Adjust the default color system of BrList by configuring the application root node.

vue
<script setup lang="ts">
import { BrConfigProvider, BrList, BrListItem } from '@breezeui/vue'

const themeConfig = {
  theme: 'dark', // Automatically switch List background and text colors in dark mode
  radius: 0.75, // Affects the border radius of variant="bordered"
}
</script>

<template>
  <BrConfigProvider :theme="themeConfig">
    <BrList variant="bordered" hoverable>
      <BrListItem>Supports Dark Mode</BrListItem>
    </BrList>
  </BrConfigProvider>
</template>

2. Local Override (TailwindCSS)

You can precisely override any default style using Tailwind atomic classes by passing the class property.

vue
<template>
  <!-- Custom background and border color -->
  <BrList class="bg-blue-50 border-blue-200 dark:bg-blue-900/20" variant="bordered">
    <!-- Override hover and selected colors -->
    <BrListItem class="hover:bg-blue-100 dark:hover:bg-blue-800" selected>
      Customized List Item
    </BrListItem>
  </BrList>
</template>