lotusui
A Go design system for desktop and mobile — one codebase, native apps. Web when you want it.
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. Segments flow with Wrap (gap 0) so a narrow Max.X never squeezes labels into one-character columns. Tooltip is the wrong tool — inverted string tips do not stay open on the panel. HoverCard defaults stay max-320dp / 700ms (card hugs content); 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.

open demo ↗

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).

lotusui is a Go design system for native desktop and mobile — and the web when you want it. Docs demos are the real components (WebAssembly) — one gallery app, each Preview an iframe addressed by URL hash.