HomeGetting StartedColor SystemTypographySpacingIconographyLayoutInstallationUsageAngularBlazorReactSvelteVueThemingTypographyCustomizationCSS-Only ComponentsFormsIconsIllustrationsAccessibilityGlobal ConfigurationTailwind CSSSass LibraryForge MCP ServerDropdown OptionsFocus Indicator ClippingAll componentsButtonButton AreaChipFloating Action ButtonIcon ButtonSplit ButtonAutocompleteButton ToggleCalendarCheckboxChip FieldColor PickerDate PickerDate Range PickerFile PickerLabelRadioSelectSliderSwitchText FieldTime PickerApp BarApp LauncherDrawerMenuPaginatorSkip LinkStepperTabsView SwitcherAccordionApp LayoutCardDividerExpansion PanelScaffoldSplit ViewStackStructured CardToolbarBadgeBannerBusy IndicatorCircular ProgressDialogInline MessageLinear ProgressPage StateSkeletonToastTooltipAvatarIconKeyLabel ValueListMeterSecretTableTimelineTimestampTreeKeyboard ShortcutPopoverIntroductionColorTypographySpacingShapeBorderElevationLayeringAnimationUsageIcon LibraryBlocksRoadmapChangelogBlog

Popover

A popover floats content above the page, positioned relative to the trigger element that anchors it.

Open popover

Usage

forge-popover floats its content above the page, anchored to a trigger element by anchor (the trigger’s id), through placement, triggerType, preset, and arrow. Use it for content that needs more than a couple of words — a form, a set of options, or a preview — triggered by clicking, hovering, or focusing another element. For a one- or two-word label, use a tooltip instead; forge-popover is also the foundation other components build on, like menu, select, and date picker.

Rules

Do
Use a popover when the content is more than a couple of words — a definition, a form, or extra context for a component.Set anchor to the id of the exact element that triggers the popover.Give a non-modal popover a way to close explicitly if dismissing it accidentally could lose the user's work.
Don't
Don't use a popover for a one- or two-word label — use a tooltip instead.Don't nest a popover inside another popover's content.Don't rely on a popover alone for content essential to completing a task on a touch device without a comparable trigger type.

Basic usage

Set anchor to the id of the trigger element; the popover positions itself relative to it automatically.

A popover anchored to a button, structured with a scaffold.

Popover vs. dialog

Popovers are transient and non-modal — anchored to a trigger, they don’t block interaction with the rest of the page. Dialogs are typically modal and reserved for content that demands the user’s immediate attention, like a confirmation or a form that must be completed before moving on. The line can blur in practice; when it’s genuinely ambiguous which one fits, weigh the UX and accessibility implications of blocking (or not blocking) the rest of the page rather than defaulting to one or the other.

Non-modal

forge-popover has no semantic meaning by default — it’s up to you to add ARIA attributes appropriate to its content. Set role="dialog" and aria-modal="false" for a popover that doesn’t trap focus or block interaction with the rest of the page — useful for a lightweight, persistent form.

A non-modal popover that doesn't block interaction with the rest of the page.

Distinct

Give related popovers the same distinct value to guarantee only one of them is ever open at a time.

Two popovers sharing a distinct value, so opening one closes the other.

Popovers are used to show content in an element that is rendered above all other content on the page. Use popovers to display additional information or actions related to a specific element. Popovers are typically triggered by user interaction, such as clicking a button or hovering over an element.

