Skip to main content
Brand and assets
Build
Monitor and contribute
/
Component library
  • All components
  • Buttons & actions
  • Forms & inputs
  • Layout & containers
  • Overlays
    • BottomSheet
    • DialogBox
    • DropdownMenu
    • Modal
    • Popover
    • Screen
    • SidebarModal
    • Tooltip
  • Feedback & status
  • Data display
  • Typography
  • Accessibility
  • Contrib
  • Deprecated
  • Overlays
  • Popover

Popover

Floats content next to the element that opened it. Use `Popover.ButtonTrigger` or `Popover.IconButtonTrigger` so it stays accessible.

Health
Component health
Source
View on Github
Design
View Figma
Storybook
View in Storybook
Playground
No Example
Accessibility

compliant

Platform
Universal
  • Overview
  • Props
  • Figma

Usage​

Accessibility​

info

Primary triggers for accessibility: Use Popover.ButtonTrigger for accessible popovers with text labels, or Popover.IconButtonTrigger for icon-only triggers. Both provide proper ARIA attributes and keyboard navigation out of the box.

Placement​

Closing​

Popover always close when either:

  • the trigger element is clicked again
  • the user clicks outside of the popover
  • the user presses the Escape key

It's also possible to close the popover from the inside, using the <Popover.Close /> component:

For more advanced use cases, you can use a controlled popover with the open prop.

Controlled​

If you need to control the popover visibility (instead of it being controlled by clicking), you can use the open prop.

Custom styles​

Popover comes with a default style, but it can be reset and overriden:

<Popover.Content
unstyled
sx={{ padding: "$px4", backgroundColor: "$indigo500", borderColor: "$indigo900", borderWidth: 3 }}
/>

The arrow can also be hidden:

<Popover.Content noArrow />

Focus trap​

When opened, Popover will trap focus inside of it, so that the user can't tab outside of it.

Mobile​

On mobile, Popover.Content will be displayed in a BottomSheet. Please note that the popover must be controlled in order to work on mobile.

Trigger Types​

Popover.ButtonTrigger is the recommended trigger for accessibility purposes when you have text labels. It handles all ARIA attributes automatically and provides proper keyboard navigation.

For icon-only triggers, use Popover.IconButtonTrigger:

<Popover>
<Popover.IconButtonTrigger icon="Settings" aria-label="Open menu" />
<Popover.Content>Your content here</Popover.Content>
</Popover>

ButtonTrigger accepts all regular Button props and trigger props. IconButtonTrigger accepts all IconButton props and trigger props.

Adheres to the WAI-ARIA Dialog Pattern.

tip
This component is universal, its usage is the same in murray and murray/mobile.

Popover props

NameTypeDefault ValueDescriptionUsage count
children*ReactNode
disableFocusTuiPopoverProps["disableFocus"]Disable focus management when opening (e.g. hover-only menus)
hoverableTuiPopoverProps["hoverable"]Open on pointer hover (Floating UI safe polygon). Forwarded to Tamagui Popover.
keepChildrenMountedTuiPopoverProps["keepChildrenMounted"]
onOpenChangeTuiPopoverProps["onOpenChange"]Called when popover is opened or closed
openTuiPopoverProps["open"]When controlled, decide if popover should be visible or not
placementTuiPopoverProps["placement"]Popover placement relative to target element
resizeTuiPopoverProps["resize"]Caps the content to the space left on screen once flipped, so a long list doesn't run off it. Forwarded to Tamagui Popover. The content's children need `flexShrink` to follow the cap.
titlestringPopover title, also used as the accessible name of the popover on web

Undocumented props

NameTypeDefault ValueDescriptionUsage count
aria-labelany

PopoverTrigger props

No props

PopoverContent props

NameTypeDefault ValueDescriptionUsage count
aria-labelstringundefinedAccessible name of the popover dialog. Defaults to the Popover `title`, then to the name of the trigger @platform web
aria-labelledbystringundefinedId of the element that names the popover dialog. Takes precedence over `aria-label` @platform web
children*ReactNodeContent of the popover
disableFocusScopebooleanundefinedfalseDisable auto-focus and focus trap. Only use this if you plan to handle focus in another way
noArrowbooleanundefinedfalseRemove the popover arrow element
sxPopoverContentSxundefinedProvide additional styles to the popover
unstyledbooleanundefined!isWebRemove default styles

PopoverClose props

NameTypeDefault ValueDescriptionUsage count
asChildbooleanundefined
children*ReactNodeWhen clicked, will close the popover
sx
2 possibilitiesundefinedWithThemeValues<Pick<StackStyleBase, "width">>
Edit this page
Previous
Modal
Next
Screen
  • Usage
  • Accessibility
  • Placement
  • Closing
  • Controlled
  • Custom styles
  • Focus trap
  • Mobile
  • Trigger Types