SusToggle

Boolean switch with label — on/off for settings and filters.
Package
SusKit · Atoms (commercial)
Props
| Name | Type | Default | |
|---|---|---|---|
Model | Prop<bool> | false | v-model |
Label | Prop<string> | "" | v-model |
Color | Prop<string> | "primary" | v-model |
LabelPosition | Prop<string> | "right" | v-model |
Inset | Prop<bool> | false | v-model |
Disabled | Prop<bool> | false | v-model |
Loading | Prop<bool> | false | v-model |
Density | Prop<string> | "default" | v-model |
Variant | Prop<string> | "icon" | v-model |
Slots
No slots.
Events
| Name | Field | Payload |
|---|---|---|
Change | OnChange | bool |
Style hooks
USS class contract — override appearance without touching C#. States toggle via these classes:
keyboard-focussus-togglesus-toggle__iconsus-toggle__labelsus-toggle__label--leftsus-toggle__label--rightsus-toggle__track-thumbsus-toggle--activesus-toggle--dangersus-toggle--density-comfortablesus-toggle--density-compactsus-toggle--disabledsus-toggle--insetsus-toggle--label-leftsus-toggle--label-rightsus-toggle--loadingsus-toggle--primarysus-toggle--successsus-toggle--track
Usage
xml
<template>
<sus:SusToggle Label="Show HUD"
:Model="HudVisible.Value"
Color="primary"
LabelPosition="right"
@change="OnHud" />
</template>
<script>
public Prop<bool> HudVisible = new(true);
void OnHud(bool value) { /* … */ }
</script>csharp
var toggle = new SusToggle();
toggle.Label.Value = "Mute chat";
toggle.Model.Value = false;
toggle.Color.Value = "success";
toggle.Inset.Value = true;
toggle.OnChange += value => { /* … */ };Colors
primary · success · danger (plus theme tokens when allowed)
Notes
LabelPosition:left·right.Loadingkeeps the control busy while a setting syncs.