Layout and lists

List

A native scrolling list of rows.

iOSSwiftUI ListAndroidCompose LazyColumnRenders in a Screen or an Island
List on iOS
iOSSwiftUI List
List on Android
AndroidCompose LazyColumn

Import

ts
import {List, ListItem} from '@hzblj/kara-ui'

Props

A scrolling list — SwiftUI List, Compose LazyColumn. It has no height of its own, so it needs one from outside: a Screen, or an Island with matchContents={false} and a height. In an island that sizes itself to its content Compose measures it against an infinite height and throws ("Vertically scrollable component was measured with an infinity maximum height"); SwiftUI shows nothing. For a handful of rows that should not scroll, use a VStack.

PropTypeDescription
children*ReactNode

The rows — native views, one row each.

onRefresh() => Promise<void>

Enables pull-to-refresh. Async on purpose — see ScrollViewProps.onRefresh: the spinner runs until the promise settles, so neither platform needs a refreshing flag kept in sync by hand.

testIDstring

Test identifier, forwarded to the native view on iOS — Android ignores it.

children*
ReactNode

The rows — native views, one row each.

onRefresh
() => Promise<void>

Enables pull-to-refresh. Async on purpose — see ScrollViewProps.onRefresh: the spinner runs until the promise settles, so neither platform needs a refreshing flag kept in sync by hand.

testID
string

Test identifier, forwarded to the native view on iOS — Android ignores it.

Platform notes

  • A list scrolls, so it needs a height from outside: a Screen, or an Island with matchContents={false} and a height.
  • Rows are separated for you — a Divider among them is one too many.
  • onRefresh returns a promise; the spinner runs until it settles.