BOBInputSwitch
Toggle-style boolean input with optional icons in the thumb and custom track colors.
API reference ↗Basic usage
Receive updates about account activity.
RAZOR
<BOBInputSwitch @bind-Value="_basic" Label="Enable notifications" HelperText="Receive updates about account activity." />Sizes
RAZOR
<BOBInputSwitch @bind-Value="_small" Size="BOBSize.Small" Label="Small" />
<BOBInputSwitch @bind-Value="_medium" Size="BOBSize.Medium" Label="Medium" />
<BOBInputSwitch @bind-Value="_large" Size="BOBSize.Large" Label="Large" />Colors
RAZOR
<BOBInputSwitch @bind-Value="_colorPrimary" TrackColorActive="@PaletteColor.Primary" Label="Primary" />
<BOBInputSwitch @bind-Value="_colorSuccess" TrackColorActive="@PaletteColor.Success" Label="Success" />
<BOBInputSwitch @bind-Value="_colorError" TrackColorActive="@PaletteColor.Error" Label="Error" />With icons
RAZOR
<BOBInputSwitch @bind-Value="_wifi"
IconActive="@BOBIconKeys.MaterialIconsOutlined.i_wifi"
IconInactive="@BOBIconKeys.MaterialIconsOutlined.i_wifi_off"
Label="Wi-Fi" />
<BOBInputSwitch @bind-Value="_bluetooth"
IconActive="@BOBIconKeys.MaterialIconsOutlined.i_bluetooth"
IconInactive="@BOBIconKeys.MaterialIconsOutlined.i_bluetooth_disabled"
Label="Bluetooth" />States
RAZOR
<BOBInputSwitch @bind-Value="_required" Label="Required" Required="true" />
<BOBInputSwitch @bind-Value="_readonly" Label="ReadOnly" ReadOnly="true" />
<BOBInputSwitch @bind-Value="_disabledOn" Disabled="true" Label="Disabled (on)" />
<BOBInputSwitch @bind-Value="_disabledOff" Disabled="true" Label="Disabled (off)" />Properties
8 rows.
| Property | Type | Default | Description |
|---|---|---|---|
Size | BOBSize | BOBSize.Medium | Visual size of the component. |
Density | BOBDensity | BOBDensity.Standard | Vertical density (gap) of the component. |
Label | string? | | Floating label displayed above the component. |
HelperText | string? | | Helper text displayed below the component for additional context. |
IconInactive | IconKey? | | IconInactive. |
IconActive | IconKey? | | IconActive. |
TrackColorInactive | string? | | TrackColorInactive. |
TrackColorActive | string? | | TrackColorActive. |