Popover
Floating contextual panel that can contain arbitrary interactive or explanatory content.
Preview
A live, theme-aware example rendered with the published component.
Loading preview…
Import
Import the component from its dedicated entry point to keep the dependency and generated bundle explicit.
tsximport { Popover } from "@tavojs/ui/popover";Normal Tavo.js applications load component styles through the Tavo.js UI plugin. If the application manages component CSS manually, also import @tavojs/ui/css/popover.
When to use
Use it when
Choose something else when
Examples
Popover example
tsximport { Popover } from "@tavojs/ui/popover";
export function PopoverExample1() {
return (
<>
<Popover>
<Popover.Trigger>Filters</Popover.Trigger>
<Popover.Content>Filter controls go here.</Popover.Content>
</Popover>
</>
);
}Common props and defaults
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Optional class hook applied to the public root element owned by the component. |
open | boolean | — | Configures open for this component. |
placement | "bottom-start" | "bottom-end" | "top-start" | "top-end" | — | Configures placement for this component. |
Complete TypeScript API
Import from @tavojs/ui/popover. Published exports: Popover, PopoverContent, PopoverContentProps, PopoverPlacement, PopoverProps, PopoverRoot, PopoverTrigger, PopoverTriggerProps.
PopoverProps
| Property | Type | Required | Description |
|---|---|---|---|
children | Child | No | Inherited children attribute accepted by Popover. |
className | string | No | Optional class hook applied to the public root element owned by the component. |
sx | Sx | No | Inherited sx attribute accepted by Popover. |
id | string | No | Inherited id attribute accepted by Popover. |
role | string | No | Inherited role attribute accepted by Popover. |
style | Record<string, unknown> | No | Inherited style attribute accepted by Popover. |
title | string | No | Inherited title attribute accepted by Popover. |
tabIndex | number | No | Inherited tabIndex attribute accepted by Popover. |
hidden | boolean | No | Inherited hidden attribute accepted by Popover. |
disabled | boolean | No | Inherited disabled attribute accepted by Popover. |
onClick | TavoEventHandler<MouseEvent> | No | Inherited onClick attribute accepted by Popover. |
onChange | TavoEventHandler<Event> | No | Inherited onChange attribute accepted by Popover. |
onInput | TavoEventHandler<Event> | No | Inherited onInput attribute accepted by Popover. |
onKeyDown | TavoEventHandler<KeyboardEvent> | No | Inherited onKeyDown attribute accepted by Popover. |
onFocus | TavoEventHandler<FocusEvent> | No | Inherited onFocus attribute accepted by Popover. |
onBlur | TavoEventHandler<FocusEvent> | No | Inherited onBlur attribute accepted by Popover. |
open | boolean | No | Configures open for this component. |
placement | PopoverPlacement | No | Configures placement for this component. |
PopoverTriggerProps
| Property | Type | Required | Description |
|---|---|---|---|
children | Child | No | Inherited children attribute accepted by Popover. |
className | string | No | Optional class hook applied to the public root element owned by the component. |
sx | Sx | No | Inherited sx attribute accepted by Popover. |
id | string | No | Inherited id attribute accepted by Popover. |
role | string | No | Inherited role attribute accepted by Popover. |
style | Record<string, unknown> | No | Inherited style attribute accepted by Popover. |
title | string | No | Inherited title attribute accepted by Popover. |
tabIndex | number | No | Inherited tabIndex attribute accepted by Popover. |
hidden | boolean | No | Inherited hidden attribute accepted by Popover. |
disabled | boolean | No | Inherited disabled attribute accepted by Popover. |
onClick | TavoEventHandler<MouseEvent> | No | Inherited onClick attribute accepted by Popover. |
onChange | TavoEventHandler<Event> | No | Inherited onChange attribute accepted by Popover. |
onInput | TavoEventHandler<Event> | No | Inherited onInput attribute accepted by Popover. |
onKeyDown | TavoEventHandler<KeyboardEvent> | No | Inherited onKeyDown attribute accepted by Popover. |
onFocus | TavoEventHandler<FocusEvent> | No | Inherited onFocus attribute accepted by Popover. |
onBlur | TavoEventHandler<FocusEvent> | No | Inherited onBlur attribute accepted by Popover. |
label | string | No | Inherited label attribute accepted by Popover. |
PopoverContentProps
| Property | Type | Required | Description |
|---|---|---|---|
children | Child | No | Inherited children attribute accepted by Popover. |
className | string | No | Optional class hook applied to the public root element owned by the component. |
sx | Sx | No | Inherited sx attribute accepted by Popover. |
id | string | No | Inherited id attribute accepted by Popover. |
role | string | No | Inherited role attribute accepted by Popover. |
style | Record<string, unknown> | No | Inherited style attribute accepted by Popover. |
title | string | No | Inherited title attribute accepted by Popover. |
tabIndex | number | No | Inherited tabIndex attribute accepted by Popover. |
hidden | boolean | No | Inherited hidden attribute accepted by Popover. |
disabled | boolean | No | Inherited disabled attribute accepted by Popover. |
onClick | TavoEventHandler<MouseEvent> | No | Inherited onClick attribute accepted by Popover. |
onChange | TavoEventHandler<Event> | No | Inherited onChange attribute accepted by Popover. |
onInput | TavoEventHandler<Event> | No | Inherited onInput attribute accepted by Popover. |
onKeyDown | TavoEventHandler<KeyboardEvent> | No | Inherited onKeyDown attribute accepted by Popover. |
onFocus | TavoEventHandler<FocusEvent> | No | Inherited onFocus attribute accepted by Popover. |
onBlur | TavoEventHandler<FocusEvent> | No | Inherited onBlur attribute accepted by Popover. |
use | ElementDirectiveInput<HTMLDivElement> | No | Inherited use attribute accepted by Popover. |
State ownership and DOM target
| Concern | Contract |
|---|---|
| State | Application controlled through open and the matching callback. |
| DOM target | Public passthrough props target the component root. Treat nested elements and private class names as implementation details. |
Anatomy and related components
Public compound members: Root, Trigger, Content
Limitations
Use DropdownMenu when every item is a command, Tooltip for a short non-interactive hint, and Dialog or Sheet for a focused modal workflow.
Use only the documented props, entry points, and compound members. Internal DOM nesting and CSS class names can change without becoming part of the public component contract.
Accessibility
Trigger exposes `aria-haspopup="dialog"` and content uses dialog semantics.
Trigger exposes `aria-haspopup="dialog"` and content uses dialog semantics.
Component status
| Contract | Current value |
|---|---|
| Maturity | stable |
| Category | feedback |
| Component import | @tavojs/ui/popover |
| Explicit CSS import | @tavojs/ui/css/popover |
| Preview | Interactive preview available on this page |