Lynx

List

A component that represents content composed of horizontal rows.

Available since@seed-design/lynx-react@0.7.0, @seed-design/lynx-css@0.11.0
Loading Lynx example…

Installation

npx @seed-design/cli@latest add ui:list

Usage

import { ListHeader } from "@/components/ui/list-header";
import { List, ListDivider, ListItem } from "@/components/ui/list";

<view>
  <ListHeader>List Header</ListHeader>
  <List>
    <ListItem title="List Item 1" />
    <ListDivider />
    <ListItem title="List Item 2" />
  </List>
</view>

Props

ListHeader

Prop

Type

style?CSSProperties | undefined
children?ReactNode
className?string | undefined

List

Prop

Type

style?CSSProperties | undefined
children?React.ReactNode
className?string | undefined

List Items

Examples

Using ListHeader

ListHeader is placed outside List. Lynx ListHeader renders <text>, so actions are placed as siblings of the Header.

Loading Lynx example…

Affixes (Prefix/Suffix)

Loading Lynx example…

Clickable List Items

Using ListButtonItem allows tapping the entire list item. Since Lynx has no ListLinkItem, screen navigation is handled by calling the app router in bindtap.

Loading Lynx example…

inputs in List Items

Using ListSwitchItem, ListCheckItem, ListRadioItem allows tapping the entire item to change the value. The snippet renders each control as the default suffix. You can hide the default control by passing suffix={null}.

Loading Lynx example…
Loading Lynx example…
Loading Lynx example…

Accessibility

ListButtonItem provides button role and string title-based accessibility name by default. Selection items pass the current selection status via accessibility-value. ListRadioItem must be used inside RadioGroup.Root and you must specify the group's accessibility name.

import { List, ListRadioItem } from "@/components/ui/list";
import { RadioGroup } from "@/components/ui/radio-group";

<RadioGroup defaultValue="jajang" accessibility-label="Lunch Menu">
  <List>
    <ListRadioItem value="jajang" title="Jajang" />
    <ListRadioItem value="jjamppong" title="Jjamppong" />
  </List>
</RadioGroup>

Disabled

Loading Lynx example…

Variants

Highlighted

Loading Lynx example…

With Bottom Sheet

Loading Lynx example…

Alignment

React's alignItems prop is not supported in Lynx List. In Lynx, the Recipe aligns prefix, content, and suffix to the center. If top alignment is needed, use a separate layout with low-level slots placed directly.

Border Radius

React's itemBorderRadius prop is not supported in Lynx List. Lynx items use the border radius value defined by the Recipe. For rounded cards, apply border-radius and overflow: hidden to the outer container.

Customization and Composition

Usage

The List and ListHeader components provided by @seed-design/lynx-react are used with the following structure:

ListHeader
List.Root
└── List.Item
    ├── List.Prefix (Optional)
    ├── List.Content
    │   ├── List.Title
    │   └── List.Detail (Optional)
    └── List.Suffix (Optional)
└── List.Item
    ├── ...
import IconChevronRightLine from "@karrotmarket/lynx-monochrome-icon/IconChevronRightLine";
import IconPersonCircleLine from "@karrotmarket/lynx-monochrome-icon/IconPersonCircleLine";
import { List, ListHeader, PrefixIcon, SuffixIcon } from "@seed-design/lynx-react";

<view>
  <ListHeader>My Information</ListHeader>
  <List.Root>
    <List.Item>
      <List.Prefix>
        <PrefixIcon icon={<IconPersonCircleLine />} />
      </List.Prefix>
      <List.Content>
        <List.Title>My Profile</List.Title>
        <List.Detail>Manage my information shown to others.</List.Detail>
      </List.Content>
      <List.Suffix>
        <SuffixIcon icon={<IconChevronRightLine />} />
      </List.Suffix>
    </List.Item>
  </List.Root>
</view>
  • ListHeader: Header that displays the list title or description
  • List.Root: Container that wraps all list items
    • List.Item: Non-interactive individual item
    • List.ButtonItem: Individual item that can be tapped
    • List.CheckboxItem, List.RadioItem, List.SwitchItem: Individual items with selection state
    • List.Prefix: Start area that displays icons or Avatar, etc.
    • List.Content: Center area for title and description
    • List.Suffix: End area that displays icons or Action Button, etc.

Combining with Appropriate Semantic Elements Using asChild Prop

Lynx has no DOM-based asChild prop. Use interaction items that match the role directly.

Using List.ButtonItem instead of asChild in List.Content

Use List.ButtonItem when tapping the entire item.

import { List } from "@seed-design/lynx-react";

<List.ButtonItem bindtap={handleTap} accessibility-label="Users, 6 items">
  <List.Content>
    <List.Title>Users</List.Title>
    <List.Detail>6 items</List.Detail>
  </List.Content>
</List.ButtonItem>

The snippet's ListButtonItem helps write the same structure more simply.

import { ListButtonItem } from "@/components/ui/list";

<ListButtonItem bindtap={handleTap} title="Users" detail="6 items" />

Using selection items instead of asChild in List.Item

Use List.CheckboxItem, List.RadioItem, List.SwitchItem for items with selection state. The snippet's selection items configure accessibility values and default controls together.

import { ListCheckItem } from "@/components/ui/list";

<ListCheckItem defaultChecked title="Agree" />

Web Version Differences

AreaReact WebLynx
Elementsul, li, button, inputview, text
EventsonClickbindtap, main-thread:bindtap
AccessibilityHTML semantics and ARIAaccessibility-*
Link itemsListLinkItemCall app router from ListButtonItem
Polymorphic renderingas, asChildNot supported
Selection controlHidden inputLynx state and accessibility value sharing

Unsupported Lynx Features

FeatureWeb CounterpartAlternative
ListLinkItem<a> link itemCall app router from ListButtonItem's bindtap
itemBorderRadiusList-specific press border radiusApply radius and clipping to outer container
alignItemsPrefix and suffix alignmentSeparate layout using low-level slots
Complex content inside HeaderTitle and action in one HeaderHeader and action as sibling elements

Table of contents