Skip to content

Latest commit

 

History

History
39 lines (25 loc) · 727 Bytes

File metadata and controls

39 lines (25 loc) · 727 Bytes
title Switch

Switch

Switch is a compact on/off toggle with a thumb and label.

Switch{.terminal}

Basic usage

var enabled = new State<bool>(true);
new Switch("Enabled").IsOn(enabled);

Defaults

  • Default alignment: HorizontalAlignment = Align.Start, VerticalAlignment = Align.Start

Styling

SwitchStyle controls:

  • left/right segment colors
  • thumb glyphs (ThumbGlyphOn / ThumbGlyphOff)
  • background/foreground for normal/hover/pressed/disabled

Interaction

  • Space / Enter: toggle when focused.
  • Mouse click: toggle.

Related