Popover
A click-toggled floating panel with arbitrary content. It is a compound family composed over the shared Dropdown Panel base, so press-to-toggle latching, outside-press dismissal, Escape closing and returning focus to the trigger, and one-open-at-a-time arbitration come from the web component rather than from a hand-rolled copy in this file.
Filter issues
Narrow the board down to what you are working on.
Installation
Copy the family into your app. It pulls the shared dropdown-panel base along with it:
puzzle add piece popover
That base has a runtime dependency — the web component it wraps:
npm install @magic-spells/dropdown-panel
Then merge its stylesheets into your app's style entry. The first is required; the second adds the entrance effects and the drawn trigger arrow:
/* app/styles/styles.css */ @import "tailwindcss"; @import "@magic-spells/dropdown-panel/css" layer(components); /* required */ @import "@magic-spells/dropdown-panel/css/effects" layer(components); /* optional */
Requires the pieces.css tokens merged into your app styles (see Introduction).
Usage
import Popover from '@/components/ui/Popover';
<Popover>
<Popover.Trigger variant="button">Filters</Popover.Trigger>
<Popover.Content class="w-64">
<p class="text-sm text-body">…anything you like…</p>
</Popover.Content>
</Popover>Keep the trigger's content non-interactive. The dropdown trigger element itself is the control — the component gives it role="button", a tab stop and the aria wiring at upgrade — so a nested button or link would be a second tab stop. Spans, text and SVGs.
Right alignment
Ada Lovelace
ada@example.com
Controlled open
The parent owns this panel's state and re-syncs it from @hide when the user dismisses it.
open = false
Reference
Popover
openOptional-controlled and edge-triggered. Omit it and the component owns its own state, which is the normal case.effect'fade' | 'slide' | 'scale' | 'blur' | 'swing'. Needs the effects stylesheet.classMerged onto the dropdown component host.@show / @hideFired when THIS popover opens or closes; a nested dropdown's events are filtered out by the base.Popover.Trigger
variant'link' (default) for quiet inline text, 'button' for a bordered secondary button box.classMerged onto the trigger, after the variant chrome.Popover.Content
align'start' (default) | 'end'. end is left-auto right-0 — pure CSS, no measuring.wideA full-width panel spanning the nearest positioned ancestor.opens'down' (default) | 'right' for a nested submenu.effect'fade' | 'slide' | 'scale' | 'blur' | 'swing'. Needs the effects stylesheet.classMerged onto the panel. Merging is not precedence: use the ! suffix (mt-1!) to override a default. Never overflow-hidden.