Skip to content

Cell ​

A list cell with a three-part layout — icon / title + label / right-side value plus arrow — commonly composed into lists.

Spec source: lh-ui-core/specs/cell.json · Golden cases: cases/cell.json (6 cases, translated into JVM unit tests + Compose UI Test)

Basic usage ​

9:41Cell
Title text
Right value
Title with a label
Label text
Value
*Required
Detail

HTML mock preview (Android / Compose look), not an on-device render

kotlin
LhCell(
  title = "带描述的标题",
  label = "描述文字",
  value = "值",
  isLink = true,
  lhOnClick = { /* navigate */ },
)

required draws a red asterisk in front of the title (color.danger.default); isLink draws a right-arrow icon at the end.

9:41Cell variants
*Required
Arrow →
Borderless
Value

HTML mock preview (Android / Compose look), not an on-device render

API ​

Props ​

PropDescriptionTypeDefault
titleTitle (primary text)String?null
modifierModifierModifierModifier
valueRight-side value (secondary text, right-aligned)String?null
labelDescription text below the titleString?null
borderedWhether to draw the bottom divider (color.border.lighter)Booleantrue
clickableWhether the cell is tappable; when true, shows a trailing indicator arrow and responds to tapsBooleanfalse
requiredWhether to show the red required asterisk in front of the title (color.danger.default)Booleanfalse
iconLeft-side icon name (local icon system); nothing is drawn when emptyString?null
lhOnClickTap callback; not triggered when clickable is false(() -> Unit)?null
titleContentTitle content (overrides title; the spec's default slot)@Composable (() -> Unit)?null
valueContentRight-side value content (overrides value; the spec's value slot)@Composable (() -> Unit)?null

clickable controls both "whether the trailing arrow is drawn" and "whether the whole row responds to taps" — a tap only fires when clickable = true and lhOnClick is non-null.

Token reference ​

TokenUsage
cell.paddingVerticalVertical padding (references spacing.md)
cell.paddingHorizontalHorizontal padding (spacing.md)
cell.fontSizeTitle / cell.fontSizeLabel / cell.fontSizeValueTitle / label / value font sizes
cell.gapGap between the icon and the title (spacing.xs)
icon.size.mediumLeft-side icon and indicator arrow size
cell.borderWidthBottom divider width
typography.lineHeight.primaryText line height
color.text.{primary,secondary}Title / label / value colors
color.danger.defaultThe red required asterisk
color.border.lighterThe bottom divider

Golden case reference ​

case idAssertionLocal test
title-and-value-renderThe title and right value render their textLhCellTest.title_and_value_render (Compose UI Test)
label-renders-secondary-toneThe label takes the secondary text tokenLhCellDefaultsTest.label_uses_secondary_text_token
required-uses-danger-tokenThe required marker takes the danger tokenLhCellDefaultsTest.required_uses_danger_token
bordered-emits-line-commandThe divider consumes the border tokenLhCellDefaultsTest.bordered_uses_border_lighter_token
clickable-emits-onclickA tap triggers onClickLhCellTest.clickable_emits_onClick
not-clickable-no-onclickThe non-clickable state does not triggerLhCellTest.not_clickable_no_onClick
bash
./gradlew :components:cell:test                              # JVM part
./gradlew :components:cell:connectedAndroidTest              # Interaction part (requires a device)

lh-ui native bloodline · Android (Kotlin + Compose)