Skip to content

Popover

Compose a positioned surface from a consumer-owned trigger and arbitrary content. Choose click, hover, or context activation and add the semantics your surface needs.

Default Rendered example
Usage Example
@popover.Popover(popover.Config{
    ID:        "filters-popover",
    Trigger:   filterTrigger(),
    Content:   filterContent(),
    Role:      "dialog",
    Label:     "Filters",
    TrapFocus: true,
})

Hover activation

Use ActivationHover for lightweight, non-modal supporting content while keeping the trigger and panel consumer-owned.

Hover activation Rendered example

Need a hand?

Popover content can be prose, forms, menus, or any other consumer-owned templ component.

Hover activation
@popover.Popover(popover.Config{
    Activation: popover.ActivationHover,
    Placement:  popover.PlacementBottomEnd,
    Trigger:    trigger,
    Content:    content,
})

Go API

v0.2.7

The examples above cover behavior and composition. pkg.go.dev is the canonical reference for exported types, functions, methods, and Go documentation.

github.com/araihu/goshtoso/components/popover
Open v0.2.7 API