Documentation
¶
Overview ¶
Package switcher provides a shadcn/ui-style switch with a label, from the Switch of MyGo. The package is named switcher because switch is a Go keyword.
switcher.Switch(c, switcher.Props{
On: &dark,
Label: "Dark mode",
})
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Props ¶
type Props struct {
// On is the bool the switch toggles.
On *bool
// Label is the text beside the switch. It also names the switch for
// tests: Click("Dark mode") toggles it.
Label string
// Disabled keeps the switch from being toggled.
Disabled bool
// Changed reports the new On, when the user toggled the switch.
Changed func(on bool)
}
Props describes the switch to draw.
Click to show internal directories.
Click to hide internal directories.