tooltip

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package tooltip provides small informational popups on hover or focus.

Tooltips display brief text information when hovering over or focusing an element. They are non-interactive and auto-dismiss when the trigger loses hover/focus.

Basic usage:

tooltip.Tooltip(
    tooltip.TooltipProps{Position: forgeui.PositionTop},
    button.Button(g.Text("?")),
    "This is helpful information",
)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Tooltip

func Tooltip(props TooltipProps, trigger g.Node, content string) g.Node

Tooltip creates a tooltip that shows on hover/focus.

Tooltips are lightweight, non-interactive popups for displaying brief information. They automatically show on hover/focus and hide when the trigger loses hover/focus.

Example:

tooltip.Tooltip(
    tooltip.TooltipProps{
        Position: forgeui.PositionRight,
        Delay:    300,
    },
    html.Button(g.Text("Help")),
    "Click here for assistance",
)

func TooltipProvider

func TooltipProvider(children ...g.Node) g.Node

TooltipProvider wraps children with tooltip context for default settings.

This is useful when you want to set default delay or other props for multiple tooltips in a section.

Types

type TooltipProps

type TooltipProps struct {
	// Position specifies where the tooltip appears relative to trigger
	Position forgeui.Position

	// Delay is the hover delay before showing (in milliseconds)
	Delay int

	// Class adds additional CSS classes
	Class string
}

TooltipProps defines configuration for a tooltip

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL