# EmptyState
Component for displaying empty states when there's no content to show.
## Features
- ✅ Icon or emoji support
- ✅ Title and description
- ✅ Custom colors
- ✅ Optional action button/content
- ✅ Customizable padding
- ✅ TypeScript support
## Installation
```bash
npx @memoro/ui add empty-state
```
Dependencies: `text`, `icon`
## Usage
### With Icon
```tsx
import { EmptyState } from '@/components/ui/EmptyState/EmptyState';
;
```
### With Emoji
```tsx
```
### With Action Button
```tsx
```
### Custom Colors
```tsx
```
### Custom Icon Size
```tsx
```
## Props
| Prop | Type | Default | Description |
| ------------------ | ----------- | ----------- | -------------------------------- |
| `icon` | `string` | - | Icon name (Ionicons/SF Symbol) |
| `emoji` | `string` | - | Emoji to display instead of icon |
| `iconSize` | `number` | `60` | Icon or emoji size |
| `iconColor` | `string` | `'#9CA3AF'` | Icon color (not for emoji) |
| `title` | `string` | - | **Required** - Title text |
| `description` | `string` | - | **Required** - Description text |
| `titleColor` | `string` | `'#1F2937'` | Title text color |
| `descriptionColor` | `string` | `'#6B7280'` | Description text color |
| `padding` | `number` | `32` | Container padding |
| `style` | `ViewStyle` | - | Additional container styles |
| `children` | `ReactNode` | - | Optional content (e.g., button) |
## Examples
### No Search Results
```tsx
```
### No Network Connection
```tsx
```
### First Time User
```tsx
```
### Error State
```tsx
```
### Gallery Empty
```tsx
```
## Common Use Cases
| Use Case | Icon/Emoji | Title Example |
| ------------ | ---------------------- | ---------------------- |
| No items | `emoji="📦"` | "No items yet" |
| No images | `icon="images"` | "No images" |
| No results | `icon="search"` | "No results found" |
| Empty inbox | `emoji="📬"` | "Inbox empty" |
| No favorites | `icon="heart-outline"` | "No favorites" |
| Error state | `icon="warning"` | "Something went wrong" |
| Offline | `emoji="📡"` | "You're offline" |
| Welcome | `emoji="👋"` | "Welcome!" |
## Layout
The component:
- Centers content vertically and horizontally
- Uses `flex: 1` to fill available space
- Stacks icon/emoji, title, description, and children vertically
- Adds 16px margin below icon/emoji
- Adds 8px margin below title
- Adds 24px margin above children (if present)
## With Theme
```tsx
import { useTheme } from '~/contexts/ThemeContext';
import { EmptyState } from '@/components/ui/EmptyState';
function ThemedEmptyState() {
const { theme } = useTheme();
return (
);
}
```
## Dependencies
- `Text` component
- `Icon` component
## Notes
- Use either `icon` OR `emoji`, not both
- Icon uses the Icon component (SF Symbols on iOS, Ionicons elsewhere)
- Emoji is rendered as text with large font size
- Children are typically action buttons
- Component fills available vertical space with `flex: 1`