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

Accordion

Stacked disclosures: one panel at a time, animated on the shared clock.

Titles that expand one panel of content at a time (Multiple for independent panels). The reveal grows on the shared clock — content is measured at natural height and clipped, never reflowed mid-flight.

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 accordion

Usage

Go
var acc lotusui.Accordion // zero value: all closed, single-open

acc.Layout(th, gtx,
	lotusui.AccordionItem{Title: "Is it accessible?", Content: answer1},
	lotusui.AccordionItem{Title: "Is it styled?", Content: answer2},
)

Multiple

Multiple lets panels expand independently.

Go
acc := lotusui.Accordion{Multiple: true}

Disabled item

Go
lotusui.AccordionItem{Title: "Premium feature information", Disabled: true, Content: c}

Borders

Bordered wraps the accordion in a rounded outline with side padding.

Go
acc := lotusui.Accordion{Bordered: true}

Card

Inside a padded surface — composition with SurfaceCard.

Go
lotusui.SurfaceCard(th, gtx, acc.Layout())

API

OptionTypeDescription
OpenintThe expanded item in single mode; -1 = all closed.
MultipleboolIndependent panels, tracked in Expanded.
Expanded[]boolPer-item state in Multiple mode.

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