Gooey Popover

A panel that oozes out of its trigger like liquid, with crisp content.

Preview

"use client";

import { Button } from "@/components/motion/button";
import {
  Popover,
  PopoverContent,
  PopoverTrigger,
} from "@/components/motion/popover";

export function PopoverPreview() {
  return (
    <div className="flex flex-wrap items-center justify-center gap-4">
      <Popover side="bottom" align="start">
        <PopoverTrigger>
          <Button variant="secondary">Edit profile</Button>
        </PopoverTrigger>
        <PopoverContent className="w-72">
          <p className="text-sm font-medium text-foreground">Dimensions</p>
          <p className="mt-1 text-xs text-muted-foreground">
            Set the width and height for the layer.
          </p>
          <div className="mt-3 flex flex-col gap-2">
            <label className="flex items-center justify-between gap-3 text-sm">
              <span className="text-muted-foreground">Width</span>
              <input
                defaultValue="100%"
                className="h-8 w-32 rounded-full border border-border bg-background px-3 text-sm text-foreground outline-none focus-visible:ring-2 focus-visible:ring-foreground/20"
              />
            </label>
            <label className="flex items-center justify-between gap-3 text-sm">
              <span className="text-muted-foreground">Height</span>
              <input
                defaultValue="auto"
                className="h-8 w-32 rounded-full border border-border bg-background px-3 text-sm text-foreground outline-none focus-visible:ring-2 focus-visible:ring-foreground/20"
              />
            </label>
          </div>
        </PopoverContent>
      </Popover>

      <Popover trigger="hover" side="top">
        <PopoverTrigger>
          <Button variant="outline">Hover me</Button>
        </PopoverTrigger>
        <PopoverContent className="w-56">
          <p className="text-sm text-foreground">
            Opens on hover, with a grace window so you can move into the panel.
          </p>
        </PopoverContent>
      </Popover>
    </div>
  );
}

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @beui/popover

API Reference

Popover

open?
boolean

Controlled open state.

Default—
defaultOpen?
boolean

Uncontrolled initial open state.

Defaultfalse
onOpenChange?
((open: boolean) => void)

Called with the new open state when the panel opens or closes.

Default—
trigger?
"click" | "hover"

How the popover is summoned. Default "click".

Defaultclick
side?
"top" | "bottom"

Which side of the trigger the panel oozes out of. Default "bottom".

Defaultbottom
align?
"center" | "end" | "start"

Alignment along the trigger's edge. Default "center".

Defaultcenter
sideOffset?
number

Gap between trigger and panel, in px — the length of the gooey neck. Default 14.

Default14
panelRadius?
number

Corner radius of the open panel, in px. Default 16.

Default16
gooStrength?
number

Blur radius feeding the goo filter — higher melts more. Default 8.

Default8
className?
string

Classes merged onto the wrapper around the trigger.

Default—

PopoverTrigger

children
ReactElement<unknown, string | JSXElementConstructor<any>>

A single focusable element (e.g. a Button) that opens the popover.

Default—

PopoverContent

className?
string

Classes merged onto the panel's content box.

Default—

More in Popover

Updated