lotusui
A Go design system for desktop and mobile — one codebase, native apps. Web when you want it.
GitHub

RadioGroup

The exclusive choice: labeled circles, exactly one selected.

Options carry their own Description and Disabled flag; clicks are processed at the top of Layout, so the click's own frame renders the new selection.

Like every choice component, the selection is a VALUE: the cursor is unexported, Value()/SetValue() read and write it, the zero value picks the first option, and an unknown value clears rather than falling back to option 0 — see Select for the full contract.

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 radio-group

Usage

open demo ↗

Disabled option

open demo ↗

Description

Each option's Description renders muted under its label.

open demo ↗

Invalid

Invalid renders danger rings; pair it with a Field error.

open demo ↗

API

OptionTypeDescription
Options[]RadioOptionThe choices: Label, Value, Description (muted sub-label) and Disabled. RadioOpts("a","b") builds label-only lists.
Value() / SetValue(v)stringThe chosen option's value; SetValue with an unknown value clears.
Clear() / Chosen()methodDrop the choice; whether anything is chosen.
SizeSizeThe shared size presets scale the circles.
InvalidboolDanger chrome on the circles.

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.