switches

package
v0.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SwitchFixtures = gx.Fixtures[SwitchProps]{
	"Off":      {Name: "wifi", Label: "Wifi"},
	"On":       {Name: "wifi", Label: "Wifi", Checked: true},
	"Disabled": {Name: "wifi", Label: "Wifi", Disabled: true},
	"Small":    {Name: "wifi", Label: "Wifi", Size: Sm},
	"SmallOn":  {Name: "wifi", Label: "Wifi", Size: Sm, Checked: true},
}

Functions

func Switch

func Switch(p SwitchProps) gx.Node

Types

type Size

type Size string

Size is the size of a switch.

const (
	Md Size = "default"
	Sm Size = "sm"
)

The sizes of switches.Switch.

type SwitchProps

type SwitchProps struct {
	// Size sets the size of the track and the thumb: Md or Sm.
	Size Size
	// Name is the form field name.
	Name string
	// Label is the accessible name of the switch.
	Label string
	// Value is the value the form submits when the switch is on.
	Value string
	// Checked sets the switch on for the first render.
	Checked bool
	// Disabled disables the switch.
	Disabled bool
	// Class adds classes to the root element.
	Class string
	// Attrs adds HTML attributes to the root element.
	Attrs gx.Attrs
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL