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

RadioGroup

The exclusive choice: labeled circles, exactly one selected.

State lives on the struct (Selected); clicks are processed at the top of Layout. Per-option disabling is index-aligned, like Tabs.

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

Go
var density = lotusui.RadioGroup{Selected: 0}
density.Layout(th, gtx, "Default", "Comfortable", "Compact")
chosen := density.Selected

Disabled option

Go
plans := lotusui.RadioGroup{Disabled: []bool{false, true, false}}

Description

Descriptions, index-aligned, render muted under each label.

Go
density := lotusui.RadioGroup{Descriptions: []string{
	"Standard spacing for most use cases.",
	"More space between elements.",
	"Dense layout for scanning lots of data.",
}}

Invalid

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

Go
prefs := lotusui.RadioGroup{Invalid: true}

API

OptionTypeDescription
SelectedintThe chosen option — yours.
SizeSizeThe shared size presets scale the circles.
Disabled[]boolPer-option, index-aligned.
InvalidboolDanger chrome on the circles.

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