DocsComponentsTemplatesThemesGitHub

List

Inset grouped list with optional header and footer; holds ListRow items.

Code

import * as React from 'react';
import { CountBadge, List, ListRow, Switch } from '@fruit-labs/design';

export default function Demo() {
  return (
    <div
      style={{
        background: 'var(--surface-2)',
        padding: 16,
        borderRadius: 22,
        maxWidth: 420,
      }}
    >
      <List header="General" footer="Changes apply to all devices.">
        <ListRow
          icon="bell"
          iconColor="var(--tile-cherry)"
          title="Notifications"
          trailing={<CountBadge count={3} />}
          href="#"
        />
        <ListRow
          icon="moon"
          iconColor="var(--tile-grape)"
          title="Dark mode"
          trailing={<Switch label="Dark mode" />}
        />
        <ListRow
          icon="grid"
          iconColor="var(--tile-tangerine)"
          title="Storage"
          value="128 GB"
          href="#"
        />
      </List>
    </div>
  );
}

Install

From npm:

npm install @fruit-labs/design

import { List } from '@fruit-labs/design';

Or copy the TypeScript source into your project:

npx shadcn@latest add https://design.fruitlabs.online/r/list.json

Guidelines

  • Settings and navigation lists. Rows are 52 tall; separators start after the icon tile.

Props

PropTypeRequired
headerReact.ReactNodeNo
footerReact.ReactNodeNo
classNamestringNo
styleReact.CSSPropertiesNo
childrenReact.ReactNodeNo

Edit this example on GitHub