Skip to content

Custom Popover

Popover positioned from a trigger with arrow and placement options.

Installation

bun add @xerobi/ui
import { CustomPopover } from "@xerobi/ui/custom-popover"

This component is client-side. In Astro, hydrate it with a client directive.

API reference

CustomPopover

Popover anchored to an element, with an arrow that points at it. Pair with `usePopover()`: const popover = usePopover() <button onClick={popover.onOpen} /> <CustomPopover open={popover.open} anchorEl={popover.anchorEl} onClose={popover.onClose} />

PropTypeDescription
openboolean
onClose() => void
anchorElElementElement the popover points at (from `usePopover().anchorEl`).
childrenstring | number | bigint | boolean | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<AwaitedReactNode>
classNamestring
slotProps{ arrow?: PopoverArrow | undefined; paper?: DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> | undefined; }

Search documentation

Search pages, components and blocks.