Skip to content
nexubDesign System
v12.7.0

Components · Overlays

Popover

StableAdded v0.0.1

Floating content panel anchored to a trigger element.

import { Popover } from '@nexub/react';
View as Markdown

Playground

Props

surface
TSX
<Popover.Root>…</Popover.Root>

Examples

Default

With close button

Props

Props
PropTypeDefaultDescription
Popover.Rootcompound—Root provider that manages open/close state.
Popover.Triggercompound—Element that toggles the popover on click.
Popover.Contentcompound—The floating content panel.
Popover.Arrowcompound—Optional arrow pointing to the trigger.
Popover.Closecompound—Button that closes the popover.
side'top' | 'right' | 'bottom' | 'left'—Preferred side of the trigger to render the content.
align'start' | 'center' | 'end'—Alignment of the content relative to the trigger.
sideOffsetnumber—Distance in pixels between the trigger and the content.
surface'solid' | 'glass''solid'Glass material on Popover.Content — see Foundations → Materials.

Design tokens

Popover reads these component tokens. Each one is unset by default and falls back to the semantic role it aliases, so nothing changes until you set it. Set one on any element to restyle every Popover below it, and leave the roles other components share alone. See the three token tiers.

Popover design tokens
TokenAliasesNotes
--popover-bg--color-surface-elevated—
--popover-fg--color-on-surface—
--popover-radius--shape-container—
CSS
/* One area of your app */
.checkout {
  --popover-bg: var(--color-secondary);
}

On iOS & Android