Skip to content

@vibe-labs/design-components-lists

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

Usage

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 (lists.css)

CSS custom properties defined in @layer vibe.tokens:

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 (lists.g.css)

Component classes generated into @layer vibe.components.

Container

Flex column with background, border, and radius. Items stack vertically.

Variants

  • default — surface base bg, subtle border
  • outlined — transparent bg, stronger border
  • elevated — elevated surface bg, drop shadow, no visible border
  • ghost — no bg, no border, no padding

Sizes

Control item min-height and font-size. Set on container, cascades to items.

  • sm — 2rem / text-xs
  • md — 2.5rem / text-sm (default)
  • lg — 3rem / text-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

  • list-item-icon — leading icon, accent-colored when selected
  • list-item-content — flex column wrapper for label + description
  • list-item-label — primary text, truncated with ellipsis
  • list-item-description — secondary text, smaller + muted
  • list-item-trail — trailing slot (actions, meta), auto-pushed right
  • list-item-handle — drag grip, grab cursor, touch-action: none

Flags

  • divided — auto-inserts border-top between adjacent items
  • striped — alternating row backgrounds on even items
  • hoverable — hover bg transition on items
  • interactive — pointer cursor + active press bg on items
  • flush — strips all container chrome (bg, border, radius, padding)
  • reorderable — enables drag/drop states (dragging opacity/shadow, drop indicator)

Groups

Section wrapper with uppercase muted label.

Empty State

Centred muted text with generous vertical padding.

TypeScript Types (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