Popover

Description

A reusable, anchored overlay surface used to display arbitrary IComponent content next to another component (the anchor). Popovers are the general-purpose primitive on top of which menus, comboboxes, date pickers, color pickers and similar transient surfaces are built.

Usage

API reference

class

Popover

public sealed class Popover

A reusable, anchored overlay surface used to display arbitrary IComponent content next to another component (the anchor). Popovers are the general-purpose primitive on top of which menus, comboboxes, date pickers, color pickers and similar transient surfaces are built.

Remarks

A Popover instance is configured once via the fluent setters (Content, Placement, Arrow, …) and then shown imperatively against a particular anchor with ShowFor or ShowFor. Unlike the .Tooltip(...) extension — which attaches a hover-triggered tooltip to a component — a popover is *manually triggered*: it stays visible until Hide is called, the user clicks outside (when HideOnClickOutside is enabled, the default), or the anchor is removed from the DOM. Positioning, click-outside dismissal, arrow rendering and animation are delegated to the bundled Tippy / Popper.js library, so the same set of placements and animations available to tooltips also apply to popovers. var popover = UI.Popover() .Content(UI.Stack().Children(UI.TextBlock("Hello"), UI.Button("Close").OnClick(() => popover.Hide()))) .Placement(TooltipPlacement.BottomStart) .Arrow(); var button = UI.Button("Open").OnClick(b => popover.ShowFor(b));

Namespace
Tesserae

Constructors

NameDescription
PopoverCreates a new, empty popover. Configure it with Content and the other fluent setters before calling ShowFor.
Constructor
Popover
Overload
Popover()Creates a new, empty popover. Configure it with Content and the other fluent setters before calling ShowFor.
Popover(IComponent)Creates a popover whose content is already set.
Popover()
public Popover()

Creates a new, empty popover. Configure it with Content and the other fluent setters before calling ShowFor.

Popover(IComponent)
public Popover(IComponent content)

Creates a popover whose content is already set.

Parameters

content IComponent
The component to render inside the popover.

Properties

NameDescription
IsVisibleGets a value indicating whether the popover is currently displayed.
Property
Popover.IsVisible
public bool IsVisible

Gets a value indicating whether the popover is currently displayed.

Methods

NameDescription
ContentSets the content displayed inside the popover. Replacing the content while the popover is visible will not retroactively update the rendered element; call Hide and ShowFor again to apply a new content tree.
PlacementSets the preferred placement of the popover relative to its anchor. Defaults to Bottom. The actual placement may flip automatically when there is not enough room on the preferred side.
AnimationSets the show/hide animation. Defaults to None.
ArrowEnables or disables the small arrow that points from the popover to the anchor.
MaxWidthSets the maximum width of the popover surface, in pixels. Defaults to 350.
ThemeApplies a named Tippy theme to the popover (e.g. "light", "light-border").
HideOnClickOutsideControls whether clicking outside the popover hides it. Enabled by default; disable for popovers that should stay open until explicitly closed by their content.
HideOnEscapeControls whether pressing Escape hides the popover. Enabled by default.
DelayShowAdds a delay (in milliseconds) before the popover shows when ShowFor is called.
DelayHideAdds a delay (in milliseconds) before the popover hides after Hide is requested.
OnShownRegisters a callback that runs once the popover has finished its show animation.
OnHiddenRegisters a callback that runs once the popover has finished its hide animation.
OnBeforeHideRegisters a callback that runs immediately before the popover hides. Return false from the callback to cancel the hide (useful for guarding against accidental dismissal during editing).
ShowForShows the popover anchored to the rendered element of anchor. If the popover is already visible against a different anchor, that instance is hidden first.
HideHides the popover if it is currently visible. Safe to call repeatedly.
Method
Popover.Content
public Popover Content(IComponent content)

Sets the content displayed inside the popover. Replacing the content while the popover is visible will not retroactively update the rendered element; call Hide and ShowFor again to apply a new content tree.

Method
Popover.Placement
public Popover Placement(TooltipPlacement placement)

Sets the preferred placement of the popover relative to its anchor. Defaults to Bottom. The actual placement may flip automatically when there is not enough room on the preferred side.

Method
Popover.Animation
public Popover Animation(TooltipAnimation animation)

Sets the show/hide animation. Defaults to None.

Method
Popover.Arrow
public Popover Arrow(bool arrow = true)

Enables or disables the small arrow that points from the popover to the anchor.

Method
Popover.MaxWidth
public Popover MaxWidth(int pixels)

Sets the maximum width of the popover surface, in pixels. Defaults to 350.

Method
Popover.Theme
public Popover Theme(string theme)

Applies a named Tippy theme to the popover (e.g. "light", "light-border").

Method
Popover.HideOnClickOutside
public Popover HideOnClickOutside(bool hide = true)

Controls whether clicking outside the popover hides it. Enabled by default; disable for popovers that should stay open until explicitly closed by their content.

Method
Popover.HideOnEscape
public Popover HideOnEscape(bool hide = true)

Controls whether pressing Escape hides the popover. Enabled by default.

Method
Popover.DelayShow
public Popover DelayShow(int milliseconds)

Adds a delay (in milliseconds) before the popover shows when ShowFor is called.

Method
Popover.DelayHide
public Popover DelayHide(int milliseconds)

Adds a delay (in milliseconds) before the popover hides after Hide is requested.

Method
Popover.OnShown
public Popover OnShown(Action action)

Registers a callback that runs once the popover has finished its show animation.

Method
Popover.OnHidden
public Popover OnHidden(Action action)

Registers a callback that runs once the popover has finished its hide animation.

Method
Popover.OnBeforeHide
public Popover OnBeforeHide(Func<bool> shouldHide)

Registers a callback that runs immediately before the popover hides. Return false from the callback to cancel the hide (useful for guarding against accidental dismissal during editing).

Method
Popover.ShowFor
Overload
ShowFor(IComponent)Shows the popover anchored to the rendered element of anchor. If the popover is already visible against a different anchor, that instance is hidden first.
ShowFor(HTMLElement)Shows the popover anchored to the given DOM element. Use this overload when you only have an element reference (for example, when reacting to a low-level event).
ShowFor(IComponent)
public Popover ShowFor(IComponent anchor)

Shows the popover anchored to the rendered element of anchor. If the popover is already visible against a different anchor, that instance is hidden first.

Parameters

anchor IComponent
The component the popover is positioned relative to.
ShowFor(HTMLElement)
public Popover ShowFor(HTMLElement anchor)

Shows the popover anchored to the given DOM element. Use this overload when you only have an element reference (for example, when reacting to a low-level event).

Parameters

anchor HTMLElement
Method
Popover.Hide
public void Hide()

Hides the popover if it is currently visible. Safe to call repeatedly.

See also

© 2026 Curiosity. All rights reserved.