Controls

Popover

Preview
Reduced motion

Simulates prefers-reduced-motion for the demo. Off follows your system setting.

Keyboard stepping

Steps focus through the demo with ] and [. Tab, arrows, and Escape stay native so the component behaves as shipped.

Popover

Popover

A panel that unfolds out of its trigger, for small forms and details.

Installation

npx shadcn@latest add ikislay/pixel-ui/popover

How to use

import { Popover } from "@/components/ui/popover"
export function Demo() {
return (
<Popover aria-label="Details" trigger={<button type="button">Details</button>}>
Shipping takes four to six days.
</Popover>
)
}

Source Code

// Loading…

Props

Options you can pass to customize this component.

Prop
Type
Description
trigger*
ReactElement

One focusable element that toggles the panel. It gets aria-expanded.

open
boolean

Controls the panel. Leave it unset to let the popover manage itself.

defaultOpen
boolean

The starting state when uncontrolled.

onOpenChange
(open: boolean) => void

Called whenever the panel opens or closes.

side
topbottom

Which side of the trigger the panel opens on. It does not flip at the screen edge.

align
startcenterend

How the panel lines up with the trigger.

onFeedback
(event: "open" | "close") => void

Called at each semantic moment, for wiring sound or haptics.

className
string

Merged onto the panel.