EXEPERTAI LAB

Research alpha

Time Machine
EXEPERTAI LAB
GALLERY / COLLECTION
← Browse Astryx gallery
List·component·@astryxdesign/core

List Item

List item with label, description, start/end content slots, and interactive patterns.

Open in Playground @astryxdesign/core/List

Showcases and examples

4 documented examples

List Item

List items with icons, descriptions, and end content slots demonstrating the full ListItem API.

Preview loads on approachPreview loads on approach
Exact source · list-item-showcase
// Copyright (c) Meta Platforms, Inc. and affiliates.

'use client';

import {List, ListItem} from '@astryxdesign/core/List';
import {Badge} from '@astryxdesign/core/Badge';
import {Icon} from '@astryxdesign/core/Icon';

export default function ListItemShowcase() {
  return (
    <List header="Settings" hasDividers>
      <ListItem
        label="Notifications"
        description="Push, email, and SMS alerts"
        startContent={<Icon icon="info" />}
        endContent={<Badge label="3 new" variant="blue" />}
        onClick={() => {}}
      />
      <ListItem
        label="Privacy"
        description="Manage data sharing preferences"
        startContent={<Icon icon="eyeSlash" />}
        onClick={() => {}}
      />
      <ListItem
        label="Appearance"
        description="Theme, font size, and display"
        startContent={<Icon icon="wrench" />}
        onClick={() => {}}
      />
      <ListItem
        label="Billing"
        description="Plans and payment methods"
        startContent={<Icon icon="copy" />}
        endContent={<Badge label="Pro" variant="purple" />}
        onClick={() => {}}
      />
    </List>
  );
}

Usage

List item with label, description, start/end content slots, and interactive patterns.

Typed props

PropType and behavior
labelstring · required
Primary text.
descriptionReactNode
Secondary content below the label. A plain string gets single-line truncation automatically; a ReactNode lets child components control their own wrapping and line-clamp behavior.
startContentReactNode
Content rendered before the label area (e.g. icon, avatar).
Slot: Icon
endContentReactNode
Content rendered after the label area (e.g. badge, chevron).
Slot: Icon, Badge
onClick(e: MouseEvent) => void
Click handler; enables the invisible button pattern.
interactiveRefRefObject<HTMLElement | null>
Ref to a nested control (e.g. a checkbox in startContent) that owns the item's keyboard access and action. The row becomes an enlarged click/tap target that delegates surface clicks to it (useClickableContainer) and renders no invisible button/anchor, so the row adds no second tab stop (WCAG 4.1.2). Mutually exclusive with onClick/href; those are ignored when set.
hrefstring
Link URL; enables the invisible anchor pattern. The destination follows the shared navigation rule described on the Link href prop.
targetstring
Link target attribute, only applicable when href is provided. target="_blank" automatically adds noopener noreferrer.
relstring
Link relationship tokens. noopener noreferrer are merged automatically for target="_blank".
isDisabledboolean · default false
Disabled state; sets aria-disabled on the item.
isSelectedboolean · default false
Selected state; sets aria-selected on the item.