Popover
An anchored, non-modal floating surface. Native popovers escape clipping and provide light dismissal; Aidos supplies positioning and focus behavior.
No action yet
Usage
<PopoverTrigger
ariaLabel="Quick settings"
placement="top"
align="end"
content={({ close }) => (
<Column padding="small" gap="medium">
<TextInput aria-label="Name" />
<Button color="primary" onClick={close}>
Save
</Button>
</Column>
)}
>
{({ toggle, expanded, id }) => (
<Button
color="secondary"
aria-haspopup="dialog"
aria-expanded={expanded}
aria-controls={id}
onClick={() => toggle()}
>
Settings
</Button>
)}
</PopoverTrigger>
| Prop | Default | Purpose |
|---|---|---|
| content | — | React content or ({ close }) => content; floating card and focus management are included |
| placement | bottom | top, bottom, left, or right; flips when needed |
| align | start | start, center, or end |
| ariaLabel | — | Name for dialog content |
| role | dialog | Use presentation when content supplies its own menu/listbox semantics |
| children | — | Trigger render function receiving toggle, expanded, and popup id |
| jss, jssDialog | — | Trigger wrapper and floating surface styles |
The viewport constrains width and height; long content scrolls. Popovers inside modal dialogs stay usable in the top layer.
Focus and dismissal
- Explicit autofocus, then selected content, then the first focusable control receives focus. Disabled actions remain discoverable.
- Escape closes the current popover. Tab leaves at its boundaries; this is not a modal focus trap.
- Outside clicks dismiss without stealing focus from the clicked control.
- Closing while focus is inside restores the trigger if it still exists.
- Prefer Menu for actions and choices, SearchList for searchable selection.
Existing component API
PopoverComponent remains supported for callers passing typed input to toggle(input). That component should wrap its content in <Popover close={close}>. New callers can use content directly; do not wrap that content in another Popover.
Use Modal for blocking workflows and Tooltip for non-interactive hints.