Overlays
Popover & Menu
Anchored surfaces with flipping, viewport clamping and origin-aware entrance; Menu adds roving focus.
Popover Menu MenuItem
import { Popover, Menu, MenuItem } from '@anomalia/ui'; Notes
- Positioned
fixedfrom viewport coordinates, so transformed andoverflow: hiddenancestors cannot clip it. - Menu supports arrows, Home/End, type-ahead and Tab-to-close.
matchWidthmakes the surface as wide as its anchor — the right default for select-like menus.
Examples
Popover
Positioned from viewport coordinates, so transformed and overflow-hidden ancestors cannot clip it. It flips when the preferred side does not fit.
Menu
Menu adds the ARIA menu pattern on top of Popover: arrows, Home/End, type-ahead and Tab-to-close, with focus landing on the first item.
API
Popover
| Prop | Type | Default | Description |
|---|---|---|---|
open | boolean | — | Bindable visibility. |
anchor | HTMLElement | null | — | Element to position against. |
placement | 'top' | 'bottom' | 'left' | 'right' (+ '-start' / '-end') | 'bottom-start' | Preferred side; flips when it does not fit. |
offset | number | 8 | Gap from the anchor. |
MenuItem
| Prop | Type | Default | Description |
|---|---|---|---|
href | string | — | Renders a link, keeping middle-click behaviour. |
tone | 'default' | 'danger' | 'default' | Destructive styling. |
selected / shortcut | boolean / string | — | Check mark and keyboard hint. |
Every component also forwards the native attributes of its root element, plus class, so anything not listed here still works.