Skip to content

    Browse components

    Popover

    Anchored popover on the native Popover API: top-layer, light dismiss and Escape for free, smart flipping, an arrow and a spring scale-in from the trigger.

    Open
    Customize
    bottom
    top
    right
    left
    center
    start
    end

    Installation

    npx shadcn@latest add @glint-ui/popover

    First time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.vercel.app/r/popover.json

    Usage

    import { Popover } from "@/components/ui/popover";
    
    <Popover>
      <PopoverTrigger>Share</PopoverTrigger>
      <PopoverContent side="bottom" align="center">
        ...
        <PopoverClose>Done</PopoverClose>
      </PopoverContent>
    </Popover>

    Props

    PropTypeDefaultDescription
    side"bottom" | "top" | "right" | "left""bottom"Preferred side (flips when there is no room).
    align"center" | "start" | "end""center"Alignment along the trigger.
    sideOffsetnumber10Gap to the trigger in px.
    arrowbooleantrueArrow pointing at the trigger.
    openReactNode—Popover root: controlled open state (with onOpenChange), or defaultOpen.
    childrenReactNode—Popover > PopoverTrigger + PopoverContent (+ PopoverClose).
    classNamestring—Extra classes for the root element.