BeginToggle#
func BeginToggle(canvas *ui.Canvas, theme ui.Theme, id ui.ID, bounds ui.Rect, active bool) ToggleBeginToggle starts a toggle declaration.
type Toggle struct {
// contains filtered or unexported fields
}Toggle paints one two-state compact action. The application owns active state and responds to the stable Canvas hit ID.
BeginToggle#func BeginToggle(canvas *ui.Canvas, theme ui.Theme, id ui.ID, bounds ui.Rect, active bool) ToggleBeginToggle starts a toggle declaration.
BoundsWidth#func (toggle Toggle) BoundsWidth() float32BoundsWidth exposes the fitted width for callers laying out neighbors.
Default#func (toggle Toggle) Default(label string) ToggleResultDefault paints the borderless treatment.
Disabled#func (toggle Toggle) Disabled() ToggleDisabled renders and routes the toggle as inert.
Invalid#func (toggle Toggle) Invalid() ToggleInvalid applies the destructive validation treatment.
Large#func (toggle Toggle) Large() ToggleLarge selects the large size variant.
Outline#func (toggle Toggle) Outline(label string) ToggleResultOutline paints the bordered treatment.
SizeToFit#func (toggle Toggle) SizeToFit(label string) ToggleSizeToFit widens the toggle to its label plus Vega's px-2.5, never narrower than it is tall (min-w).
Small#func (toggle Toggle) Small() ToggleSmall selects the compact size variant.