import "@tylertech/forge/popover";
Properties
PropertyAttributeTypeDefaultDescription
arrowarrowstringfalseWhether or not the popover should render an arrow.
animationTypeanimation-typestring"zoom"The animation type to use for the popover. Valid values are `'none'`, `'fade'`, `'slide'`, and `'zoom'` (default).
triggerTypetrigger-typestring"click"The trigger type(s) to use for the popover. Valid values are `'click'` (default), `'hover'`, `'focus'`, and `'longpress'`. Multiple can be specified.
longpressDelaylongpress-delaystring500The delay in milliseconds before a longpress event is detected.
persistentHoverpersistent-hoverstringfalseWhether or not the popover should remain open when the user hovers outside the popover.
hoverDelayhover-delaynumber0The delay in milliseconds before the popover is shown.
hoverDismissDelayhover-dismiss-delaystring500The delay in milliseconds before the popover is dismissed when the user hovers outside of the popover.
presetpresetstring"popover"The preset to use for the popover.
distinctdistinctstring | nullnullEnforces that this popover should be the only one open with the same unique value.
anchorAccessibilityanchor-accessibilitystring"auto"Controls whether the popover manages accessibility attributes on the anchor element.
overlay—IOverlayComponent—A readonly reference to the internal `<forge-overlay>` element instance.
anchorElement—HTMLElement | VirtualElement | null—The anchor element to position the overlay relative to.
anchoranchorstring | null—The IDREF of the anchor element to position the overlay relative to.
noAnchorno-anchorbooleanfalseWhether the overlay should not be anchored to an element. This allows for custom positioning.
openopenbooleanfalseWhether the overlay is open.
inlineinlinebooleanfalseWhether the overlay is inline.
placementplacementOverlayPlacement"bottom"The placement of the overlay.
positionStrategyposition-strategyOverlayPositionStrategy"fixed"The position strategy of the overlay.
offsetoffsetIOverlayOffset{}The offset of the overlay.
shiftshiftOverlayShiftState"auto"Whether the overlay should shift to fit within the viewport.
hidehideOverlayHideState"anchor-hidden"The hide state of the overlay.
persistentpersistentbooleanfalseWhether the overlay should persist when the anchor is removed.
flipflipOverlayFlipState"auto"Whether the overlay should flip placements to another side fit within the viewport.
boundaryboundarystring | null—An IDREF to boundary element to constrain the overlay within.
boundaryElement—HTMLElement | null—The boundary element instance to constrain the overlay within.
fallbackPlacements—PositionPlacement[] | null—The fallback placements of the overlay.
Events
NameTypeDescription
forge-popover-beforetoggleCustomEvent<IPopoverToggleEventData>Dispatches before the popover is toggled, and is cancelable.
forge-popover-toggleCustomEvent<IPopoverToggleEventData>Dispatches after the popover is toggled.
Slots
NameDescription
(default)The content to render inside the popover.
CSS Parts
NameDescription
::part(overlay)The overlay root element.
::part(surface)The surface container element for the slotted content.
CSS Custom Properties
NameDescription
--forge-popover-backgroundThe background color of the popover surface.
--forge-popover-border-radiusThe border radius of the popover surface.
--forge-popover-box-shadowThe box shadow of the popover surface.
--forge-popover-border-widthThe border width of the popover surface.
--forge-popover-border-styleThe border style of the popover surface.
--forge-popover-border-colorThe border color of the popover surface.
--forge-popover-widthThe width of the popover surface. Defaults to `auto`.
--forge-popover-heightThe height of the popover surface. Defaults to `auto`.
--forge-popover-min-widthThe minimum width of the popover surface. Defaults to `none`.
--forge-popover-max-widthThe maximum width of the popover surface. Defaults to `none`.
--forge-popover-min-heightThe minimum height of the popover surface. Defaults to `none`.
--forge-popover-max-heightThe maximum height of the popover surface. Defaults to `none`.
--forge-popover-arrow-sizeThe size of the arrow.
--forge-popover-arrow-heightThe height of the arrow.
--forge-popover-arrow-widthThe width of the arrow.
--forge-popover-arrow-background-colorThe background color of the arrow. Defaults to the background color of the popover surface.
--forge-popover-arrow-top-rotationThe rotation of the arrow when the popover is placed on the top.
--forge-popover-arrow-right-rotationThe rotation of the arrow when the popover is placed on the right.
--forge-popover-arrow-bottom-rotationThe rotation of the arrow when the popover is placed on the bottom.
--forge-popover-arrow-left-rotationThe rotation of the arrow when the popover is placed on the left.
--forge-popover-arrow-border-widthThe border width of the popover surface and arrow when an arrow is applied.
--forge-popover-arrow-clip-pathThe clip path to use for the arrow element.
--forge-popover-animation-timingThe animation timing function to use for the popover animation.
--forge-popover-zoom-durationThe duration of the zoom animation.
--forge-popover-zoom-timingThe timing function to use for the zoom animation.
--forge-popover-slide-durationThe duration of the slide animation.
--forge-popover-slide-timingThe timing function to use for the slide animation.
--forge-popover-slide-offsetThe start offset to use for the slide animation.
--forge-popover-fade-durationThe duration of the fade animation.
--forge-popover-fade-timingThe timing function to use for the fade animation.
--forge-popover-position-block-startThe `block-start` position of the popover.
--forge-popover-position-block-endThe `block-end` position of the popover.
--forge-popover-position-inline-startThe `inline-start` position of the popover.
--forge-popover-position-inline-endThe `inline-end` position of the popover.
--forge-popover-preset-dropdown-max-heightThe maximum height of the popover when using `preset="dropdown"`. Defaults to `256px`.
--forge-popover-preset-dropdown-overflowThe overflow behavior of the popover when using `preset="dropdown"`. Defaults to `auto visible` (vertical scrolling only).
Methods
NameReturnsDescription
hideAsync()Promise<void>Hides the popover, and returns a `Promise` that resolves when the hide animation is complete.
position()voidForces the overlay to reposition itself.

No default semantics

A popover has no semantic meaning by default. Add the appropriate ARIA attributes to the popover itself, or to the content inside it, based on what that content actually needs.

Popover vs. dialog

Popovers are transient and non-modal — they don’t block interaction with the rest of the page. Dialogs are typically modal and demand the user’s immediate attention. When a design calls for something in between, weigh the UX and accessibility implications of each rather than defaulting to one.

To make a popover behave like a non-modal dialog, add role="dialog" and aria-modal="false" — this tells screen readers it’s a dialog that doesn’t block the rest of the page, which is useful for gracefully handling in-progress form entry without risking accidental data loss on dismiss.

Loading Forge chat…