Skip to content

Cell ​

A list cell. On the left an icon + title (with an optional required asterisk and a subtitle), on the right a value and an arrow, with a bottom divider.

Spec source: lh-ui-core/specs/cell.json · Golden cases: lh-ui-core/cases/cell.json (6 entries, translated into XCTest, runnable on the macOS host)

Basic usage ​

title is required; value / label / icon are optional. bordered controls the bottom divider (on by default).

9:41Cell basic
Title text
Right value
›
With subtitle
This is the subtitle description text
›
No divider
Value

HTML mock preview (iOS / SwiftUI appearance), not an on-device render

swift
LhCell(title: "Title text", value: "Right value", clickable: true) {
  // lhOnClick
}

Icon / required / not clickable ​

icon goes through the LhIconMap mapping; required shows a red asterisk before the title; when clickable = false (the default) taps are not handled (golden case not-clickable-no-onclick).

9:41Cell extras
Left icon
›
*Required field
Please select
›

HTML mock preview (iOS / SwiftUI appearance), not an on-device render

API ​

Props ​

PropDescriptionTypeDefault
titleTitle (required)String—
valueRight-side valueString""
labelSubtitle under the titleString""
iconLogical name of the left icon (mapped via LhIconMap)String?nil
borderedWhether to show the bottom dividerBooltrue
clickableWhether clickable (controls the arrow and the tap gate)Boolfalse
requiredWhether to show a red required asterisk before the titleBoolfalse
lhOnClickTap callback; not fired when clickable = false(() -> Void)?nil

Text hierarchy ​

AreaFont sizeColor
Titlecell.fontSizeTitle (14pt)color.text.primary
Subtitlecell.fontSizeLabel (13pt)color.text.secondary
Right valuecell.fontSizeValue (14pt)color.text.secondary
Required asteriskcell.fontSizeTitlecolor.danger.default

Token Reference ​

TokenPurpose
cell.paddingHorizontal / cell.paddingVerticalPadding (follows spacing.base / spacing.sm)
cell.fontSizeTitle / cell.fontSizeLabel / cell.fontSizeValueThe three text font sizes
cell.iconSizeLeft icon size
cell.gapGap between sections (follows spacing.sm)
cell.borderWidthBottom divider width
color.border.lighterBottom divider color
color.text.{primary,secondary}Title and value / subtitle colors
color.danger.defaultRequired asterisk color
color.background.defaultCell background

Golden Case Mapping ​

case idAssertionLocal test
title-and-value-renderBoth the title and the value are drawntestTitleAndValueUseFontTokens
label-renders-secondary-toneThe subtitle takes the secondary text colortestLabelRendersSecondaryTone
required-uses-danger-tokenThe required asterisk takes the danger tokentestRequiredUsesDangerToken
bordered-emits-line-commandThe divider consumes the border.lighter tokentestBorderedUsesBorderTokens
clickable-emits-onclickWhen clickable, the tap fires lhOnClicktestClickableIsInteractive
not-clickable-no-onclickWhen not clickable, the tap does not fire lhOnClicktestNotClickableIsNotInteractive

Plus dedicated dark-mode tests: testDarkColorsComeFromDarkTokens / testDimensionsAreIdenticalInDarkMode / testCellInitAndRender / testLayoutUsesCellTokens.

bash
swift test --filter LhCellTests    # Runs on the macOS host, no simulator required

lh-ui native bloodline · iOS (Swift + SwiftUI)