lotusui
A Go design system for desktop and mobile — one codebase, native apps. Web when you want it.
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

open demo ↗

Sizes

All seven shared Size presets.

open demo ↗

Disabled

On and off, both facts — dimmed, unclickable.

open demo ↗

Invalid

open demo ↗

Choice card

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

open demo ↗

API

OptionTypeDescription
ValueboolThe state; clicking flips it.
SizeSizeThe shared size presets (Size2XS–Size2XL).
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.