Uqudo UIregistry

Popover

Displays rich content in a portal, triggered by a button.

Installation

npx shadcn@latest add @uqudo/popover

Usage

import {
  Popover,
  PopoverContent,
  PopoverDescription,
  PopoverHeader,
  PopoverTitle,
  PopoverTrigger,
} from "@/components/uqudo/ui/popover"
<Popover>
  <PopoverTrigger asChild>
    <Button variant="outline">Open popover</Button>
  </PopoverTrigger>
  <PopoverContent>
    <PopoverHeader>
      <PopoverTitle>Dimensions</PopoverTitle>
      <PopoverDescription>Set the dimensions for the layer.</PopoverDescription>
    </PopoverHeader>
  </PopoverContent>
</Popover>

Use asChild on PopoverTrigger so your own button receives the trigger behaviour instead of being wrapped in an extra element. The content is a vertical flex column with a gap, so stacking a header and a form just works.

API Reference

Popover

Prop

Type

PopoverContent

Prop

Type

Other exports

ComponentRenders / wrapsNotes
PopoverTriggerPopover.TriggerUse asChild to pass a Button.
PopoverAnchorPopover.AnchorPosition the panel against something other than the trigger.
PopoverHeaderdivStacks title and description.
PopoverTitledivBase-size, medium weight.
PopoverDescriptionpMuted body text.

Data attributes

AttributeValue
data-slotpopover, popover-trigger, popover-content, popover-anchor, popover-header, popover-title, popover-description.

On this page