Get started
Forms
- 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
Display
- 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
Layout
Installation#
bash
pnpm dlx shadcn@latest add @zui/emptyThe CLI writes components/ui/empty.tsx, installs Text,
Icon and Utils, and adds class-variance-authority.
Usage#
tsx
import { FolderOpen } from 'lucide-react-native';
import { Button } from '@/components/ui/button';
import { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from '@/components/ui/empty';
import { Icon } from '@/components/ui/icon';
import { Text } from '@/components/ui/text';tsx
<Empty>
<EmptyHeader>
<EmptyMedia variant="icon">
<Icon as={FolderOpen} />
</EmptyMedia>
<EmptyTitle>No projects yet</EmptyTitle>
<EmptyDescription>Create your first project to start tracking work.</EmptyDescription>
</EmptyHeader>
<EmptyContent>
<Button>
<Text>Create project</Text>
</Button>
</EmptyContent>
</Empty>The Empty's border is dashed but has no width; add border border-border to draw it, as the demo does. A
device has no base border colour, so a border class you add names its colour too.
API reference#
Empty#
Takes every prop of React Native's View. It centres its children, and every Text inside is centred.
EmptyHeader, EmptyContent#
Each takes every prop of React Native's View. EmptyHeader holds the media, title and description;
EmptyContent holds actions.
EmptyMedia#
Takes every prop of React Native's View, plus:
| Prop | Type | Default |
|---|---|---|
variant | 'default' | 'icon' | 'default' |
default draws its child as it is, such as an image. icon draws an Icon child on a muted tile, at 24px in
Vega and 16px in Nova.
EmptyTitle, EmptyDescription#
Each takes every prop of Text. EmptyDescription is muted.
Differences from upstream#
- Upstream's Empty grows to fill its parent with
flex-1. Inside a scroll view, which is where most native screens put it, that collapses the box, so the native Empty takes its content's height. Addflex-1to fill a parent with a height of its own. - Upstream underlines a link inside the description. React Native has no nested link element to select, so style a pressable Text inside it yourself.