Skip to content
Nana UI

Layout & Containers

Popup

A lightweight anchored popover. Positions floating content relative to an anchor (slotted into anchor), with placement, an optional arrow, and click / hover / manual triggers. Flips on the main axis when it would overflow the viewport.

View .md Download
Click me
Popup content
npm install @nana-tec/ui-components
import "@nana-tec/ui-components/popup";
<nana-button>Anchor</nana-button>

Use trigger="click" (default) or trigger="hover", and set placement (top, bottom-start, right, …).

Hover me
Shown on hover

Properties

PropertyAttributeTypeDefaultDescription
arrowarrowbooleanfalseShow a pointing arrow
openopenbooleanfalseOpen state
placementplacementPopupPlacement'bottom'Where the popup sits relative to the anchor
triggertriggerPopupTrigger'click'How the popup is triggered

Events

EventDescription
nana-showFired when the popup opens
nana-hideFired when the popup closes

Slots

SlotDescription
anchorThe trigger element
(default)The floating content

CSS parts

PartDescription
::part(popup)The floating panel
::part(arrow)The arrow

CSS custom properties

PropertyDescription
--nana-popup-bgPanel background
--nana-popup-radiusPanel corner radius
--nana-popup-paddingPanel padding
--nana-popup-zStacking order for the floating panel
EventTypeDescription
nana-showCustomEventFired when the popup opens
nana-hideCustomEventFired when the popup closes
SlotDescription
anchorThe trigger element
(default)The floating content
VariableDescription
--nana-popup-bgPanel background
--nana-popup-radiusPanel corner radius
PartDescription
popupThe floating panel
arrowThe pointing arrow
Explore Popup interactively Every state, prop, and edge case — with live controls — in Storybook.
View in Storybook