The Popover component provides a flexible way to display contextual content, forms, and interactive menus. Perfect for note-taking interfaces, command palettes, and project status displays.
Installation
Examples
Menu Popover
Command Palette
Project Status
Usage
Basic Menu
Form Input
Types
Customization
Custom Animation Settings
Custom Trigger Styles
Custom Content Layout
Notes
- Built with Framer Motion for smooth animations
- Uses React Context for state management
- Handles click outside and escape key events
- Responsive design with mobile-first approach
- TypeScript support with proper types
- Integrates with Shadcn UI components
- Supports custom styling and theming
- Optimized performance with proper hooks usage
Features
- Smooth open/close animations
- Form handling with textarea
- Menu-style interactions
- Command palette functionality
- Project status displays
- Click outside detection
- Keyboard navigation
- Dark mode support
- Custom trigger variants
- Flexible content layouts
- Compound component pattern
- Accessibility features
Props
Component | Prop | Type | Description |
---|---|---|---|
PopoverRoot | children | React.ReactNode | The popover trigger and content |
PopoverTrigger | variant | "default" | "outline" | "secondary" | "ghost" | The style variant of the trigger button |
PopoverContent | className | string | Additional classes for the content |
PopoverForm | onSubmit | (note: string) => void | Callback when form is submitted |
PopoverButton | onClick | () => void | Callback when button is clicked |
PopoverTextarea | value | string | The current value of the textarea |
PopoverLabel | children | React.ReactNode | The label text |
PopoverHeader | children | React.ReactNode | The header content |
PopoverBody | children | React.ReactNode | The main content |
PopoverFooter | children | React.ReactNode | The footer content |