ZUI

Search documentation

Find a page or a heading.

Model list

The frame for a model list section, a header over a scrolling content area, with a remove button and loading placeholders.

Installation

bash

The CLI writes components/layout/model-list.tsx, installs Button, Icon, Item, Scroll area, Skeleton, Text and Utils, and adds lucide-react-native.

Usage

tsx
tsx

It owns no list state: it does not filter, group, sort or paginate. Place it in a parent of bounded height so the content scrolls. Show a ModelListSkeleton in the content while the list loads.

Two things the web's frame does from its own classes, the caller writes on the element itself here:

  • an unavailable model's Item takes opacity-50, as above;
  • a TabsList in the header takes basis-full, so it has a line of its own:
tsx

Composition

text

API reference

ModelList

Takes every prop of a View. A column filling its parent, which must have a bounded height for the content to scroll.

ModelListHeader

Takes every prop of a View. A row of the title and trailing controls, wrapping onto a second line when they do not fit.

ModelListTitle

Takes every prop of Text. The section's heading, announced as a heading, growing to push the header's controls to its end.

ModelListAction

Takes every prop of a View. Trailing header controls, such as a search field or a refresh button.

ModelListContent

Takes every prop of ScrollArea. The scrolling region filling the rest of the frame; its children stack with a gap.

ModelListRemoveButton

Takes every prop of Button. A ghost small icon button with a trash icon, named "Remove model" unless given its own aria-label; children replace the icon.

ModelListSkeleton

Takes every prop of a View, plus:

Placeholder items in the shape of a model item: a media placeholder, two text lines and a trailing control.

Differences from the web

  • The web dims an Item marked data-unavailable and stretches a TabsList across the header through selectors that reach into its children, which React Native has no counterpart of; write opacity-50 and basis-full on those elements, as above.
  • onPress stands in for the web's onClick.
  • The web's data-slot attributes are not set; a View takes no data attributes.