Copy to clipboard
This is the popover content.
Installation
Copy to clipboard
npx bearnie add popover
npx bearnie add popover
bunx bearnie add popover
bunx bearnie add popover
pnpm dlx bearnie add popover
pnpm dlx bearnie add popover
yarn dlx bearnie add popover
yarn dlx bearnie add popover
Copy to clipboard
import Popover from "@/components/ui/popover/Popover.astro";
import PopoverTrigger from "@/components/ui/popover/PopoverTrigger.astro";
import PopoverContent from "@/components/ui/popover/PopoverContent.astro";
Usage
import {
Popover,
PopoverTrigger,
PopoverContent,
} from "@/components/ui/popover"
<Popover>
<PopoverTrigger>
<Button>Open</Button>
</PopoverTrigger>
<PopoverContent>
Content goes here.
</PopoverContent>
</Popover>
Examples
Side bottom
Copy to clipboard
Popover opens below the trigger.
Side top
Copy to clipboard
Popover opens above the trigger.
Side right
Copy to clipboard
Popover opens to the right.
Side left
Copy to clipboard
Popover opens to the left.
With form
Copy to clipboard
Dimensions
Set the dimensions for the layer.
Anatomy
Popover- The root containerPopoverTrigger- The element that opens the popoverPopoverContent- The floating content panel
Props
PopoverContent
| Prop | Type | Default | Description |
|---|---|---|---|
| side | top | right | bottom | left | bottom | Position relative to trigger |
| align | start | center | end | center | Horizontal alignment |
| class | string | - | Additional CSS classes |
All other Popover components accept class for additional CSS classes.