PopoverButtoncomponent

PopoverButton({
	children: [buttonChildren, ...popoverChildren], //
	className,
	...props
}: PopoverButtonProps): ReactElement
ParamType
propsPopoverButtonProps
Props for PopoverButton — all the Button styling variants, plus children whose first node is the button label and the rest the popover contents. required
    .childrenPopoverChildren
Children tuple for Popover: a leading trigger node followed by the popover's contents. required
Return
ReactElement
A Button that toggles its attached Popover open and closed.

Popover variant of <Button> — a button that reveals floating popover content beside it when clicked.

  • The button is the primary element: it takes all the ButtonVariants styling props, and className lands on it (not the popover panel).
  • The first element passed to children is the button label; the rest become the popover contents.

DH: Would love to use new HTML popover="auto" functionality for this but the anchor positioning it needs is not supported everywhere yet.

Examples

<PopoverButton>{label}{panel}</PopoverButton>