Components
Popover
A non-modal panel anchored to a trigger, for short forms and details.
Ombelle · light
Sharing
Installation
Run in a project initialized with an Ombelle preset (see Get started). The component uses the saved project preset. Run the command from your app folder; it shows the changes and asks before writing.
pnpm dlx @ombelle-ui/cli@1.1.2 add popoverAdds components/ui/popover.tsx and installs react, @radix-ui/react-popover, clsx, tailwind-merge with lifecycle scripts disabled. This is a client component.
In a liquid glass project the plan adds a notice that accessibility is not guaranteed, because text contrast depends on the background behind the glass.
Usage
example.tsx
import {
Popover, PopoverTrigger, PopoverContent, PopoverTitle, PopoverDescription,
} from '@/components/ui/popover'
import { Button } from '@/components/ui/button'
export function SharePreset() {
return (
<Popover>
<PopoverTrigger asChild><Button>Share preset</Button></PopoverTrigger>
<PopoverContent aria-labelledby="share-title">
<PopoverTitle id="share-title">Share preset</PopoverTitle>
<PopoverDescription>Anyone with the link can install this preset.</PopoverDescription>
</PopoverContent>
</Popover>
)
}API and states
- API
- Popover, PopoverTrigger, PopoverAnchor, PopoverContent (side, align), PopoverTitle (level), PopoverDescription, PopoverArrow
- Minimum states
- Open, closed, focus
- Native basis
- Reviewed Radix popover primitive
- Styles
- Stable in Ombelle, Papier, Organic, Retro futurism, minimalist, neo-brutalism and flat, light and dark. Liquid glass: stable, accessibility not guaranteed.