Chroma Panel

Search documentation

Find a page or section

The popover layer, exported so you can build your own trigger.

Anatomy

import { Popover } from "chroma-panel";

Below 640px it becomes a bottom sheet. Pass sheetOnMobile={false} for an anchored popover at every width.

API reference

Props

PropTypeDefaultDescription
anchor*HTMLElement | nullThe element to position against. Pass null while the trigger has not mounted.
open*booleanWhether the surface is shown.
onClose*() => voidFires on Escape, on an outside click, and on the sheet being dismissed. You own the open state, so this is where you close it.
offsetnumber8Gap in pixels between the anchor and the surface.
sheetOnMobilebooleantrueBelow 640px, render as a bottom sheet with a grab handle and a scrim. Turn off for an anchored popover at every width.
classNamestringClass on the surface.
children*React.ReactNodeWhat the surface contains.