- Label
- Icon label
- Field
- Form
- Frontmatter form
- Questionnaire
- Input
- Input group
- Input OTP
- Password input
- Password strength
- Code input
- Number field
- Tag input
- Textarea
- Checkbox
- Radio group
- Language toggle group
- Emoji appearance toggle group
- Emoji picker
- Avatar picker
- AI provider picker
- Select
- Native select
- Combobox
- Language combobox
- Slider
- Calendar
- Switch
- Alert
- Avatar
- Badge
- Card
- AI provider card
- Model info card
- Model list
- Empty
- Item
- Tree item
- File tree
- Icon media
- File type icon
- Font preview
- Image preview
- Kbd
- Table
- Data table
- Data table column header
- Chart
- Code Block
- Code card
- Markdown view
- Attachment
- Bubble
- Marker
- Message
- Chat message
- Chat suggestion item
- Message scroller
- Trace
- Progress
- Spinner
- Sonner
- Toast
- Unsaved changes toolbar
- Unsaved indicator
- Status indicator
- Permission card
- Separator
- Skeleton
- Animated grid pattern
- Meteors
Installation#
pnpm dlx shadcn@latest add @zui/markerThe CLI writes components/ui/marker.tsx, installs Text,
Icon and Utils, and adds @rn-primitives/slot and
class-variance-authority.
Usage#
import { GitBranch } from 'lucide-react-native';
import { Icon } from '@/components/ui/icon';
import { Marker, MarkerContent, MarkerIcon } from '@/components/ui/marker';<Marker>
<MarkerIcon>
<Icon as={GitBranch} />
</MarkerIcon>
<MarkerContent>Switched to a new branch</MarkerContent>
</Marker>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:
<Marker asChild variant="separator">
<Pressable role="button" onPress={loadEarlier}>
<MarkerContent>Show earlier messages</MarkerContent>
</Pressable>
</Marker>API reference#
Marker#
Takes every prop of React Native's View, plus:
| Prop | Type | Default |
|---|---|---|
variant | 'default' | 'separator' | 'border' | 'default' |
asChild | boolean | false |
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
renderprop. The native one takesasChild. - Upstream draws a separator's lines as
::beforeand::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
shimmerclass, which has no native counterpart.