Switch is a widget that can toggle between an on and off state. It can be displayed as a switch, chip, checkbox, radio button, or segmented button.
| 24 | // It can be displayed as a switch, chip, checkbox, radio button, |
| 25 | // or segmented button. |
| 26 | type Switch struct { |
| 27 | Frame |
| 28 | |
| 29 | // Type is the styling type of switch. |
| 30 | // It must be set using [Switch.SetType]. |
| 31 | Type SwitchTypes `set:"-"` |
| 32 | |
| 33 | // Text is the optional text of the switch. |
| 34 | Text string |
| 35 | |
| 36 | // IconOn is the icon to use for the on, checked state of the switch. |
| 37 | IconOn icons.Icon |
| 38 | |
| 39 | // Iconoff is the icon to use for the off, unchecked state of the switch. |
| 40 | IconOff icons.Icon |
| 41 | |
| 42 | // IconIndeterminate is the icon to use for the indeterminate (unknown) state. |
| 43 | IconIndeterminate icons.Icon |
| 44 | } |
| 45 | |
| 46 | // SwitchTypes contains the different types of [Switch]es. |
| 47 | type SwitchTypes int32 //enums:enum -trim-prefix Switch -transform kebab |
nothing calls this directly
no outgoing calls
no test coverage detected