Popover

Popovers reveal contextual controls or supporting details near a trigger.

Overview and decision boundary

Use Popover for contextual controls or details tied to a trigger.

Do not use Popover for destructive confirmations.

Preview

import { Popover } from '@nerio-ui/ui/client';<Popover trigger="Filters" title="View filters">...</Popover>

Installation and imports

Install the editable registry source, or use the matching package entrypoint when the product keeps Nerio as a workspace dependency.

pnpm dlx nerio add popoverimport { Popover } from '@nerio-ui/ui/client';

Usage

import { Popover } from '@nerio-ui/ui/client';<Popover trigger="Filters" title="View filters">...</Popover>

Variants

VariantPurpose
DefaultContextual panel near a trigger.

Anatomy

SlotPurpose
contentLayered panel with controls or supporting content.
titleOptional contextual heading.
descriptionOptional supporting context.
bodyInteractive or supporting content.

States

StatePurpose
OpenPanel is visible and keyboard reachable.
ClosedPanel is removed from the layer.

Motion

  • State changes should use shared motion tokens and preserve reduced-motion behavior.

Accessibility

  • Uses the Base UI Popover primitive.
  • Keep essential form submission or destructive confirmation outside transient popovers.
  • Provide title or description when the content needs context.
  • Supports controlled open, uncontrolled defaultOpen, onOpenChange, and a forwarded popup ref.

API

PropPurpose
triggerReact node or text that opens the popover.
title / descriptionOptional context before the body content.
childrenInteractive or supporting content inside the popup.

Implementation contract

ContractValue
Registry itempopover installs 6 source files into the configured components directory.
Base UIpopover
Registry dependenciesbutton
Package dependencies@base-ui/react, clsx, react, tailwind-merge, tailwindcss

Styling contract

ContractValue
AuthoringComplete, statically detectable Tailwind CSS v4 recipes own component visuals.
ValuesSemantic and component --n-* variables remain the canonical customization layer.
OverridesCustomizable slots merge consumer className values with tailwindCn so conflicting utilities resolve deterministically.
Residual CSSOnly shared keyframes and scoped no-Preflight compatibility rules remain; there is no parallel visual selector layer.

Design notes

  • Use Popover for contextual controls or details tied to a trigger.

Do / do not

Do

Use for filters, quick metadata, or lightweight editing controls.

Do not

Do not use Popover for destructive confirmations.

Tokens

These are the primary customization points. Override semantic or component tokens instead of changing component source.

TokenPurpose
--n-popover-width-mdPublic customization point for this component contract.
--n-popover-paddingPublic customization point for this component contract.
--n-popover-gapPublic customization point for this component contract.
--n-popover-radiusPublic customization point for this component contract.
--n-overlay-z-indexPublic customization point for this component contract.
--n-overlay-backgroundPublic customization point for this component contract.
--n-overlay-borderPublic customization point for this component contract.
--n-overlay-foregroundPublic customization point for this component contract.
--n-overlay-foreground-mutedPublic customization point for this component contract.
--n-overlay-control-backgroundPublic customization point for this component contract.
--n-overlay-control-background-hoverPublic customization point for this component contract.
--n-overlay-surface-filterPublic customization point for this component contract.
--n-overlay-shadowPublic customization point for this component contract.
--n-input-background-on-overlayPublic customization point for this component contract.
--n-input-background-on-overlay-hoverPublic customization point for this component contract.
--n-input-foreground-on-overlayPublic customization point for this component contract.
--n-input-placeholder-on-overlayPublic customization point for this component contract.
--n-motion-overlay-enter-durationPublic customization point for this component contract.
--n-motion-overlay-enter-easingPublic customization point for this component contract.
--n-motion-overlay-exit-durationPublic customization point for this component contract.
--n-motion-overlay-exit-easingPublic customization point for this component contract.
--n-focus-ringPublic customization point for this component contract.