lotusui the ikaito design language for Gio — desktop, mobile, web
GitHub

AnnotatedText

In-text glossary terms with HoverCard tips — BrandFg ink, stay-open panels.

A lotusui extension: highlight terms in body copy and preview a tip on hover. SplitGlossary segments the string (longest match wins); AnnotatedText paints terms in BrandFg and opens a HoverCard when a card identity is provided. Tooltip is the wrong tool — inverted string tips do not stay open on the panel. HoverCard defaults stay 320dp / 700ms; compact UIs set Width, OpenDelay, and Side on each card.

Installation

Use the module import (the default), or own the source: lotusui add vendors the component into your app and lotusui update keeps the copy mergeable — see Registry.

Go
go get github.com/ikaito-com/lotusui

# or vendor the source into your app:
go run github.com/ikaito-com/lotusui/cmd/lotusui add annotated-text

Usage

Neutral glossary terms (API, SLA) — one HoverCard per term identity; multi-site Layout covers repeats.

Go
terms := []lotusui.GlossaryTerm{
	{Term: "API", Tip: "Application Programming Interface"},
	{Term: "SLA", Tip: "Service Level Agreement"},
}
var api, sla lotusui.HoverCard
api.Width, sla.Width = 200, 200
api.OpenDelay, sla.OpenDelay = 400*time.Millisecond, 400*time.Millisecond
api.Side, sla.Side = lotusui.HoverCardTop, lotusui.HoverCardTop

lotusui.AnnotatedText(th,
	"The API must meet the SLA under load.",
	terms, []*lotusui.HoverCard{&api, &sla})

SplitGlossary

Pure segmentation — longest literal match wins when spans collide.

Go
lotusui.SplitGlossary(text, terms)

API

OptionTypeDescription
GlossaryTermstructTerm (literal) + Tip (Caption in the card).
SplitGlossaryfunc[]GlossarySeg — plain vs term runs.
AnnotatedTextwidgetBrandFg terms; cards[i] for terms[i] (nil / short slice = ink only).

Every demo on this site is the real Go component compiled to WebAssembly — one gallery app, one bundle, addressed by URL hash.