Skip to content

@vibe-labs/design-components-lists

List component tokens, styles, and TypeScript types for the Vibe Design System.

Installation

bash
npm install @vibe-labs/design-components-lists
css
@import "@vibe-labs/design-components-lists";
ts
import { ListVariants, ListSizes } from "@vibe-labs/design-components-lists/types";
import type { ListStyleProps, ListItemStyleProps } from "@vibe-labs/design-components-lists/types";

Contents

Tokens

CSS custom properties defined in @layer vibe.tokens (file: lists.css).

Container

TokenDefault
--list-bg--surface-base
--list-border-color--border-subtle
--list-border-width--border-width-1
--list-radius--radius-lg
--list-padding--space-1
--list-gap0

Item

TokenDefaultDescription
--list-item-height-sm2remSmall item height
--list-item-height-md2.5remMedium item height
--list-item-height-lg3remLarge item height
--list-item-px--space-3Horizontal padding
--list-item-gap--space-3Internal gap
--list-item-radius--radius-mdItem corner radius
--list-item-font-size-sm--text-xsSmall font size
--list-item-font-size-md--text-smMedium font size
--list-item-font-size-lg--text-baseLarge font size
--list-item-color--text-primaryText color
--list-item-bgtransparentDefault background
--list-item-hover-bg--surface-hover-overlayHover background
--list-item-active-bg--surface-active-overlayActive/press bg
--list-item-disabled-opacity--input-disabled-opacityDisabled opacity

Selection

TokenDefault
--list-item-selected-bgaccent @ 8% mix
--list-item-selected-color--text-primary
--list-item-selected-indicator--color-accent
--list-item-selected-indicator-width3px

Divider

TokenDefault
--list-divider-color--border-subtle
--list-divider-indent0

Icon

TokenDefault
--list-icon-size1.125rem
--list-icon-color--text-muted
--list-icon-active-color--color-accent

Description

TokenDefault
--list-description-font-size--text-xs
--list-description-color--text-muted

Trail

TokenDefault
--list-trail-color--text-muted
--list-trail-font-size--text-xs

Group

TokenDefault
--list-group-label-font-size--text-xs
--list-group-label-color--text-muted
--list-group-label-font-weight--font-semibold
--list-group-label-px--space-3
--list-group-label-py--space-2

Empty State

TokenDefault
--list-empty-py--space-8
--list-empty-color--text-muted
--list-empty-font-size--text-sm

Drag / Reorder

TokenDefault
--list-handle-color--text-muted
--list-handle-hover-color--text-secondary
--list-handle-size1rem
--list-dragging-opacity0.5
--list-dragging-shadow--shadow-lg
--list-drop-indicator-color--color-accent
--list-drop-indicator-height2px

Stripe

TokenDefault
--list-stripe-bg--surface-subtle

Generated Styles

Component classes generated into @layer vibe.components (file: lists.g.css).

Variants

VariantDescription
defaultSurface base bg, subtle border
outlinedTransparent bg, stronger border
elevatedElevated surface bg, drop shadow, no border
ghostNo bg, no border, no padding

Sizes

Set on container, cascades to items.

SizeMin-heightFont size
sm2remtext-xs
md2.5remtext-sm
lg3remtext-base

Item

Flex row with gap for icon, content, and trail. Supports data-selected, data-disabled, data-dragging, and data-drag-over states. Focus ring via focus-visible. Selected items show a left accent indicator via inset box-shadow.

Item Slots

ClassDescription
.list-item-iconLeading icon, accent-colored when selected
.list-item-contentFlex column wrapper for label + description
.list-item-labelPrimary text, truncated with ellipsis
.list-item-descriptionSecondary text, smaller + muted
.list-item-trailTrailing slot (actions, meta), auto-pushed right
.list-item-handleDrag grip, grab cursor, touch-action: none

Container Flags

FlagDescription
data-dividedAuto-inserts border-top between adjacent items
data-stripedAlternating row backgrounds on even items
data-hoverableHover bg transition on items
data-interactivePointer cursor + active press bg on items
data-flushStrips all container chrome (bg, border, radius, padding)
data-reorderableEnables drag/drop states (dragging opacity/shadow, drop indicator)

TypeScript Types

ts
ListVariants    // ["default", "outlined", "elevated", "ghost"]
ListSizes       // ["sm", "md", "lg"]

type ListVariant
type ListSize

interface ListStyleProps {
  variant?: ListVariant;
  size?: ListSize;
  divided?: boolean;
  striped?: boolean;
  hoverable?: boolean;
  interactive?: boolean;
  flush?: boolean;
  reorderable?: boolean;
}

interface ListItemStyleProps {
  selected?: boolean;
  disabled?: boolean;
  dragging?: boolean;
  dragOver?: boolean;
}

interface ListItemIconStyleProps {}
interface ListItemContentStyleProps {}
interface ListItemLabelStyleProps {}
interface ListItemDescriptionStyleProps {}
interface ListItemTrailStyleProps {}
interface ListItemHandleStyleProps {}
interface ListGroupStyleProps {}
interface ListGroupLabelStyleProps {}
interface ListDividerStyleProps {}
interface ListEmptyStyleProps {}

Dist Structure

FileDescription
index.cssBarrel — imports tokens + generated styles
lists.cssToken definitions
lists.g.cssGenerated component styles
index.js / index.d.tsTypeScript types + runtime constants

Dependencies

Requires tokens from @vibe-labs/design (colors, surfaces, borders, spacing, typography, transitions, elevation).

Build

bash
npm run build

Usage Guide

Import

css
@import "@vibe-labs/design-components-lists";
ts
import type { ListStyleProps, ListItemStyleProps } from "@vibe-labs/design-components-lists/types";

Variants

Variant

Set data-variant on .list: default · outlined · elevated · ghost

Size

Set data-size on .list: sm · md (default) · lg

Item states

Set on .list-item: data-selected · data-disabled · data-dragging · data-drag-over

Container flags

  • data-divided — borders between items
  • data-striped — alternating row backgrounds
  • data-hoverable — hover background on items
  • data-interactive — pointer cursor + active press state
  • data-flush — removes container chrome
  • data-reorderable — enables drag/drop visual states

Examples

Simple list

html
<!-- Default list with standard items -->
<ul class="list" role="list">
  <li class="list-item">Item one</li>
  <li class="list-item">Item two</li>
  <li class="list-item">Item three</li>
</ul>

List with icons, labels, descriptions, and trailing content

html
<ul class="list" data-variant="default" data-divided>
  <li class="list-item">
    <span class="list-item-icon">
      <svg><!-- icon --></svg>
    </span>
    <div class="list-item-content">
      <span class="list-item-label">Design System</span>
      <span class="list-item-description">CSS tokens, components, and Vue bindings</span>
    </div>
    <span class="list-item-trail">
      <span class="badge" data-variant="success-subtle" data-size="sm">Active</span>
    </span>
  </li>
  <li class="list-item">
    <span class="list-item-icon">
      <svg><!-- icon --></svg>
    </span>
    <div class="list-item-content">
      <span class="list-item-label">Analytics</span>
      <span class="list-item-description">Usage metrics and reporting</span>
    </div>
    <span class="list-item-trail">
      <span class="badge" data-variant="warning-subtle" data-size="sm">Beta</span>
    </span>
  </li>
</ul>

Interactive selectable list

html
<!-- Interactive list — items respond to click with cursor and active state -->
<ul class="list" data-interactive data-hoverable>
  <li class="list-item" data-selected>
    <div class="list-item-content">
      <span class="list-item-label">Selected item</span>
    </div>
  </li>
  <li class="list-item">
    <div class="list-item-content">
      <span class="list-item-label">Normal item</span>
    </div>
  </li>
  <li class="list-item" data-disabled>
    <div class="list-item-content">
      <span class="list-item-label">Disabled item</span>
    </div>
  </li>
</ul>

Grouped list with section labels

html
<ul class="list" data-variant="outlined">
  <li class="list-group">
    <div class="list-group-label">Pinned</div>
    <ul>
      <li class="list-item"><span class="list-item-label">Dashboard</span></li>
    </ul>
  </li>
  <li class="list-divider"></li>
  <li class="list-group">
    <div class="list-group-label">Recent</div>
    <ul>
      <li class="list-item"><span class="list-item-label">Project Alpha</span></li>
      <li class="list-item"><span class="list-item-label">Project Beta</span></li>
    </ul>
  </li>
</ul>

Reorderable list with drag handles

html
<ul class="list" data-reorderable data-hoverable>
  <li class="list-item">
    <span class="list-item-handle" aria-hidden="true">
      <svg><!-- drag grip icon --></svg>
    </span>
    <div class="list-item-content">
      <span class="list-item-label">Drag me</span>
    </div>
  </li>
  <!-- .list-item[data-dragging] and .list-item[data-drag-over] are set by JS -->
</ul>

Empty state

html
<ul class="list">
  <li class="list-empty">No items found.</li>
</ul>

With Vue

Use @vibe-labs/design-vue-lists for <SbList>, <SbListItem>, <SbListGroup>, and <SbListEmpty> components that accept ListStyleProps and ListItemStyleProps and handle drag-and-drop integration.

Vibe