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

Switch

The toggle: sliding thumb, accent when on, animated on the shared clock.

A rounded track with a sliding thumb. Clicking flips Value; the thumb animates on the shared animation clock so every toggle in an app moves identically.

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 switch

Usage

Go
var notify lotusui.Switch
notify.Layout(th, gtx)
if notify.Value { /* … */ }

Sizes

All seven shared Size presets.

Go
sw.Size = lotusui.Size2XS // … through lotusui.Size2XL

Disabled

On and off, both facts — dimmed, unclickable.

Go
included.Value, included.Disabled = true, true

Invalid

Go
mustEnable.Invalid = true

Choice card

Settings rows — title, caption, switch at the end — inside a Card: pure composition.

Go
lotusui.Card(th, lotusui.CardOpts{}, lotusui.VStack(th.Space.MD,
	settingRow(&marketing, "Marketing emails", "Receive emails about new products and more."),
	lotusui.Hairline(th),
	settingRow(&security, "Security emails", "Receive emails about your account security."),
))

API

OptionTypeDescription
ValueboolThe state; clicking flips it.
SizeSizeThe shared size presets (Size2XS–Size2XL).
InvalidboolDanger chrome.
DisabledboolDimmed, unclickable.

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