A component that represents content composed of horizontal rows.
@seed-design/lynx-react@0.7.0, @seed-design/lynx-css@0.11.0
import "./styles" ;
import IconILowercaseSerifCircleLine from "@karrotmarket/lynx-monochrome-icon/IconILowercaseSerifCircleLine" ;
import IconPersonCircleLine from "@karrotmarket/lynx-monochrome-icon/IconPersonCircleLine" ;
import { PrefixIcon, SuffixIcon, useSeedClassName } from "@seed-design/lynx-react" ;
import { ListHeader } from "@/components/ui/list-header" ;
import { List, ListDivider, ListItem } from "@/components/ui/list" ;
export default function Example () {
const seedClassName = useSeedClassName ({ colorMode: "system" });
return (
< view className = { `${ seedClassName } docs-lynx-list-root` }>
< view className = "list-preview" >
< ListHeader >리스트 헤더</ ListHeader >
< List >
< ListItem title = "기본 리스트 아이템" />
< ListDivider />
< ListItem
prefix = {< PrefixIcon icon = {< IconPersonCircleLine />} />}
title = "아이콘이 있는 리스트 아이템"
detail = "부가 정보가 포함된 설명"
suffix = {< SuffixIcon icon = {< IconILowercaseSerifCircleLine />} />}
/>
</ List >
</ view >
</ view >
);
}
npx @seed-design/cli@latest add ui:list pnpm dlx @seed-design/cli@latest add ui:list yarn dlx @seed-design/cli@latest add ui:list bun x @seed-design/cli@latest add ui:list
Install dependencies
npm install @karrotmarket/lynx-monochrome-icon @seed-design/lynx-react yarn add @karrotmarket/lynx-monochrome-icon @seed-design/lynx-react pnpm add @karrotmarket/lynx-monochrome-icon @seed-design/lynx-react bun add @karrotmarket/lynx-monochrome-icon @seed-design/lynx-react Copy the code below and paste it in /**
* @file ui:list
* @requires @seed-design/lynx-react@>=0.7.0 <1.0.0
* @requires @seed-design/lynx-css@>=0.11.0 <1.0.0
* @requires @karrotmarket/lynx-monochrome-icon@>=1.20.0 <2.0.0
**/
import * as React from "@lynx-js/react" ;
import IconCheckmarkFatFill from "@karrotmarket/lynx-monochrome-icon/IconCheckmarkFatFill" ;
import IconMinusFatFill from "@karrotmarket/lynx-monochrome-icon/IconMinusFatFill" ;
import {
Checkbox as SeedCheckbox,
Divider as SeedDivider,
type DividerProps as SeedDividerProps,
List as SeedList,
RadioGroup as SeedRadioGroup,
Switch as SeedSwitch,
} from "@seed-design/lynx-react" ;
export interface ListProps extends SeedList . RootProps {}
/**
* @see https://crispy.carrot-soft.tech/lynx/components/list
*/
export const List = SeedList.Root;
interface ListItemContentProps {
title : React . ReactNode ;
detail ?: React . ReactNode ;
prefix ?: React . ReactNode ;
suffix ?: React . ReactNode ;
}
function ListItemContent ({ title , detail , prefix , suffix } : ListItemContentProps ) {
return (
<>
{prefix != null ? < SeedList.Prefix >{prefix}</ SeedList.Prefix > : null }
< SeedList.Content >
< SeedList.Title >{title}</ SeedList.Title >
{detail != null ? < SeedList.Detail >{detail}</ SeedList.Detail > : null }
</ SeedList.Content >
{suffix != null ? < SeedList.Suffix >{suffix}</ SeedList.Suffix > : null }
</>
);
}
function inferAccessibilityLabel ( title : React . ReactNode ) {
return typeof title === "string" ? title : undefined ;
}
export interface ListItemProps extends Omit < SeedList . ItemProps , "children" >, ListItemContentProps {}
/**
* @see https://crispy.carrot-soft.tech/lynx/components/list
*/
export const ListItem = React. forwardRef < unknown , ListItemProps >(
({ title , detail , prefix , suffix , ... props }, ref ) => {
return (
< SeedList.Item ref = {ref} { ... props}>
< ListItemContent title = {title} detail = {detail} prefix = {prefix} suffix = {suffix} />
</ SeedList.Item >
);
},
);
ListItem.displayName = "ListItem" ;
export interface ListButtonItemProps
extends Omit < SeedList . ButtonItemProps , "children" >,
ListItemContentProps {}
/**
* @see https://crispy.carrot-soft.tech/lynx/components/list
*/
export const ListButtonItem = React. forwardRef < unknown , ListButtonItemProps >(
({ title , detail , prefix , suffix , "accessibility-label" : accessibilityLabel , ... props }, ref ) => {
return (
< SeedList.ButtonItem
ref = {ref}
accessibility-label = {accessibilityLabel ?? inferAccessibilityLabel (title)}
{ ... props}
>
< ListItemContent title = {title} detail = {detail} prefix = {prefix} suffix = {suffix} />
</ SeedList.ButtonItem >
);
},
);
ListButtonItem.displayName = "ListButtonItem" ;
export interface ListCheckItemProps
extends Omit < SeedList . CheckboxItemProps , "children" >,
ListItemContentProps {}
/**
* @see https://crispy.carrot-soft.tech/lynx/components/list
*/
export const ListCheckItem = React. forwardRef < unknown , ListCheckItemProps >(
({ title , detail , prefix , suffix , "accessibility-label" : accessibilityLabel , ... props }, ref ) => {
const defaultSuffix = (
< SeedCheckbox.Control >
< SeedCheckbox.Indicator
checked = {< IconCheckmarkFatFill />}
indeterminate = {< IconMinusFatFill />}
/>
</ SeedCheckbox.Control >
);
return (
< SeedList.CheckboxItem
ref = {ref}
accessibility-label = {accessibilityLabel ?? inferAccessibilityLabel (title)}
{ ... props}
>
< ListItemContent
title = {title}
detail = {detail}
prefix = {prefix}
suffix = {suffix === undefined ? defaultSuffix : suffix}
/>
</ SeedList.CheckboxItem >
);
},
);
ListCheckItem.displayName = "ListCheckItem" ;
export interface ListRadioItemProps
extends Omit < SeedList . RadioItemProps , "children" >,
ListItemContentProps {}
/**
* @see https://crispy.carrot-soft.tech/lynx/components/list
*/
export const ListRadioItem = React. forwardRef < unknown , ListRadioItemProps >(
({ title , detail , prefix , suffix , "accessibility-label" : accessibilityLabel , ... props }, ref ) => {
const defaultSuffix = (
< SeedRadioGroup.ItemControl >
< SeedRadioGroup.ItemIndicator />
</ SeedRadioGroup.ItemControl >
);
return (
< SeedList.RadioItem
ref = {ref}
accessibility-label = {accessibilityLabel ?? inferAccessibilityLabel (title)}
{ ... props}
>
< ListItemContent
title = {title}
detail = {detail}
prefix = {prefix}
suffix = {suffix === undefined ? defaultSuffix : suffix}
/>
</ SeedList.RadioItem >
);
},
);
ListRadioItem.displayName = "ListRadioItem" ;
export interface ListSwitchItemProps
extends Omit < SeedList . SwitchItemProps , "children" >,
ListItemContentProps {}
/**
* @see https://crispy.carrot-soft.tech/lynx/components/list
*/
export const ListSwitchItem = React. forwardRef < unknown , ListSwitchItemProps >(
({ title , detail , prefix , suffix , "accessibility-label" : accessibilityLabel , ... props }, ref ) => {
const defaultSuffix = (
< SeedSwitch.Control >
< SeedSwitch.Thumb />
</ SeedSwitch.Control >
);
return (
< SeedList.SwitchItem
ref = {ref}
accessibility-label = {accessibilityLabel ?? inferAccessibilityLabel (title)}
{ ... props}
>
< ListItemContent
title = {title}
detail = {detail}
prefix = {prefix}
suffix = {suffix === undefined ? defaultSuffix : suffix}
/>
</ SeedList.SwitchItem >
);
},
);
ListSwitchItem.displayName = "ListSwitchItem" ;
export interface ListDividerProps extends SeedDividerProps {}
/**
* @see https://crispy.carrot-soft.tech/lynx/components/list
*/
export const ListDivider = React. forwardRef < unknown , ListDividerProps >(( props , ref ) => {
return < SeedDivider ref = {ref} { ... props} accessibility-element = { false } />;
});
ListDivider.displayName = "ListDivider" ;
/**
* This file is a snippet from Crispy, helping you get started quickly with @seed-design/* packages.
* You can extend this snippet however you want.
*/
/**
* @file ui:list
* @requires @seed-design/lynx-react@>=0.7.0 <1.0.0
* @requires @seed-design/lynx-css@>=0.11.0 <1.0.0
**/
import {
ListHeader as SeedListHeader,
type ListHeaderProps as SeedListHeaderProps,
} from "@seed-design/lynx-react" ;
export interface ListHeaderProps extends SeedListHeaderProps {}
/**
* @see https://crispy.carrot-soft.tech/lynx/components/list
*/
export const ListHeader = SeedListHeader;
/**
* This file is a snippet from Crispy, helping you get started quickly with @seed-design/* packages.
* You can extend this snippet however you want.
*/
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 >
style?CSSProperties | undefined
children?React.ReactNode
className?string | undefined
className?string | undefined
disabled?boolean | undefined
style?CSSProperties | undefined
titleReact.ReactNode
detail?React.ReactNode
prefix?React.ReactNode
suffix?React.ReactNode
bindtap?EventHandler < BaseTouchEvent < Target >> | undefined
main-thread:bindtap?EventHandler < BaseTouchEvent < Element >> | undefined
className?string | undefined
disabled?boolean | undefined
style?CSSProperties | undefined
titleReact.ReactNode
detail?React.ReactNode
prefix?React.ReactNode
suffix?React.ReactNode
Lynx has no basic element corresponding to HTML anchor. Link navigation is handled by calling the app router from ListButtonItem's bindtap.
className?string | undefined
disabled?boolean | undefined
style?CSSProperties | undefined
defaultChecked?boolean | undefined
onCheckedChange?(( checked : boolean ) => void ) | undefined
titleReact.ReactNode
detail?React.ReactNode
prefix?React.ReactNode
suffix?React.ReactNode
className?string | undefined
disabled?boolean | undefined
style?CSSProperties | undefined
checked?boolean | undefined
defaultChecked?boolean | undefined
onCheckedChange?(( checked : boolean ) => void ) | undefined
indeterminate?boolean | undefined
titleReact.ReactNode
detail?React.ReactNode
prefix?React.ReactNode
suffix?React.ReactNode
className?string | undefined
disabled?boolean | undefined
style?CSSProperties | undefined
valuestring
titleReact.ReactNode
detail?React.ReactNode
prefix?React.ReactNode
suffix?React.ReactNode
className?string | undefined
style?CSSProperties | undefined
ListHeader is placed outside List. Lynx ListHeader renders <text>, so actions are placed as siblings of the Header.
import "./styles" ;
import IconChevronRightLine from "@karrotmarket/lynx-monochrome-icon/IconChevronRightLine" ;
import IconLockLine from "@karrotmarket/lynx-monochrome-icon/IconLockLine" ;
import IconPersonCircleLine from "@karrotmarket/lynx-monochrome-icon/IconPersonCircleLine" ;
import IconQuestionmarkCircleFill from "@karrotmarket/lynx-monochrome-icon/IconQuestionmarkCircleFill" ;
import { ActionButton, PrefixIcon, SuffixIcon, useSeedClassName } from "@seed-design/lynx-react" ;
import { List, ListButtonItem, ListDivider } from "@/components/ui/list" ;
import { ListHeader } from "@/components/ui/list-header" ;
function AccountList () {
return (
< List >
< ListButtonItem
title = "내 계정"
detail = "이메일과 연락처, 본인 인증 관리"
prefix = {< PrefixIcon icon = {< IconPersonCircleLine />} />}
suffix = {< SuffixIcon icon = {< IconChevronRightLine />} />}
/>
< ListButtonItem
title = "보안 · 인증 관리"
detail = "비밀번호, 생체 인증 사용을 관리해요"
prefix = {< PrefixIcon icon = {< IconLockLine />} />}
suffix = {< SuffixIcon icon = {< IconChevronRightLine />} />}
/>
</ List >
);
}
export default function Example () {
const seedClassName = useSeedClassName ({ colorMode: "system" });
return (
< view className = { `${ seedClassName } docs-lynx-list-root` }>
< view className = "list-preview__sections" >
< view className = "list-preview__section" >
< ListHeader variant = "mediumWeak" >variant= " mediumWeak " </ ListHeader >
< AccountList />
</ view >
< ListDivider />
< view className = "list-preview__section" >
< ListHeader variant = "boldSolid" >variant= " boldSolid " </ ListHeader >
< AccountList />
</ view >
< ListDivider />
< view className = "list-preview__section" >
< view className = "list-preview__row list-preview__header-row" >
< ListHeader >List Header with Action Button</ ListHeader >
< ActionButton variant = "ghost" size = "small" >
< PrefixIcon icon = {< IconQuestionmarkCircleFill />} />
도움말
</ ActionButton >
</ view >
< AccountList />
</ view >
</ view >
</ view >
);
}
import "./styles" ;
import IconArrowUpBracketDownFill from "@karrotmarket/lynx-monochrome-icon/IconArrowUpBracketDownFill" ;
import IconILowercaseSerifCircleLine from "@karrotmarket/lynx-monochrome-icon/IconILowercaseSerifCircleLine" ;
import { useState } from "@lynx-js/react" ;
import { ActionButton, Icon, PrefixIcon, useSeedClassName } from "@seed-design/lynx-react" ;
import { List, ListDivider, ListItem } from "@/components/ui/list" ;
export default function Example () {
const seedClassName = useSeedClassName ({ colorMode: "system" });
const [ pressed , setPressed ] = useState ( false );
return (
< view className = { `${ seedClassName } docs-lynx-list-root` }>
< List >
< ListItem
prefix = {
< view className = "list-preview__avatar" >
< text className = "list-preview__avatar-label" >A</ text >
</ view >
}
title = "Prefix에 Avatar 넣기"
detail = "Amet elit ullamco magna."
/>
< ListDivider />
< ListItem
title = "Prefix에 아이콘 넣기"
detail = "Deserunt nulla elit est."
prefix = {< PrefixIcon icon = {< IconILowercaseSerifCircleLine />} />}
/>
< ListDivider />
< ListItem
title = "Suffix에 Action Button 넣기"
detail = "Veniam non est non ut consequat."
suffix = {
< ActionButton size = "xsmall" variant = "neutralWeak" >
액션 버튼
</ ActionButton >
}
/>
< ListDivider />
< ListItem
title = "Suffix에 Action Button (Ghost) 넣기"
detail = "Deserunt nulla elit est."
suffix = {
< ActionButton size = "small" variant = "ghost" layout = "iconOnly" accessibility-label = "공유" >
< Icon icon = {< IconArrowUpBracketDownFill />} />
</ ActionButton >
}
/>
< ListDivider />
< ListItem
title = "Suffix에 토글 액션 넣기"
detail = "Sit eu incididunt aute ea elit ex."
suffix = {
< ActionButton
size = "xsmall"
variant = {pressed ? "neutralSolid" : "neutralWeak" }
bindtap = {() => {
"background only" ;
setPressed (( value ) => ! value);
}}
>
{pressed ? "선택됨" : "토글 버튼" }
</ ActionButton >
}
/>
</ List >
</ view >
);
}
Using ListButtonItem allows tapping the entire list item. Since Lynx has no ListLinkItem, screen navigation is handled by calling the app router in bindtap.
import "./styles" ;
import IconArrowUpRightLine from "@karrotmarket/lynx-monochrome-icon/IconArrowUpRightLine" ;
import IconCheckmarkFill from "@karrotmarket/lynx-monochrome-icon/IconCheckmarkFill" ;
import IconChevronRightLine from "@karrotmarket/lynx-monochrome-icon/IconChevronRightLine" ;
import IconPenHorizlineFill from "@karrotmarket/lynx-monochrome-icon/IconPenHorizlineFill" ;
import IconPlusFill from "@karrotmarket/lynx-monochrome-icon/IconPlusFill" ;
import IconSquare2StackedFill from "@karrotmarket/lynx-monochrome-icon/IconSquare2StackedFill" ;
import { useState } from "@lynx-js/react" ;
import { ActionButton, PrefixIcon, SuffixIcon, useSeedClassName } from "@seed-design/lynx-react" ;
import { List, ListButtonItem, ListDivider, ListItem } from "@/components/ui/list" ;
export default function Example () {
const seedClassName = useSeedClassName ({ colorMode: "system" });
const [ status , setStatus ] = useState ( "아직 탭하지 않았어요" );
const [ subscribed , setSubscribed ] = useState ( false );
const [ copied , setCopied ] = useState ( false );
return (
< view className = { `${ seedClassName } docs-lynx-list-root` }>
< List >
< ListItem
title = "ListItem은 클릭할 수 없어요. 눌러보세요."
detail = "우측의 Action Button만 클릭할 수 있어요"
suffix = {
< ActionButton
variant = "ghost"
size = "xsmall"
bindtap = {() => {
"background only" ;
setStatus ( "편집 클릭됨" );
}}
>
< PrefixIcon icon = {< IconPenHorizlineFill />} />
편집
</ ActionButton >
}
/>
< ListDivider />
< ListButtonItem
title = "ListButtonItem은 클릭할 수 있어요. 눌러보세요."
detail = "리스트 항목 전체와 우측의 토글 액션을 각각 탭할 수 있어요"
bindtap = {() => {
"background only" ;
setStatus ( "리스트 아이템 클릭됨" );
}}
suffix = {
< view className = "list-preview__suffix" >
< view catchtap = {() => {}}>
< ActionButton
variant = {subscribed ? "neutralSolid" : "neutralWeak" }
size = "xsmall"
bindtap = {() => {
"background only" ;
setSubscribed (( value ) => ! value);
setStatus ( "모아보기 상태 변경됨" );
}}
>
< PrefixIcon icon = {subscribed ? < IconCheckmarkFill /> : < IconPlusFill />} />
{subscribed ? "모아보는 중" : "모아보기" }
</ ActionButton >
</ view >
< SuffixIcon icon = {< IconChevronRightLine />} />
</ view >
}
/>
< ListDivider />
< ListButtonItem
title = "ListButtonItem은 클릭할 수 있어요. 눌러보세요."
detail = "리스트 항목 전체와 우측의 커스텀 버튼을 각각 탭할 수 있어요"
bindtap = {() => {
"background only" ;
setStatus ( "리스트 아이템 클릭됨" );
}}
suffix = {
< view className = "list-preview__suffix" >
< view
className = "list-preview__custom-button"
accessibility-element = { true }
accessibility-traits = "button"
catchtap = {() => {
"background only" ;
setStatus ( "커스텀 버튼 클릭됨" );
}}
>
< text className = "list-preview__custom-button-label" >커스텀 버튼</ text >
</ view >
< SuffixIcon icon = {< IconChevronRightLine />} />
</ view >
}
/>
< ListDivider />
< ListButtonItem
title = "링크 이동도 ListButtonItem으로 처리해요."
detail = "탭 이벤트에서 앱 라우터를 호출합니다"
bindtap = {() => {
"background only" ;
setStatus ( "링크 이동 요청됨" );
}}
suffix = {
< view className = "list-preview__suffix" >
< view catchtap = {() => {}}>
< ActionButton
variant = "neutralWeak"
size = "xsmall"
bindtap = {() => {
"background only" ;
setCopied ( true );
setStatus ( "URL 복사됨" );
}}
>
< PrefixIcon icon = {copied ? < IconCheckmarkFill /> : < IconSquare2StackedFill />} />
{copied ? "복사됨" : "URL 복사" }
</ ActionButton >
</ view >
< SuffixIcon icon = {< IconArrowUpRightLine />} />
</ view >
}
/>
</ List >
< text className = "list-preview__status" >{status}</ text >
</ view >
);
}
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}.
import "./styles" ;
import IconTrashcanLine from "@karrotmarket/lynx-monochrome-icon/IconTrashcanLine" ;
import { PrefixIcon, useSeedClassName } from "@seed-design/lynx-react" ;
import { List, ListDivider, ListSwitchItem } from "@/components/ui/list" ;
export default function Example () {
const seedClassName = useSeedClassName ({ colorMode: "system" });
return (
< view className = { `${ seedClassName } docs-lynx-list-root` }>
< view className = "list-preview list-preview--centered" >
< List >
< ListSwitchItem
title = "삭제하기 전에 확인"
prefix = {< PrefixIcon icon = {< IconTrashcanLine />} />}
/>
< ListDivider />
< ListSwitchItem
title = "메시지 요약"
detail = "핵심 내용만 빠르게 확인해보세요."
defaultChecked
/>
</ List >
</ view >
</ view >
);
}
import "./styles" ;
import IconCheckmarkFatFill from "@karrotmarket/lynx-monochrome-icon/IconCheckmarkFatFill" ;
import { Badge, Checkbox, HStack, useSeedClassName } from "@seed-design/lynx-react" ;
import { List, ListCheckItem, ListDivider } from "@/components/ui/list" ;
export default function Example () {
const seedClassName = useSeedClassName ({ colorMode: "system" });
return (
< view className = { `${ seedClassName } docs-lynx-list-root` }>
< view className = "list-preview list-preview--centered" >
< List >
< ListCheckItem
title = {
< HStack gap = "x1_5" align = "center" >
< text >알림 수신 동의</ text >
< Badge variant = "weak" >권장</ Badge >
</ HStack >
}
detail = "푸시 알림을 받으시겠습니까?"
defaultChecked
/>
< ListDivider />
< ListCheckItem
title = "마케팅 정보 수신 동의"
detail = "마케팅 정보를 받으시겠습니까?"
prefix = {
< Checkbox.Control tone = "neutral" size = "large" >
< Checkbox.Indicator checked = {< IconCheckmarkFatFill />} />
</ Checkbox.Control >
}
suffix = { null }
defaultChecked
/>
< ListDivider />
< ListCheckItem
prefix = {
< Checkbox.Control tone = "neutral" size = "large" variant = "ghost" >
< Checkbox.Indicator
unchecked = {< IconCheckmarkFatFill />}
checked = {< IconCheckmarkFatFill />}
/>
</ Checkbox.Control >
}
suffix = { null }
title = "Ghost Variant"
/>
</ List >
</ view >
</ view >
);
}
import "./styles" ;
import { useSeedClassName } from "@seed-design/lynx-react" ;
import { List, ListDivider, ListRadioItem } from "@/components/ui/list" ;
import { RadioGroup, Radiomark } from "@/components/ui/radio-group" ;
export default function Example () {
const seedClassName = useSeedClassName ({ colorMode: "system" });
return (
< view className = { `${ seedClassName } docs-lynx-list-root` }>
< view className = "list-preview list-preview--centered" >
< RadioGroup
defaultValue = "option1"
accessibility-label = "옵션 선택"
tone = "neutral"
size = "large"
>
< List >
< ListRadioItem
value = "option1"
title = "옵션 1"
detail = "첫 번째 선택지"
suffix = {< Radiomark />}
/>
< ListDivider />
< ListRadioItem
value = "option2"
title = "옵션 2"
detail = "두 번째 선택지"
prefix = {< Radiomark />}
suffix = { null }
/>
< ListDivider />
< ListRadioItem
value = "option3"
title = "옵션 3"
detail = "세 번째 선택지"
prefix = {< Radiomark />}
suffix = { null }
/>
</ List >
</ RadioGroup >
</ view >
</ view >
);
}
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 >
import "./styles" ;
import IconChevronRightLine from "@karrotmarket/lynx-monochrome-icon/IconChevronRightLine" ;
import IconPersonCircleLine from "@karrotmarket/lynx-monochrome-icon/IconPersonCircleLine" ;
import IconSlashCircleLine from "@karrotmarket/lynx-monochrome-icon/IconSlashCircleLine" ;
import { PrefixIcon, SuffixIcon, useSeedClassName } from "@seed-design/lynx-react" ;
import { List, ListButtonItem, ListCheckItem, ListRadioItem } from "@/components/ui/list" ;
import { RadioGroup } from "@/components/ui/radio-group" ;
export default function Example () {
const seedClassName = useSeedClassName ({ colorMode: "system" });
return (
< view className = { `${ seedClassName } docs-lynx-list-root` }>
< view className = "list-preview__sections" >
< List >
< ListButtonItem
prefix = {< PrefixIcon icon = {< IconPersonCircleLine />} />}
title = "활성화된 ListButtonItem"
detail = "Cupidatat et pariatur amet."
suffix = {< SuffixIcon icon = {< IconChevronRightLine />} />}
/>
< ListCheckItem
prefix = {< PrefixIcon icon = {< IconPersonCircleLine />} />}
title = "활성화된 ListCheckItem"
/>
</ List >
< RadioGroup defaultValue = "enabled" accessibility-label = "활성화 옵션" >
< List >
< ListRadioItem
prefix = {< PrefixIcon icon = {< IconPersonCircleLine />} />}
title = "활성화된 ListRadioItem"
value = "enabled"
/>
</ List >
</ RadioGroup >
< List >
< ListButtonItem
disabled
prefix = {< PrefixIcon icon = {< IconSlashCircleLine />} />}
title = "비활성화된 ListButtonItem"
detail = "Cupidatat et pariatur amet."
suffix = {< SuffixIcon icon = {< IconChevronRightLine />} />}
/>
< ListCheckItem
disabled
prefix = {< PrefixIcon icon = {< IconSlashCircleLine />} />}
title = "비활성화된 ListCheckItem"
/>
</ List >
< RadioGroup defaultValue = "disabled" accessibility-label = "비활성화 옵션" >
< List >
< ListRadioItem
disabled
prefix = {< PrefixIcon icon = {< IconSlashCircleLine />} />}
title = "비활성화된 ListRadioItem"
value = "disabled"
/>
</ List >
</ RadioGroup >
</ view >
</ view >
);
}
import "./styles" ;
import IconPersonCircleLine from "@karrotmarket/lynx-monochrome-icon/IconPersonCircleLine" ;
import { useState } from "@lynx-js/react" ;
import { PrefixIcon, useSeedClassName } from "@seed-design/lynx-react" ;
import { List, ListButtonItem, ListDivider, ListItem } from "@/components/ui/list" ;
import { Switch } from "@/components/ui/switch" ;
export default function Example () {
const seedClassName = useSeedClassName ({ colorMode: "system" });
const [ highlighted , setHighlighted ] = useState ( true );
return (
< view className = { `${ seedClassName } docs-lynx-list-root` }>
< view className = "list-preview__sections" >
< List >
< ListButtonItem
prefix = {< PrefixIcon icon = {< IconPersonCircleLine />} />}
title = "버튼"
detail = "Enim aute duis magna mollit aute sit aliquip duis ut tempor sunt."
/>
< ListDivider />
< ListButtonItem
highlighted
prefix = {< PrefixIcon icon = {< IconPersonCircleLine />} />}
title = "하이라이트된 버튼"
detail = "Enim aute duis magna mollit aute sit aliquip duis ut tempor sunt."
/>
< ListDivider />
< ListButtonItem
highlighted
disabled
prefix = {< PrefixIcon icon = {< IconPersonCircleLine />} />}
title = "하이라이트 및 비활성화된 버튼"
detail = "Enim aute duis magna mollit aute sit aliquip duis ut tempor sunt."
/>
</ List >
< List >
< ListItem
prefix = {< PrefixIcon icon = {< IconPersonCircleLine />} />}
title = "하이라이트"
highlighted = {highlighted}
/>
</ List >
< view className = "list-preview__row" >
< text >highlight</ text >
< Switch checked = {highlighted} onCheckedChange = {setHighlighted} />
</ view >
</ view >
</ view >
);
}
import "./styles" ;
import IconArrowClockwiseCircularFill from "@karrotmarket/lynx-monochrome-icon/IconArrowClockwiseCircularFill" ;
import { useRef, useState } from "@lynx-js/react" ;
import {
ActionButton,
type BottomSheetRootRef,
PrefixIcon,
useSeedClassName,
} from "@seed-design/lynx-react" ;
import {
BottomSheetBody,
BottomSheetContent,
BottomSheetFooter,
BottomSheetRoot,
BottomSheetTrigger,
} from "@/components/ui/bottom-sheet" ;
import { List, ListCheckItem } from "@/components/ui/list" ;
const TYPES = [ "버스" , "지하철" , "택시" , "자전거" , "도보" ] as const ;
export default function Example () {
const seedClassName = useSeedClassName ({ colorMode: "system" });
const sheetRef = useRef < BottomSheetRootRef >( null );
const [ selectedTypes , setSelectedTypes ] = useState <( typeof TYPES )[ number ][]>([]);
return (
< view className = { `${ seedClassName } docs-lynx-list-root` }>
< view className = "list-preview list-preview--centered" >
< BottomSheetRoot ref = {sheetRef}>
< BottomSheetTrigger >
< ActionButton variant = "neutralSolid" >BottomSheet 열기</ ActionButton >
</ BottomSheetTrigger >
< BottomSheetContent title = "교통수단" description = "이동할 교통수단을 선택해주세요." >
< BottomSheetBody style = {{ flex: "none" , height: "280px" }}>
< List >
{ TYPES . map (( type ) => (
< ListCheckItem
key = {type}
title = {type}
checked = {selectedTypes. includes (type)}
onCheckedChange = {() => {
setSelectedTypes (( previous ) =>
previous. includes (type)
? previous. filter (( item ) => item !== type)
: [ ... previous, type],
);
}}
/>
))}
</ List >
</ BottomSheetBody >
< BottomSheetFooter >
< view className = "list-preview__bottom-sheet-actions" >
< ActionButton
size = "large"
variant = "neutralSolid"
disabled = {selectedTypes. length === 0 }
bindtap = {() => {
"background only" ;
sheetRef.current?. close ();
}}
>
경로 찾기
</ ActionButton >
< ActionButton
size = "small"
variant = "ghost"
disabled = {selectedTypes. length === 0 }
bindtap = {() => {
"background only" ;
setSelectedTypes ([]);
}}
>
< PrefixIcon icon = {< IconArrowClockwiseCircularFill />} />
초기화
</ ActionButton >
</ view >
</ BottomSheetFooter >
</ BottomSheetContent >
</ BottomSheetRoot >
</ view >
</ view >
);
}
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.
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.
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.
Lynx has no DOM-based asChild prop. Use interaction items that match the role directly.
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" />
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" />
Area React Web Lynx Elements ul, li, button, inputview, textEvents onClickbindtap, main-thread:bindtapAccessibility HTML semantics and ARIA accessibility-*Link items ListLinkItemCall app router from ListButtonItem Polymorphic rendering as, asChildNot supported Selection control Hidden input Lynx state and accessibility value sharing
Feature Web Counterpart Alternative ListLinkItem<a> link itemCall app router from ListButtonItem's bindtap itemBorderRadiusList-specific press border radius Apply radius and clipping to outer container alignItemsPrefix and suffix alignment Separate layout using low-level slots Complex content inside Header Title and action in one Header Header and action as sibling elements