mswitch

package
v0.1.51 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package switch contains Material 3 Switch components.

Reference: Switch(https://m3.material.io/components/switch/overview) Specs: [Switch Specs](https://m3.material.io/components/switch/specs)

Note: "switch" is a reserved keyword in Go, but package names can match keywords if not used as identifiers.

Index

Constants

View Source
const Material3SwitchNodeID = "Material3Switch"

Variables

This section is empty.

Functions

This section is empty.

Types

type Composable

type Composable = api.Composable

func Switch

func Switch(
	checked bool,
	onCheckedChange func(bool),
	options ...SwitchOption,
) Composable

Switch creates a Material3 switch (toggle).

type Composer

type Composer = api.Composer

type HandlerWrapper

type HandlerWrapper struct {
	Func func(bool)
}

type SwitchOption

type SwitchOption func(*SwitchOptions)

func WithModifier

func WithModifier(m ui.Modifier) SwitchOption

type SwitchOptions

type SwitchOptions struct {
	Modifier ui.Modifier
}

func DefaultSwitchOptions

func DefaultSwitchOptions() SwitchOptions

Jump to

Keyboard shortcuts

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