Skip to content
Stylhero 0.8.0
Components

Core

Layout and type

Inputs

Overlays

Navigation

Data display

Charts

Transitions and utilities

Page pieces (landing pages, portfolios, docs)

Icons

Components / Data display

List

Bordered list of rows, e.g. customers or recent visits.

import { List } from "@stylhero/ui";

Example

Code
import { Avatar, Badge, List, ListItem } from "@stylhero/ui";

function ListExample() {
  return (
    <List subheader="Recent builds">
      <ListItem title="Starter build" description="$899 · 1080p" leading={<Avatar name="Starter" size="sm" />} trailing={<Badge tone="success">Saved</Badge>} />
      <ListItem title="Creator build" description="$1,890 · 4K editing" leading={<Avatar name="Creator" size="sm" />} onClick={() => {}} />
      <ListItem title="Archived" description="Not editable" disabled onClick={() => {}} />
    </List>
  );
}

Props

PropTypeDefaultDescription
dense boolean - Tighter rows.
plain boolean - No border or background, for lists inside cards and drawers.
subheader ReactNode - Small heading above the rows (MUI's ListSubheader).

Also takes every <ul> attribute (id, style, data-*, aria-*, event handlers…), passed to that element.

Generated from src/components/List.tsx. Something wrong or missing? Open an issue.