Skip to main content

Starwind UI v3.0 beta is now available! Read the migration guide

Installation

Framework Availability

Astro Available React Available

Popover is available for Astro and React.

Usage

General Notes

Popovers are ideal for showing contextual content, settings, and quick actions without leaving the current page.

The essential components are Popover, PopoverTrigger, and PopoverContent. Use PopoverHeader, PopoverTitle, and PopoverDescription to create a consistent content structure.

Hover Open

Enable hover behavior with openOnHover. Use closeDelay to control how long the popover stays open after the pointer leaves.

Nested Popovers

Nested popovers work without immediately closing the parent popover while you interact with child content.

Align: start, center, end

Use the align prop on PopoverContent to control horizontal alignment relative to the trigger.

Side and sideOffset

Position content with side and add spacing from the trigger with sideOffset.

Runtime example adjustment

Runtime owns popover transition timing through state attributes and component styles, so positioning examples now use only side, align, and offset props.

API Reference

Styled Component API

These props are added or materially changed by the installed Astro styled component. Standard HTML attributes remain available through the inherited interfaces noted below. Follow the Primitive and Runtime links for lower-level behavior props.

Popover Trigger

Inherits button attributes.

Contains the following additional props:

Prop Type Default Toggle details
asChild boolean false
Description
Merges the component behavior and props into its child element.
Classification
Primitive override
Primitive prop
popover.Trigger.asChild

Popover Content

Inherits div attributes.

Contains the following additional props:

Prop Type Default Toggle details
exitMotion "popover" | "fade" "popover"
Description
Selects the motion treatment used while floating content closes.
Classification
Styled variant

Primitive And Runtime API

Use these references when you need the lower-level behavior APIs behind Popover.

Primitive API

Runtime API

Popover primitive
createPopover from @starwind-ui/runtime/popover

Changelog

v2.0.0

  • Rebuilt Popover on Starwind Runtime for open state, floating placement, dismissal, and nesting.
  • See the Popover Primitive for the underlying unstyled anatomy and behavior API.