List Item

ListItem provides a composable row for menus and selection controls.

Marketing assets
24 files, edited today
tsx
import { RiFolderLine } from '@remixicon/react';
import { ListItem } from '@/components/ui/wideset/list-item/ListItem';

<ListItem>
  <ListItem.Prefix>
    <RiFolderLine className="size-ws-9" />
  </ListItem.Prefix>
  <ListItem.Content>
    <ListItem.Label>Marketing assets</ListItem.Label>
    <ListItem.Description>24 files, edited today</ListItem.Description>
  </ListItem.Content>
</ListItem>

Installation

pnpm dlx wideset add list-item

Copies the component and any Wideset components it uses into your project.

Examples

Variants

danger marks a row whose action destroys something, such as Delete or Leave team, and keeps it apart from the rest of the menu. Everything else is primary.

tsx
import { RiDeleteBinLine, RiFileCopyLine } from '@remixicon/react';
import { ListItem } from '@/components/ui/wideset/list-item/ListItem';

export default function ListItemVariants() {
  return (
    <div className="gap-ws-2 flex w-[20rem] max-w-full flex-col">
      <ListItem variant="primary">
        <ListItem.Prefix>
          <RiFileCopyLine className="size-ws-9" />
        </ListItem.Prefix>
        <ListItem.Label>Duplicate</ListItem.Label>
      </ListItem>
      <ListItem variant="danger">
        <ListItem.Prefix>
          <RiDeleteBinLine className="size-ws-9" />
        </ListItem.Prefix>
        <ListItem.Label>Delete project</ListItem.Label>
      </ListItem>
    </div>
  );
}

Affixes

A prefix identifies the row (an icon, an avatar, a checkbox); a suffix adds a fact or a control (a size, a shortcut, a switch, a chevron for a submenu). The label truncates first, so both affixes always stay whole.

tsx
import { RiArrowRightSLine, RiFolderLine } from '@remixicon/react';
import { Avatar } from '@/components/ui/wideset/avatar/Avatar';
import { Checkbox } from '@/components/ui/wideset/checkbox/Checkbox';
import { ListItem } from '@/components/ui/wideset/list-item/ListItem';
import { Switch } from '@/components/ui/wideset/switch/Switch';

export default function ListItemAffixes() {
  return (
    <div className="gap-ws-2 flex w-[20rem] max-w-full flex-col">
      <ListItem>
        <ListItem.Prefix>
          <RiFolderLine className="size-ws-9" />
        </ListItem.Prefix>
        <ListItem.Content>
          <ListItem.Label>Marketing assets</ListItem.Label>
          <ListItem.Description>24 files, edited today</ListItem.Description>
        </ListItem.Content>
        <ListItem.Suffix>2.4 MB</ListItem.Suffix>
      </ListItem>
      <ListItem>
        <ListItem.Prefix>
          <Avatar size="xs" />
        </ListItem.Prefix>
        <ListItem.Content>
          <ListItem.Label>Anna Kowalska</ListItem.Label>
          <ListItem.Description>Product designer</ListItem.Description>
        </ListItem.Content>
        <ListItem.Suffix>
          <RiArrowRightSLine className="size-ws-9" />
        </ListItem.Suffix>
      </ListItem>
      <ListItem>
        <ListItem.Prefix>
          <Checkbox aria-label="Email digest" />
        </ListItem.Prefix>
        <ListItem.Label>Email digest</ListItem.Label>
        <ListItem.Suffix>
          <Switch aria-label="Weekly" />
        </ListItem.Suffix>
      </ListItem>
    </div>
  );
}

States

Hover, press and keyboard highlight are live; the menu that wraps the row sets data-state="checked" and the highlight for you. Disabled sets aria-disabled, so the row stays readable to screen readers but ignores hover and press.

tsx
import { ListItem } from '@/components/ui/wideset/list-item/ListItem';

export default function ListItemStates() {
  return (
    <div className="gap-x-ws-7 gap-y-ws-3 grid w-[26rem] max-w-full grid-cols-[4.5rem_1fr] items-center">
      <span className="typography-caption-md text-ws-static-subtle">Default</span>
      <ListItem>
        <ListItem.Label>Weekly</ListItem.Label>
      </ListItem>
      <span className="typography-caption-md text-ws-static-subtle">Selected</span>
      <ListItem data-state="checked">
        <ListItem.Label>Monthly</ListItem.Label>
      </ListItem>
      <span className="typography-caption-md text-ws-static-subtle">Disabled</span>
      <ListItem disabled>
        <ListItem.Label>Daily</ListItem.Label>
      </ListItem>
    </div>
  );
}

API reference

ListItem

NameDescriptionDefault
data-disabled

Applies disabled styling for consumers such as Radix menu items.

boolean
—
data-state

Selection state. The checked state displays a checkmark when enabled.

'checked''unchecked'
—
defaultMotion

Turns the component's built-in animations on or off. When omitted, inherits the value from the nearest `MotionProvider`.

boolean
true
disabled

Disables the item and applies disabled styling.

boolean
—
shouldDisplayCheckmark

Allows a checkmark to appear for checked items. Defaults to `true`.

boolean
true
variant
'primary''danger'
'primary'
Every other prop of <div> is passed through to it. See MDN: <div>.

ListItem.Content

No props of its ownIt takes its content as children.
Every other prop of <div> is passed through to it. See MDN: <div>.

ListItem.Description

No props of its ownIt takes its content as children.
Every other prop of <div> is passed through to it. See MDN: <div>.

ListItem.Label

No props of its ownIt takes its content as children.
Every other prop of <div> is passed through to it. See MDN: <div>.

ListItem.Prefix

No props of its ownIt takes its content as children.
Every other prop of <div> is passed through to it. See MDN: <div>.

ListItem.Suffix

No props of its ownIt takes its content as children.
Every other prop of <div> is passed through to it. See MDN: <div>.

Accessibility

  • ListItem is a div with no role. Inside Wideset menus the menu supplies roles and keyboard handling. Standalone, give the list semantics yourself (ul > li > ListItem) and, if a row acts on click, a role, tabIndex={0} and Enter/Space handling — or use ActionTile, which renders a real <a> or <button>.
  • A Checkbox or Switch in a slot needs its own aria-label.
  • Icons in Prefix are decorative; the label names the row.
PartRendersDescription
ListItem<div>A composable row used within menus and selection controls.
ListItem.Content<div>The content surface rendered within `ListItem`.
ListItem.Description<div>Supporting descriptive text.
ListItem.Label<div>The text label associated with `ListItem`.
ListItem.Prefix<div>Leading slot of the list item, such as an icon, avatar or checkbox.
ListItem.Suffix<div>Trailing slot of the list item, such as a badge, shortcut or chevron.
Marketing assets
24 files, edited today
tsx
import { RiFolderLine } from '@remixicon/react';
import { ListItem } from '@/components/ui/wideset/list-item/ListItem';

<ListItem>
  <ListItem.Prefix>
    <RiFolderLine className="size-ws-9" />
  </ListItem.Prefix>
  <ListItem.Content>
    <ListItem.Label>Marketing assets</ListItem.Label>
    <ListItem.Description>24 files, edited today</ListItem.Description>
  </ListItem.Content>
</ListItem>

Appearance

Variant

Content

Icon
Description
Suffix

State

Disabled
Checkmark
Selected