Menu

Popover

Anchored floating panel. 2 placements.

Installation

$ npx uix-ui@latest add popover

This copies the file into components/ui/popover.tsx in your project. npx shadcn@latest add @uix/popover works too.

Usage

popover.tsx
import { Popover } from "@/components/ui/popover";

<Popover
  trigger={<Button variant="outline">Delivery details</Button>}
  title="Delivery to Dhanmondi"
  actions={<Button size="sm">Change address</Button>}
>
  Arrives Thursday between 10 am and 1 pm.
</Popover>

Props

PropTypeDefaultDescription
placementbottom | top"bottom"
triggerReact.ReactElement–The element that opens the panel (a Button): it gets the popovertarget attribute.
titleReact.ReactNode–
actionsReact.ReactNode–Buttons at the end of the panel.

Everything else is passed to the root element, so className, aria-* and event handlers work as usual.

Dependencies

Installed for you by the CLI.

  • class-variance-authority
  • clsx
  • tailwind-merge
  • lib/utils.ts
esc

↑↓ to navigate · ↵ to select · esc to close