4.2.0
Core

Popover

A small surface anchored to a trigger, for a quick edit or a bit of detail — it never traps focus, so it is never the thing that must be dealt with first.

Default

A popover is a surface, not a dialog: it does not trap focus and has no title bar.

Usage

import {
  Popover,
  PopoverAnchor,
  PopoverContent,
  PopoverDescription,
  PopoverHeader,
  PopoverTitle,
  PopoverTrigger,
} from '@oceanic-hub/brand-system'
<Popover>
  <PopoverTrigger>…</PopoverTrigger>
  <PopoverContent>…</PopoverContent>
</Popover>

Composition

Use the following composition to build a Popover:

Popover
├── PopoverTrigger
└── PopoverContent
    └── PopoverHeader
        ├── PopoverTitle
        └── PopoverDescription

Use it for a quick edit or a bit of detail. If the content must be dealt with before anything else can happen, it is a Dialog; if it is a list of actions, it is a DropdownMenu.

It is the click half of three surfaces: Tooltip is a label for a control that has none, HoverCard is a hover-summoned preview, and this is what opens on a click, for content a reader acts inside. It is also the panel two recipes are built on — a date picker is a Calendar inside one, and the Combobox recipe is a Command inside one, which is what Select points at once a list has stopped being scannable.

PopoverHeader/PopoverTitle/PopoverDescription are not a plain port. Radix's popover primitive exports no Title or Description — Dialog has them here because Radix's DIALOG primitive does; upstream's popover has them because upstream's popover is Base UI, whose primitive does too. So the trio wires the accessible name itself: each part registers on mount, and PopoverContent emits aria-labelledby/aria-describedby only for the parts that actually rendered, rather than pointing at an id nothing filled in.

align lines the content up against the trigger, and PopoverAnchor moves that anchor off the trigger entirely, for a popover that should track something else on the page instead of the element that opened it.

RTL is not supported — recorded in pairings.json under direction: nothing in this package has been laid out or measured right-to-left.

With a header

PopoverTitle is the accessible name — Radix's popover wires none on its own.

Align

align lines the content up against the trigger — start, center (the default) or end — the same three Radix gives every anchored surface in the package.

With a form

Field/FieldGroup/FieldLabel lay the fields out inside — the same grammar every form in the package uses, not a popover-specific one.

Date picker

There is no DatePicker component: a date picker is a Calendar inside one of these, and it is documented here rather than on Calendar's page because a portalled panel would cover the grid it is explaining. w-auto p-0 hands the width back to the month, the calendar takes the elevated ground it is sitting on, and the trigger carries the chosen date so a reader can check it without opening anything.

API Reference

See the Popover API page for every prop of every part, with types, defaults and the contract that pins them.

On this page