EmptyState
EmptyState provides a consistent visual for screens or sections with no content. It includes an icon, title, subtitle, and optional action button.
Preview
Section titled “Preview”No Readings YetCast your first hexagram to begin your journey
Variants
Section titled “Variants”Full (Default)
Section titled “Full (Default)”Takes full available space, centered vertically.
Nothing SavedYour saved readings will appear here
Compact
Section titled “Compact”For inline empty states within lists or sections.
No ResultsTry a different search term
With Action
Section titled “With Action”Start Your PracticeLearn the ancient wisdom of the I Ching
<EmptyState icon="☯" title="Start Your Practice" subtitle="Learn the ancient wisdom of the I Ching" actionLabel="Begin Learning" onAction={handleStartLearning}/>Common Use Cases
Section titled “Common Use Cases”No History
No Results
No Favorites
API Reference
Section titled “API Reference”| Prop | Type | Default | Description |
|---|---|---|---|
icon | string | '☯' | Emoji or symbol to display |
title | string | - | Main message |
subtitle | string | - | Supporting text |
actionLabel | string | - | Button text |
onAction | () => void | - | Button press handler |
compact | boolean | false | Use compact variant |
Tokens Used
Section titled “Tokens Used”// Typographytheme.typography.fontFamily.serif // Title fonttheme.typography.fontSize.headlineS // Title size (full)theme.typography.fontSize.bodyL // Title size (compact)
// Colorstheme.colors.gray300 // Title colortheme.colors.gray500 // Subtitle colortheme.colors.goldPrimary // Action buttonAccessibility
Section titled “Accessibility”- Role: Container uses
accessibilityRole="text" - Title: Uses
accessibilityRole="header" - Action: Button has proper
accessibilityRole="button"andaccessibilityLabel
<EmptyState icon="📚" title="No Readings" subtitle="Your reading history will appear here" actionLabel="Cast First Reading" onAction={handleCast}/>Complete Example
Section titled “Complete Example”import { EmptyState } from '@synchronicity/react-native';import { View } from 'react-native';
function HistoryScreen({ readings }) { if (readings.length === 0) { return ( <ScreenContainer> <EmptyState icon="☯" title="No Readings Yet" subtitle="Cast your first hexagram to begin your journey of self-discovery" actionLabel="Cast Hexagram" onAction={() => navigation.navigate('Cast')} /> </ScreenContainer> ); }
return ( <ScreenContainer> <FlatList data={readings} renderItem={({ item }) => <ReadingListItem reading={item} />} /> </ScreenContainer> );}