PopoverPro
A small floating card attached to its trigger: a title and quiet line, any content, an arrow, opened by press or hover intent; Escape and a press outside close it.
oxyn add popoverThe preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.
Rendered from Rust at build time · goes live when visible
When to use
- A small floating card attached to its trigger: a title and quiet line, any content, an arrow, opened by press or hover intent; Escape and a press outside close it.
When not to use
- Actions and choices behind any trigger: use Dropdown Menu instead.
- Eight variants and five sizes, with a shimmering loading state, a progress fill, press-and-hold for destructive actions and a shortcut chip: use Button instead.
- An app sidebar: use Sidebar instead.
Installation
Popover is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.
oxyn add popoverUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Press
Opens on press.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Hover
Hover intent.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
No arrow
Without the arrow.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
Popover
| Prop | Type | Default | Description |
|---|---|---|---|
triggerrequired | Element | — | Trigger content (rendered inside a button). |
trigger_labelrequired | String | — | Trigger's accessible name. |
childrenrequired | Element | — | Body. |
open | bool | Default::default() | Start open. |
side | String | "bottom" | `bottom` · `top` · `right` · `left`. |
align | String | "start" | `start` · `center` · `end`. |
offset | f32 | 6.0 | Gap px (6). |
title | Option<String> | Default::default() | Title. |
description | Option<String> | Default::default() | Quiet line. |
width | Option<f32> | Default::default() | Width px. |
focus_on_open | bool | true | Move focus into the card on open. |
unstyled | bool | Default::default() | No card chrome (content draws its own). |
role | String | "dialog" | `dialog` or another role. |
arrow | bool | Default::default() | Arrow. |
mode | String | "press" | `press` · `hover`. |
modal | bool | Default::default() | Modal: dims the page and blocks outside interaction (Arc `modal`). |
collision_padding | f32 | 10.0 | Minimum distance from the viewport edges px (Arc `collisionPadding`, 10). |
on_close | EventHandler<()> | — | Closed. |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| EnterorSpace | Open; focus moves into the card |
| Esc | Close; focus goes back to the trigger |
Accessibility
- role=dialog named by its title; the trigger has aria-expanded and aria-controls.
- focus_on_open moves focus into the card; closing hands it back.
Responsive behaviour
- width sets the card width; side and align place it around the trigger.
Notes for AI
- Import
Popoverfromoxyn_dioxusand includePRIMITIVES_CSSplus the token stylesheet once. - A GPUI version exists:
PopoverElinoxyn_gpui. - Props to set first:
trigger,trigger_label,children. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.