Skip to main content

Starwind UI v3.0 is now available! Migration guide

Installation

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.

API Reference

Styled Component API

These props are added or materially changed by the installed styled component. Standard HTML attributes remain available through the inherited interfaces noted below. Expand a prop to see named type definitions and framework-specific imports. 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.3

  • Named the generated aggregate default export so React and Astro tooling can identify the installed component cleanly.

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.