Skip to content

Search

Start typing to search.


Show all pages

Documentation

overlays

Popover

A button that opens a small panel with any content, such as a short form.

Native behaviorUses built-in HTML behavior, so you write no script.

Usage

The button opens the panel with popovertarget. Buttons inside close it with popovertargetaction="hide".

Share this lesson

HTML

Examples

Guidance and accessibility

When to use

  • Use a popover for a small task that belongs to one button, such as sharing a lesson or setting a filter.
  • For a list of actions or links, use a dropdown. For a decision that must be made before going on, use a dialog.
  • Keep the content short; a long form belongs on its own page or in a dialog.

Accessibility

  • It is a native popover: Escape and a click outside close it, and focus returns to the button. Tab moves from the button into the panel.
  • Name the panel with aria-labelledby pointing at its heading.
  • Put the actions that finish the task in the panel and close it with popovertargetaction="hide".
  • Like the dropdown, it uses CSS anchor positioning and shows centered in browsers without it.

Classes

Generated from the component contract. Parts use __, modifiers use --.

Classes of the popover component
ClassKindUse it for
ca-popoverComponentWrapper around the trigger and its panel.
ca-popover__panelPartThe [popover] panel; sits under the button and flips when there is no room.

Skins

The same markup, dressed by each skin. Structure and behavior stay the same; only the look changes.

Base skin

Neutral grayscale starting point; product skins extend it and change what differs.

Share this lesson

Calaca skin

The Calaca UI brand: hueso paper and tinta ink, cempasúchil marigold, rosa and jade.

Share this lesson

Proof skin

Pilot skin pushed far from base: square, heavy, offset shadows, larger targets.

Share this lesson

Crossview skin

The CrossView proofing table: cool ground, bond-paper sheets, rule-grey hairlines, one red mark.

Share this lesson

Framework notes

Link the prebuilt stylesheet of your skin next to your brand theme. No build step.

HTML
<link rel="stylesheet" href="theme.css" />
<link rel="stylesheet" href="ca-base.css" />