Skip to content
Nana UI

Popup

View .md Download

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.

Click me
Popup content
Terminal window
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
arrowbooleanfalseShow a pointing arrow
openbooleanfalseOpen state
placementPopupPlacement'bottom'Where the popup sits relative to the anchor
triggerPopupTrigger'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
EventTypeDescription
nana-showCustomEventFired when the popup opens
nana-hideCustomEventFired when the popup closes
SlotDescription
anchorThe trigger element
(default)The floating content
VariableDefaultDescription
--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