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

Checkbox

A themed box, a check, a label — plus indeterminate, invalid and sizes.

State lives in the caller's struct (Value); the component renders and reports clicks. One struct per on-screen instance — identity in immediate mode is the struct.

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 checkbox

Usage

open demo ↗

Checked state

The state IS the struct's Value — set it for an initial checked box, flip it on Clicked. There is no controlled/uncontrolled split in immediate mode; every checkbox is "controlled" by construction.

Go
accept := lotusui.Checkbox{Value: true} // starts checked

With text

A caption under the label is composition — a stack and an inset.

open demo ↗

Group

A checkbox list is composition — one struct per row, values yours.

open demo ↗

Disabled

open demo ↗

Indeterminate and invalid

Indeterminate renders the dash (a parent with some children selected); Invalid switches the chrome to danger.

open demo ↗

In a table

Row selection is composition: checkbox cells in a Table.

open demo ↗

Sizes

All seven shared Size presets.

open demo ↗

API

OptionTypeDescription
ValueboolThe state — yours.
SizeSizeThe shared size presets (Size2XS–Size2XL).
IndeterminateboolThe parent-of-mixed-children dash.
InvalidboolDanger chrome.
DisabledboolDimmed, unclickable.

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.