Popover
A floating panel anchored to a trigger for short interactive content, built on the Radix Popover primitive.
Preview
LAUNCH-24
Launch checklist
In progress
- Freeze copy for the release notes
- Record the 40-second walkthrough
- Schedule the announcement email
Install
Add the editable source with the shadcn CLI. Your project also needs the shared theme tokens this component uses. Setup and requirements. The Pebble installer is not published yet.
npx shadcn@latest add https://pebbleui.com/r/popover.jsonProps
| Prop | Type | Default | Description |
|---|---|---|---|
| open | boolean | — | Controlled open state (root). |
| defaultOpen | boolean | false | Uncontrolled initial state (root). |
| onOpenChange | (open: boolean) => void | — | Called when the open state changes (root). |
| side | "top" | "right" | "bottom" | "left" | "bottom" | Preferred side (PopoverContent). |
| align | "start" | "center" | "end" | "center" | Alignment against the anchor (PopoverContent). |
| sideOffset | number | 6 | Gap in px from the anchor (PopoverContent). |
Build notes
Radix `Popover` handles placement (floating-ui), collision avoidance, dismissal and
focus. The panel uses `card` tokens with a border and `shadow-md`. Radix exposes
`--radix-popover-content-transform-origin`, which `origin-(...)` applies so the panel
scales out of the anchor. Keyframes in the registry item `css` field: `popover-in`
(opacity 0 and scale 0.96 to 1, 150 ms ease-out) and `popover-out` (reverse, 100 ms
ease-in), keyed on `data-state` under `motion-safe:`. Default `sideOffset` is 6 px
(shadcn uses 4) to leave room for the focus ring of the trigger.
**Pebble (2026-11-03).** The panel is now a Pebble raised surface: `rounded-xl bg-card`
with `ring-1 ring-hairline`, `shadow-raised-md` and `inset-shadow-highlight` in place of
the border and `shadow-md`, so it reads as the same material as cards and menus. Forced
colors keep a `CanvasText` border. Timings move to tokens: `popover-in` runs at
`--motion-base` / `--motion-enter`, `popover-out` at `--motion-fast` / `--motion-exit`,
still under `motion-safe:` (the item may only use its own keyframes, so there is no
reduced-motion fade). The demo is a task card ("Launch checklist") whose chips are the
triggers: an owner picker (list of people with roles, `PopoverClose` on pick, check on
the current owner), a due-date picker, and a Share panel (`align="end"`, `w-80`) with a
read-only link, a Copy button that flips to Copied and resets on close, a workspace
access segmented radiogroup and an avatar row. A unit test pins the raised-surface
classes.
<!-- PEBBLE-LICENSE -->View source
registry/overlay/popover/popover.tsx
"use client";
/* PEBBLE-LICENSE
Built by Pebble. Component: popover.
First-party license: MIT
The following first-party terms apply only to original Pebble material.
MIT License
Copyright (c) 2026 Praxys Solutions LLC (Pebble)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
THIRD-PARTY NOTICES
These notices apply to identified upstream portions; Pebble terms do not replace or narrow their rights.
Upstream: https://raw.githubusercontent.com/shadcn-ui/ui/main/LICENSE.md
MIT License
Copyright (c) 2023 shadcn
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
END PEBBLE-LICENSE */
import * as React from "react";
import { Popover as PopoverPrimitive } from "radix-ui";
import { cn } from "@/lib/utils";
export function Popover(props: React.ComponentProps<typeof PopoverPrimitive.Root>) {
return <PopoverPrimitive.Root data-slot="popover" {...props} />;
}
export function PopoverTrigger(props: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />;
}
export function PopoverAnchor(props: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />;
}
export function PopoverClose(props: React.ComponentProps<typeof PopoverPrimitive.Close>) {
return <PopoverPrimitive.Close data-slot="popover-close" {...props} />;
}
export function PopoverContent({
className,
align = "center",
sideOffset = 6,
...props
}: React.ComponentProps<typeof PopoverPrimitive.Content>) {
return (
<PopoverPrimitive.Portal>
<PopoverPrimitive.Content
data-slot="popover-content"
align={align}
sideOffset={sideOffset}
className={cn(
"z-50 w-72 max-w-[calc(100vw-2rem)] rounded-xl bg-card p-4 text-sm text-card-foreground outline-none",
// Pebble raised object: hairline ring, mid shadow, top highlight.
"shadow-raised-md ring-1 inset-shadow-highlight ring-hairline",
"forced-colors:border forced-colors:border-[CanvasText]",
// Grow out of the trigger: Radix sets the origin to the anchor side.
"origin-(--radix-popover-content-transform-origin)",
"motion-safe:data-[state=open]:animate-[popover-in_var(--motion-base)_var(--motion-enter)]",
"motion-safe:data-[state=closed]:animate-[popover-out_var(--motion-fast)_var(--motion-exit)]",
className,
)}
{...props}
/>
</PopoverPrimitive.Portal>
);
}
