ZUI

Search documentation

Find a page or a heading.

Marker

A status, a system note, a ruled row or a labelled separator in a conversation.

Installation

bash

The CLI writes components/ui/marker.tsx, installs Text, Icon and Utils, and adds @rn-primitives/slot and class-variance-authority.

Usage

tsx
tsx

Give a marker that streams progress, such as "Thinking...", role="status". To make a marker take a press, give it asChild and a Pressable child:

tsx

API reference

Marker

Takes every prop of React Native's View, plus:

separator draws a line either side of the text, and border rules a line under the row. With role="status", a screen reader announces the marker's text as it changes. With asChild, the marker renders its single child in place of the View, with the marker's props and classes merged on and a separator's lines inside it. The file also exports markerVariants.

MarkerIcon

Takes every prop of React Native's View. Draws an Icon child at 16px and hides it from screen readers.

MarkerContent

Takes every prop of Text. Nest a Text in it to set part of the text apart, such as a name with font-medium.

Differences from upstream

  • Upstream's Marker takes a render prop. The native one takes asChild.
  • Upstream draws a separator's lines as ::before and ::after. The native Marker draws them as two Views around its children.
  • Upstream underlines a link inside the marker by its tag. A device has no link tag, so underline a link yourself with underline.
  • Upstream's demo shimmers "Thinking..." with shadcn's shimmer class, which has no native counterpart.