Navigated to /docs/ui/components/popover

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.

TSX
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

Use Popover for filters, compact forms, calendars, help, or other contextual UI anchored to a trigger.

Choose something else when

Use DropdownMenu when every item is a command, Tooltip for a short non-interactive hint, and Dialog or Sheet for a focused modal workflow.

Examples

Popover example

TSX
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

PropTypeDefaultDescription
classNamestring

Optional class hook applied to the public root element owned by the component.
openboolean

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

PropertyTypeRequiredDescription
childrenChild

No

Inherited children attribute accepted by Popover.

classNamestring

No

Optional class hook applied to the public root element owned by the component.

sxSx

No

Inherited sx attribute accepted by Popover.

idstring

No

Inherited id attribute accepted by Popover.

rolestring

No

Inherited role attribute accepted by Popover.

styleRecord<string, unknown>

No

Inherited style attribute accepted by Popover.

titlestring

No

Inherited title attribute accepted by Popover.

tabIndexnumber

No

Inherited tabIndex attribute accepted by Popover.

hiddenboolean

No

Inherited hidden attribute accepted by Popover.

disabledboolean

No

Inherited disabled attribute accepted by Popover.

onClickTavoEventHandler<MouseEvent>

No

Inherited onClick attribute accepted by Popover.

onChangeTavoEventHandler<Event>

No

Inherited onChange attribute accepted by Popover.

onInputTavoEventHandler<Event>

No

Inherited onInput attribute accepted by Popover.

onKeyDownTavoEventHandler<KeyboardEvent>

No

Inherited onKeyDown attribute accepted by Popover.

onFocusTavoEventHandler<FocusEvent>

No

Inherited onFocus attribute accepted by Popover.

onBlurTavoEventHandler<FocusEvent>

No

Inherited onBlur attribute accepted by Popover.

openboolean

No

Configures open for this component.

placementPopoverPlacement

No

Configures placement for this component.

PopoverTriggerProps

PropertyTypeRequiredDescription
childrenChild

No

Inherited children attribute accepted by Popover.

classNamestring

No

Optional class hook applied to the public root element owned by the component.

sxSx

No

Inherited sx attribute accepted by Popover.

idstring

No

Inherited id attribute accepted by Popover.

rolestring

No

Inherited role attribute accepted by Popover.

styleRecord<string, unknown>

No

Inherited style attribute accepted by Popover.

titlestring

No

Inherited title attribute accepted by Popover.

tabIndexnumber

No

Inherited tabIndex attribute accepted by Popover.

hiddenboolean

No

Inherited hidden attribute accepted by Popover.

disabledboolean

No

Inherited disabled attribute accepted by Popover.

onClickTavoEventHandler<MouseEvent>

No

Inherited onClick attribute accepted by Popover.

onChangeTavoEventHandler<Event>

No

Inherited onChange attribute accepted by Popover.

onInputTavoEventHandler<Event>

No

Inherited onInput attribute accepted by Popover.

onKeyDownTavoEventHandler<KeyboardEvent>

No

Inherited onKeyDown attribute accepted by Popover.

onFocusTavoEventHandler<FocusEvent>

No

Inherited onFocus attribute accepted by Popover.

onBlurTavoEventHandler<FocusEvent>

No

Inherited onBlur attribute accepted by Popover.

labelstring

No

Inherited label attribute accepted by Popover.

PopoverContentProps

PropertyTypeRequiredDescription
childrenChild

No

Inherited children attribute accepted by Popover.

classNamestring

No

Optional class hook applied to the public root element owned by the component.

sxSx

No

Inherited sx attribute accepted by Popover.

idstring

No

Inherited id attribute accepted by Popover.

rolestring

No

Inherited role attribute accepted by Popover.

styleRecord<string, unknown>

No

Inherited style attribute accepted by Popover.

titlestring

No

Inherited title attribute accepted by Popover.

tabIndexnumber

No

Inherited tabIndex attribute accepted by Popover.

hiddenboolean

No

Inherited hidden attribute accepted by Popover.

disabledboolean

No

Inherited disabled attribute accepted by Popover.

onClickTavoEventHandler<MouseEvent>

No

Inherited onClick attribute accepted by Popover.

onChangeTavoEventHandler<Event>

No

Inherited onChange attribute accepted by Popover.

onInputTavoEventHandler<Event>

No

Inherited onInput attribute accepted by Popover.

onKeyDownTavoEventHandler<KeyboardEvent>

No

Inherited onKeyDown attribute accepted by Popover.

onFocusTavoEventHandler<FocusEvent>

No

Inherited onFocus attribute accepted by Popover.

onBlurTavoEventHandler<FocusEvent>

No

Inherited onBlur attribute accepted by Popover.

useElementDirectiveInput<HTMLDivElement>

No

Inherited use attribute accepted by Popover.

State ownership and DOM target

ConcernContract
StateApplication controlled through open and the matching callback.
DOM targetPublic 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

ContractCurrent value
Maturitystable
Categoryfeedback
Component import@tavojs/ui/popover
Explicit CSS import@tavojs/ui/css/popover
PreviewInteractive preview available on this page