NativePopover

NativePopover is a component that floats around an element to display information using the HTML Popover API.

Usage

import { NativePopover } from "@yamada-ui/react"
<NativePopover.Root>
  <NativePopover.Anchor />
  <NativePopover.Trigger />
  <NativePopover.Content>
    <NativePopover.Header />
    <NativePopover.Body />
    <NativePopover.Footer />
  </NativePopover.Content>
</NativePopover.Root>

Change Size

Close Trigger

You can add a close button inside the popover using NativePopover.CloseTrigger.

Display Popover on Different Element

To display a popover on a different element, use NativePopover.Anchor.

Display Popover Here

Change Placement

To change the placement, set placement to "start", "end-end", etc. By default, "end" is set.

Change Offset

To change the offset, set gutter or offset to a value.

Popover Modes

The HTML Popover API supports different modes for controlling popover behavior. This is a key feature that distinguishes NativePopover from the Popover component.

Disable

To disable the popover, set disabled to true.

Nest Popovers

Props

Accessibility

Keyboard Navigation

KeyDescriptionState
EscapeCloses the popover.popover="auto", popover="hint"

ARIA Roles and Attributes

ComponentRole and AttributeUsage
NativePopover.Contentrole="dialog"Indicates that it is a dialog.
idUsed to associate with NativePopover.Trigger.
aria-labelledbySets the id of the associated NativePopover.Header.
aria-describedbySets the id of the associated NativePopover.Body.
NativePopover.Triggerrole="button"Indicates that it is a button.
aria-haspopup="dialog"Indicates that it triggers a dialog.
aria-controlsSets the id of the associated NativePopover.Content.
aria-disabledSets to "true" when disabled={true}.
NativePopover.HeaderidUsed to associate with NativePopover.Content.
NativePopover.BodyidUsed to associate with NativePopover.Content.

Similar Components

Popover

Popover is a component that floats around an element to display information.

Tooltip

Tooltip is a component that displays short information, such as supplementary details for an element.

Drawer

Drawer is a component for a panel that appears from the edge of the screen.

Menu

Menu is a component that displays a common dropdown menu.

Modal

Modal is a component that is displayed over the main content to focus the user's attention solely on the information.

Indicator

Indicator is a component that displays at the corner of elements such as avatars.

Used By Components & Hooks