Introducing PrimeReact v11-alpha ๐ŸŽ‰Discover Now
styledOverlay

Popover

Popover is an overlay container that displays content relative to a trigger.

preview

Usage#

import { Popover } from '@primereact/ui/popover';
<Popover.Root>
    <Popover.Trigger />
    <Popover.Portal>
        <Popover.Positioner>
            <Popover.Popup>
                <Popover.Arrow />
                <Popover.Header>
                    <Popover.Title />
                    <Popover.Close />
                </Popover.Header>
                <Popover.Content>
                    <Popover.Description />
                </Popover.Content>
                <Popover.Footer />
            </Popover.Popup>
        </Popover.Positioner>
    </Popover.Portal>
</Popover.Root>

Examples#

Basic#

Contextual content anchored to a trigger element.

basic-demo

Controlled#

Control popover state from outside with the open and onOpenChange props.

controlled-demo

Alignment#

Use side and align to control placement. Use sideOffset and alignOffset to fine-tune spacing.

alignment-demo

Accessibility#

Use labelled and described content with aria-labelledby and aria-describedby, and enable closeOnEscape for keyboard users.

accessibility-demo

API#

Sub-Components#

See Primitive API for PopoverRoot, PopoverTrigger, PopoverPortal, PopoverPositioner, PopoverPopup, PopoverArrow, PopoverHeader, PopoverTitle, PopoverClose, PopoverContent, PopoverDescription, PopoverFooter component documentation.

Hooks#

See Headless API for usePopover hook documentation.

Accessibility#

Accessibility#

See Popover Primitive for WAI-ARIA compliance details and keyboard support.