List
Vertical lists for picking people, popover lists, notifications, search results and management lists: ListRow is a list row (36 / 52 for one or two lines on desktop, at least 48 / 64 on phones, or a compound row with any content, optionally with separate trailing actions), ListActionRow is a compact row with a trailing delete, and all go in the inset container ListBox.
Status: stable · Components: ListRow, ListBox, ListActionRow, ChoiceList, TouchAction, TouchGroup, TouchRow
Import
Section titled “Import”import { ListRow, ListBox, ListActionRow, ChoiceList, TouchAction, TouchGroup, TouchRow } from 'nacre'ListBox insets 6 with 2 between rows; give ListRow a title, and give pressable rows onPress.
import { View, signal } from 'nsh'import { ListBox, ListRow, TOUCH } from 'nacre'
export function ListUsage() { const picked = signal('hk') const teams = [ { id: 'hk', name: 'Hong Kong team' }, { id: 'sg', name: 'Singapore team' }, { id: 'vip', name: 'High-net-worth desk' }, ] return ( <View class={`${TOUCH ? 'w-full' : 'w-[240px] max-w-full rounded-xl border border-border'}`}> <ListBox> {teams.map((team) => ( <ListRow title={team.name} selected={picked() === team.id} onPress={() => picked.set(team.id)} /> ))} </ListBox> </View> )}Examples
Section titled “Examples”Grouped touch rows
Section titled “Grouped touch rows”The trailing star toggles the pinned state in a read-only row. Archiving disables both the row and its action.
import { signal } from 'nsh'import { Icon, Swap, TouchAction, TouchGroup, TouchRow } from 'nacre'
export function ListTouchActions() { const pinned = signal(false) const label = () => pinned() ? 'Unpin' : 'Pin' const archived = () => 'Archived' return <TouchGroup> <TouchRow label={label()} trailing={<TouchAction testID="demo-touch-action" label={label()} onPress={() => pinned.update((v) => !v)}> {/* 开关类图标:开态换实心 + 品牌色,换态时弹一下(Swap toggle);不只换颜色 */} <Swap value={pinned()} motion="toggle"> <Icon name={pinned() ? 'star-filled' : 'star'} size={22} color={pinned() ? 'brand-text' : 'muted-foreground'} /> </Swap> </TouchAction>} /> <TouchRow disabled label={archived()} trailing={<TouchAction disabled label={label()} onPress={() => {}}> <Icon name="star" size={22} color="muted-foreground" /> </TouchAction>} /> </TouchGroup>}Compound touch rows
Section titled “Compound touch rows”TouchRow content replaces the title and description column with your own layout: record cards, notes, label + value fields. It gets 12 above and below; the trailing chevron and press highlight stay. Give the screen reader name with accessibilityLabel, or it reads the text inside. When a wrapper such as LongPressMenu draws the separator with touchSeparator() and owns the left inset, pass separatorByParent; rows placed directly in a TouchGroup do not.
import { Text, View, signal } from 'nsh'import { TEXT_SIZE, TouchGroup, TouchRow } from 'nacre'
export function ListTouchContent() { const opened = signal('') return <TouchGroup> <TouchRow testID="demo-touch-content" chevron onPress={() => opened.set('note')} content={ <View testID="demo-touch-content-body" class="gap-1.5"> <View class="flex-row items-center gap-2"> <Text class={`flex-1 ${TEXT_SIZE.body} font-semibold text-foreground`}>Resolved</Text> <Text class={`${TEXT_SIZE.small} text-text-tertiary tabular-nums`}>11-26 14:02</Text> </View> <Text class={`${TEXT_SIZE.small} text-muted-foreground`}>HK account / Documents</Text> <Text class={`${TEXT_SIZE.body} text-foreground`}>Proof of address received, pending review.</Text> </View> } /> <TouchRow testID="demo-touch-field" content={ <View class="flex-row items-start gap-3"> <Text class={`w-[88px] shrink-0 ${TEXT_SIZE.body} text-muted-foreground`}>Phone</Text> <Text class={`flex-1 min-w-0 ${TEXT_SIZE.body} text-foreground tabular-nums`}>+852 9123 4567</Text> </View> } /> <If when={opened()}> <Text testID="demo-touch-opened" class={`px-4 py-2 ${TEXT_SIZE.small} text-muted-foreground`}>Opened</Text> </If> </TouchGroup>}Searchable inline choices
Section titled “Searchable inline choices”Search filters the candidates while the form retains its selection. Use single or multiple for immediate selection, or tags to show removable selections below the checkboxes. Disabled options cannot be toggled or removed directly. Each remove button announces its option name.
import { View, signal } from 'nsh'import { ChoiceList } from 'nacre'
export function InlineChoices() { const selected = signal<string[]>([]) const options = [ { value: 'hk', label: 'Hong Kong' }, { value: 'sg', label: 'Singapore' }, ] return ( <View class="w-60"> <ChoiceList mode="tags" height={88} testID="demo-choices" options={options} value={selected()} onChange={(next) => selected.set(next)} placeholder="Search regions" emptyText="No matching regions" /> </View> )}Multiple selection and disabled
Section titled “Multiple selection and disabled”Mark selection with selected (a fill plus a trailing check); the avatar goes in leading and the end of the row in trailing, with a fixed trailingWidth so it doesn’t squeeze the text; disabled rows cannot be pressed.
import { Text, View, signal } from 'nsh'import { Avatar, Icon, ListBox, ListRow, TEXT_SIZE } from 'nacre'
const agents = () => [ { id: 'a', name: 'Lin Jiayi', busy: false }, { id: 'b', name: 'Chen Zhiyuan', busy: false }, { id: 'c', name: 'Michael Wong', busy: false }, { id: 'd', name: 'Zhou Kexin', busy: true },]
export function ListSelectable() { const AGENTS = agents() const picked = signal<string[]>(['a']) const toggle = (id: string) => picked.update((list) => (list.includes(id) ? list.filter((v) => v !== id) : [...list, id])) const names = () => AGENTS.filter((agent) => picked().includes(agent.id)).map((agent) => agent.name) return ( <View class="flex-row flex-wrap items-start gap-3"> <View class="w-[280px] max-w-full rounded-xl border border-border"> <ListBox> {AGENTS.map((agent) => ( <ListRow testID={`list-${agent.id}`} title={agent.name} leading={<Avatar name={agent.name} size={22} />} selected={picked().includes(agent.id)} disabled={agent.busy} onPress={() => toggle(agent.id)} trailingWidth={agent.busy ? 44 : 16} trailing={agent.busy ? <Text class={`${TEXT_SIZE.caption} text-muted-foreground`}>Added</Text> : picked().includes(agent.id) ? <Icon name="check" size={14} color="selection-indicator" /> : undefined} /> ))} </ListBox> </View> <Text class={`${TEXT_SIZE.small} text-muted-foreground`}>{`$Selected: ${names().join(', ') || 'None'}`}</Text> </View> )}With a trailing action
Section titled “With a trailing action”ListActionRow: pressing the row applies it, the trailing IconButton deletes it, and neither triggers the other.
import { Text, View, signal } from 'nsh'import { IconButton, ListActionRow, ListBox, TEXT_SIZE } from 'nacre'
export function ListActionRows() { const views = signal([ 'Valid chats', 'Negative reviews this week', 'HK account opening · Unresolved · Last 30 days · Tier 2', ]) const applied = signal('') // 删掉的正好是已套用的视图:套用一并清掉,不留指向已删视图的状态 const remove = (name: string) => { views.update((list) => list.filter((v) => v !== name)) if (applied() === name) applied.set('') } return ( <View class="flex-row flex-wrap items-start gap-3"> <View class="w-[260px] max-w-full rounded-xl border border-border"> <ListBox> <Each of={views()} key={(name) => name}> {(name) => ( <ListActionRow testID={`action-row-${name()}`} title={name()} selected={applied() === name()} onPress={() => applied.set(name())} action={<IconButton icon="close" size="xs" label="Delete" testID={`action-row-delete-${name()}`} onPress={() => remove(name())} />} /> )} </Each> <ListActionRow title="View shared by an admin" disabled onPress={() => {}} action={<IconButton icon="close" size="xs" label="Delete" disabled onPress={() => {}} />} /> </ListBox> </View> <Text class={`${TEXT_SIZE.small} text-muted-foreground`}>{`$Applied: ${applied() || 'None'}`}</Text> </View> )}Two lines and truncation
Section titled “Two lines and truncation”A subtitle sits below the title; the title and subtitle each truncate to one line, and hovering the title shows it in full.
Phone: With a subtitle the row has two lines (at least 64 on phones); title and subtitle each truncate to one line.
import { View } from 'nsh'import { Avatar, ListBox, ListRow, TOUCH } from 'nacre'
export function ListTwoLine() { return ( <View class={`${TOUCH ? 'w-full' : 'w-[280px] max-w-full rounded-xl border border-border'}`}> <ListBox> <ListRow title="Lin Jiayi" subtitle="HK account opening · Tier 1" leading={<Avatar name="Lin Jiayi" size={22} />} onPress={() => {}} /> <ListRow title="Michael Wong (support lead, Tier 2 support for HK and US account opening and funding issues)" subtitle="Tier 2 support · Funding and transfers · HK and US stocks · Night shift" leading={<Avatar name="Michael Wong" size={22} />} onPress={() => {}} /> <ListRow title="Chen Zhiyuan" leading={<Avatar name="Chen Zhiyuan" size={22} />} onPress={() => {}} /> </ListBox> </View> )}Compound rows
Section titled “Compound rows”content takes any content (title, time, a two-line summary, tags) with leading aligned to the top; actions are separate trailing actions that show on hover or while the row has focus and never press the row; onContextMenu takes the right-click.
Phone: content holds anything (title, time, two-line excerpt, tags) with leading aligned to the top; trailing actions are always visible on phones and don’t trigger the row.
import { Text, View, signal } from 'nsh'import { Icon, IconButton, ListBox, ListRow, Tag, TEXT_SIZE, TOUCH } from 'nacre'
const notices = () => [ { id: 'n1', title: 'HK account opening process updated', body: 'From 1 December, HK account opening needs a tax residency declaration; remind customers to upload it in chats.', at: '14:32', tag: 'Important', }, { id: 'n2', title: 'System maintenance tonight at 22:00', body: 'Chats go to messages during maintenance, which takes about 30 minutes.', at: 'Yesterday', },]
export function ListCompound() { const NOTICES = notices() const opened = signal('n1') const last = signal('') return ( <View class="flex-row flex-wrap items-start gap-3"> <View class="w-[340px] max-w-full rounded-xl border border-border"> <ListBox> {NOTICES.map((notice) => ( <ListRow testID={`compound-${notice.id}`} accessibilityLabel={[notice.title, notice.at, notice.tag, notice.body].filter(Boolean).join(' · ')} selected={opened() === notice.id} onPress={() => opened.set(notice.id)} onContextMenu={() => last.set(`$Right-click: ${notice.title}`)} leading={ <View class="w-8 h-8 rounded-lg items-center justify-center bg-muted"> <Icon name="bell" size={16} color="muted-foreground" /> </View> } content={ <View class="gap-0.5"> <View class="flex-row items-center gap-2 h-5"> <Text class={`flex-1 min-w-0 truncate ${TEXT_SIZE.body} font-medium text-foreground`}>{notice.title}</Text> <Text class={`shrink-0 ${TEXT_SIZE.small} text-muted-foreground tabular-nums`}>{notice.at}</Text> </View> <Text class={`${TEXT_SIZE.smallLoose} text-muted-foreground line-clamp-2`}>{notice.body}</Text> {notice.tag ? ( <View class="flex-row pt-0.5"> <Tag variant="soft" tone="warning" label={notice.tag} /> </View> ) : undefined} </View> } actions={<IconButton icon="trash" size="xs" label="Delete" testID={`compound-delete-${notice.id}`} onPress={() => last.set(`$Delete: ${notice.title}`)} />} /> ))} </ListBox> </View> <Text class={`${TEXT_SIZE.small} text-muted-foreground`}>{last() || (TOUCH ? 'Try the buttons at the end of a row' : 'Hover for actions, or right-click')}</Text> </View> )}Selected and current
Section titled “Selected and current”selected is a lasting selection (selection fill, read as selected); current is a passing highlight (read as the current item): by default a faint highlight fill that only marks a position; when it is the only indicator of the keyboard’s current item, as in a suggestion list, add currentTone=“strong” (the menu-current brand-tinted fill, same as the menu current row, no inset ring). size=“sm” is a compact 32 row.
Phone: selected is a persistent selection (selection fill, announced as selected); current is a temporary highlight (a light highlight fill) for business focus only.
import { View, signal } from 'nsh'import { Icon, ListBox, ListRow } from 'nacre'
export function ListSelectedCurrent() { const items = ['Hello, how can I help you?', 'One moment, let me check.', 'Thanks for waiting.'] const current = signal(1) return ( <View class="flex-row flex-wrap items-start gap-3"> <View class="w-[300px] max-w-full rounded-xl border border-border"> <ListBox> <ListRow testID="sc-selected" title="Hong Kong team (selected)" selected onPress={() => {}} trailing={<Icon name="check" size={14} color="selection-indicator" />} /> </ListBox> </View> <View class="w-[300px] max-w-full rounded-xl border border-border"> <ListBox> {items.map((text, index) => ( <ListRow testID={`sc-current-${index}`} size="sm" title={text} current={current() === index} currentTone="strong" onPress={() => current.set(index)} /> ))} </ListBox> </View> </View> )}Management list
Section titled “Management list”Reorder, rename and delete go in actions, with revealActions=“always” to keep them visible; a row without onPress is not a button, only its actions are pressable.
import { View, signal } from 'nsh'import { IconButton, ListBox, ListRow, TOUCH } from 'nacre'
export function ListManage() { const names = signal(['Account opening', 'Transfers', 'Trading']) const move = (index: number, offset: -1 | 1) => names.update((list) => { const next = [...list] const [item] = next.splice(index, 1) next.splice(index + offset, 0, item as string) return next }) return ( <View class={`${TOUCH ? 'w-full' : 'w-[300px] max-w-full rounded-xl border border-border'}`}> <ListBox> <Each of={names()} key={(name) => name}> {(name, index) => ( <ListRow testID={`manage-${index()}`} size="sm" title={name()} revealActions="always" actions={ <> <IconButton icon="chevron-up" size="xs" label="Move up" testID={`manage-up-${index()}`} disabled={index() === 0} onPress={() => move(index(), -1)} /> <IconButton icon="chevron-down" size="xs" label="Move down" disabled={index() === names().length - 1} onPress={() => move(index(), 1)} /> <IconButton icon="trash" size="xs" label="Delete" onPress={() => names.update((list) => list.filter((v) => v !== name()))} /> </> } /> )} </Each> </ListBox> </View> )}Disabled compound row
Section titled “Disabled compound row”A disabled row shows at 40% opacity, takes no press and is not in the Tab order.
Phone: When disabled the row content drops to 40% and is not tappable.
import { Text, View } from 'nsh'import { ListBox, ListRow, TEXT_SIZE, TOUCH } from 'nacre'
export function ListDisabledCompound() { return ( <View class={`${TOUCH ? 'w-full' : 'w-[300px] max-w-full rounded-xl border border-border'}`}> <ListBox> <ListRow testID="compound-disabled" accessibilityLabel="Archived notice" disabled onPress={() => {}} content={<Text class={`${TEXT_SIZE.body} text-foreground`}>Archived notice</Text>} /> </ListBox> </View> )}Fixed height
Section titled “Fixed height”Give height when a virtual list needs rows of equal height (64 in the conversation list): the row no longer grows with its content, and the avatar and content center vertically; onHoverChange reports the pointer entering and leaving, for hints in content that only show on hover.
Phone: Give a height for equal-height rows in a virtual list (64 in the chat list): rows no longer grow with content, and avatar and content center vertically.
import { Text, View, signal } from 'nsh'import { Avatar, ListBox, ListRow, TEXT_SIZE, TOUCH } from 'nacre'
export function ListFixedHeight() { const rows = [ { id: 'f1', name: 'Lin Jiayi', preview: 'OK, I will add the documents', at: '14:32' }, { id: 'f2', name: 'Michael Wong', preview: 'How long does opening an HK account take?', at: 'Yesterday' }, ] const opened = signal('f1') const hovered = signal('') return ( <View class={`${TOUCH ? 'w-full' : 'w-[300px] max-w-full rounded-xl border border-border'}`}> <ListBox> {rows.map((row) => ( <ListRow testID={`fixed-${row.id}`} accessibilityLabel={[row.name, row.at, row.preview].join(' · ')} height={64} selected={opened() === row.id} onPress={() => opened.set(row.id)} onHoverChange={(on) => hovered.set(on ? row.id : hovered() === row.id ? '' : hovered())} leading={<Avatar name={row.name} size={40} />} content={ <View class="gap-0.5"> <View class="h-5 flex-row items-center gap-1.5"> <Text class={`flex-1 min-w-0 truncate ${TEXT_SIZE.body} font-medium text-foreground`}>{row.name}</Text> <Text testID={`fixed-hint-${row.id}`} class={`shrink-0 ${TEXT_SIZE.small} text-muted-foreground`} classList={{ 'opacity-0': hovered() !== row.id }}> Hover </Text> <Text class={`shrink-0 ${TEXT_SIZE.small} text-muted-foreground tabular-nums`}>{row.at}</Text> </View> <Text class={`truncate ${TEXT_SIZE.small} text-muted-foreground`}>{row.preview}</Text> </View> } /> ))} </ListBox> </View> )}Keyboard
Section titled “Keyboard”| Key | Action |
|---|---|
| Tab | Move between pressable rows (and trailing actions) |
| Space / Return | Press the current row |
| Shift+F10 | Open the context menu on the focused row (onContextMenu) |
Accessibility
Section titled “Accessibility”- A ListRow with onPress is a button, and selected reads as selected; a row without onPress is just text.
- Without accessibilityLabel, a ListRow reads its text; a ListActionRow reads its title by default.
- A ListActionRow’s trailing action is a separate button and needs its own label (“Delete”).
- Disabled rows are not in the Tab order and show at 40% opacity.
- selected reads as selected and current as the current item (aria-current); they also look different: a selection fill / a highlight fill (with currentTone=“strong”, the menu-current brand-tinted fill, which selected doesn’t hide).
- Actions are separately named buttons after the row in the Tab order. Include the title, time and visible summary in a custom compound row’s accessible name.
Do / Don’t
Section titled “Do / Don’t”Do
- Always put ListRow in a ListBox
- Truncate long titles and show them in full on hover
- Use a fixed trailingWidth for trailing status
- Put edit and delete in actions, not in content
Don’t
- Put several primary buttons in a row
- Change the height on hover
- Inset rows yourself with p-1 / mx-1
- Put buttons in content (a button inside a button)
- Pass fill classes to the row: selected / current / disabled decide its look
Property descriptions follow the Chinese source comments.
ListRow
Section titled “ListRow”| Prop | Type | Default | Description |
|---|---|---|---|
title |
string |
— | 标题模式:单行标题(与 content 二选一) |
subtitle |
string |
— | 第二行(分组、说明)。默认双行桌面 52、手机至少 64,单行桌面 36、手机至少 48 |
content |
JSX.Element |
— | 复合模式:任意内容(多行标题 + 摘要 + 标签),替代 title / subtitle;字色字号由内容自己定,底色、焦点环、按下态仍由行管 |
leading |
JSX.Element |
— | 头像、状态点、图标。标题模式按整行垂直居中;复合模式(content)贴顶,和首行对齐 |
trailing |
JSX.Element |
— | 勾选、计数、状态:固定宽的 lane,不随内容挤动文字;在主点击区之内 |
trailingWidth |
number |
16 |
|
actions |
JSX.Element |
— | 独立操作(编辑、删除、排序):一般是 IconButton。渲染在主点击区之外、同一行的右端,按下不触发行的 onPress, 各自是 Tab 停靠点;默认悬停或行内有焦点时才显现(revealActions)。主点击区给它让出宽度,文字不钻到按钮底下 |
revealActions |
'hover' | 'always' |
— | 桌面端操作何时显现:hover(默认,悬停或行内有焦点时)/ always(常显);手机常显 |
size |
'md' | 'sm' |
— | md 默认,标题模式桌面单行 36 / 双行 52,手机至少 48 / 64。sm 紧凑行桌面 32、手机 44 |
height |
number |
— | 固定行高(虚拟列表要等高的行,如会话列表 64):不再按内容撑高、不加上下内边距,内容与 leading 垂直居中;size=“sm” 时不生效 |
selected |
boolean |
— | 持久选中(多选、当前打开的项):selection 底,读屏念「已选中」 |
current |
boolean |
— | 临时高亮(业务定位、键盘在建议列表里移到的当前项):读屏念「当前项」;样子看 currentTone |
currentTone |
'subtle' | 'strong' |
— | current 的样子。subtle(默认):highlight 淡底,只做业务定位,和 selected 同时给时按 selected 画。 strong:menu-current 淡品牌底(不加内环,同菜单当前行),行是建议列表里唯一的键盘当前项指示时用(行不拿焦点、没有焦点环可依靠); 不被 selected 盖住,标题与副文案换 menu-current-foreground,复合模式(content)里的文字与图标由调用方按 current 换成 menu-current-foreground |
disabled |
boolean |
— | |
focusable |
boolean |
— | 没有 onPress 也要进 Tab 序列时给 true;给了 onPress 默认就是停靠点 |
role |
'button' | 'link' |
'button' |
button(默认,有 onPress 时)/ link(打开外部页面) |
onPress |
() => void |
— | |
onContextMenu |
(e: ContextMenuEvent) => void |
— | 右键 / Shift+F10:在 e.pagePosition 弹菜单;落在 actions 上的右键不会到这里 |
onHoverChange |
(hovered: boolean) => void |
— | 悬停进出整行(含 actions):content 里只在悬停时显现的次要控件用它;行尾独立操作直接放 actions |
onFocus |
() => void |
— | 主点击区拿到 / 失去键盘焦点 |
onBlur |
() => void |
— | |
viewRef |
(node: ViewRef) => void |
— | 主点击区的 ref(滚到可见、程序聚焦) |
tooltip |
string |
— | 悬停提示(复合模式用;标题模式自动给标题提示) |
accessibilityLabel |
string |
— | 读屏名;不给时读屏念行内文字 |
testID |
string |
— | 给主点击区(按下、读屏、焦点都在它上面) |
* required
ListBox
Section titled “ListBox”| Prop | Type | Default | Description |
|---|---|---|---|
class |
string |
— | |
testID |
string |
— | |
children |
JSX.Element |
— |
* required
ListActionRow
Section titled “ListActionRow”| Prop | Type | Default | Description |
|---|---|---|---|
title * |
string |
— | |
onPress * |
() => void |
— | |
action * |
JSX.Element |
— | 行尾的独立操作(删除、移除):一般是 IconButton size="xs";和行本体并排,不套在行按钮里 |
size |
'sm' | 'md' |
— | sm 28、12pt(浮层里的紧凑列表,默认);md 36、13pt(同 ListRow 单行) |
selected |
boolean |
— | |
disabled |
boolean |
— | |
accessibilityLabel |
string |
— | 读屏名;不给时读标题 |
testID |
string |
— | |
class |
string |
— | 根节点的布局类 |
* required
ChoiceList
Section titled “ChoiceList”| Prop | Type | Default | Description |
|---|---|---|---|
options * |
readonly ChoiceListOption[] |
— | |
value * |
readonly string[] |
— | |
onChange * |
(value: string[]) => void |
— | |
mode |
'single' | 'multiple' | 'tags' |
— | single 单选、multiple 多选、tags 多选并显示已选标签。默认 single。 |
fallbackNames |
Readonly<Record<string, string>> |
— | |
placeholder * |
string |
— | |
emptyText * |
string |
— | |
loadingText |
string |
— | |
disabledText |
string |
— | |
heading |
string |
— | |
invalid |
boolean |
— | |
height |
number |
220 |
|
limit |
number |
— | |
testID |
string |
— |
* required
TouchAction
Section titled “TouchAction”| Prop | Type | Default | Description |
|---|---|---|---|
label * |
string |
— | |
onPress * |
() => void |
— | |
testID |
string |
— | |
disabled |
boolean |
— | |
expanded |
boolean |
— | |
children * |
JSX.Element |
— |
* required
TouchGroup
Section titled “TouchGroup”| Prop | Type | Default | Description |
|---|---|---|---|
testID |
string |
— | |
title |
string |
— | |
hint |
string |
— | |
children |
JSX.Element |
— |
* required
TouchRow
Section titled “TouchRow”| Prop | Type | Default | Description |
|---|---|---|---|
testID |
string |
— | |
label |
string |
— | 标题;给了 content 时可省 |
description |
string |
— | 标题下面的说明或所属路径。长文字换行,整行随内容增高。 |
leading |
JSX.Element |
— | 行首(色点、图标),宽度由调用方给 |
detail |
string |
— | 行尾的说明文字(当前值、接待量),灰字 |
detailClass |
string |
'text-muted-foreground' |
|
trailing |
JSX.Element |
— | 行尾自定义内容(开关) |
checked |
boolean |
— | 选中项右侧打勾;默认单选,复选行传 checkRole=“checkbox” |
checkRole |
'checkbox' | 'radio' |
'radio' |
|
chevron |
boolean |
— | 进入下一级:右侧箭头 |
destructive |
boolean |
— | |
disabled |
boolean |
— | |
onPress |
() => void |
— | |
pressedByParent |
boolean |
— | 点按由外层接(MenuTrigger 加 group 和 touchSeparator()):分隔线由外层画,按下高亮跟外层走,仍铺满整宽 |
content |
JSX.Element |
— | 复合内容,替换标题与说明那一列(记录卡、小记、字段名 + 值):上下各 12,宽度占满,行首、行尾、箭头照常。 内容自己排版,字号走 TEXT_SIZE;读屏名用 accessibilityLabel 给,不给就念内容里的文字。 |
accessibilityLabel |
string |
— | |
separatorByParent |
boolean |
— | 分隔线与左缩进由外层负责:行被 LongPressMenu 这类包裹层包着时,外层带 touchSeparator() 画线并吃掉左 16,行不再画线。 行被包住后永远是包裹层的唯一子元素,自己画的线会被 last:pb-0 吃掉,所以必须交给外层。直接放在 TouchGroup 里的行不要传。 |
* required