Skip to main content
Mantı UI logoMantı UIv0.12.1
Studio

Popover

Pass a React element as trigger and the panel body as children. The machine manages placement, focus, and dismissal.

import { Button, Popover } from '@manti-ui/react';

export default function PopoverBasic() {
  return (
    <Popover
      trigger={<Button variant="secondary">Tips</Button>}
      title="Dough resting"
    >
      Let the dough rest, covered, for 30 minutes. It relaxes the gluten so you
      can roll it paper-thin without it springing back.
    </Popover>
  );
}

Placement

placement anchors the panel to a side of the trigger, optionally aligned to its start or end edge. It defaults to bottom, and the machine flips the panel when there is not enough room on the requested side.

Close button

Set showCloseButton to add an internal dismiss control.

API

PropTypeDefaultDescription
triggerReactElementElement that toggles the popover. Cloned with the machine's trigger props.
titleReactNodeOptional heading rendered at the top of the panel.
childrenReactNodePanel content.
placementPlacement'bottom'Placement relative to the trigger.
showCloseButtonbooleanfalseShow the corner close button.
modalbooleanMake the popover modal (trap focus, block outside interaction).
openbooleanControlled open state.
defaultOpenbooleanInitial open state for uncontrolled usage.
onOpenChange(open: boolean) => voidCalled whenever the open state changes.
closeOnInteractOutsidebooleantrueClose when clicking outside the content.
closeOnEscapebooleantrueClose when pressing Escape.

Styling

Anatomy

PartSelectorDescription
positioner[data-scope="popover"][data-part="positioner"]The portalled wrapper that positions the panel.
content[data-scope="popover"][data-part="content"]The translucent floating panel.
title[data-scope="popover"][data-part="title"]The optional heading.
description[data-scope="popover"][data-part="description"]The panel body content.
close-trigger[data-scope="popover"][data-part="close-trigger"]The optional corner close button.

Tokens

TokenControls
--manti-popover-max-widthmax width
--manti-popover-z-indexz index

Last updated

Built end-to-end with Manti UI components and design tokens. Manti UI is a framework-agnostic design system on Zag.js.

GitHub