# Switch
> Toggle switch component for boolean selections.
Source: https://shellui.dev/docs/v0.3/components/form/switch
The Switch component provides a toggle switch with a modern, animated design for on/off states.
## Installation
```bash
shellui add switch
```
## Usage
### Basic
```razor
@code {
private bool isEnabled = false;
private void HandleChanged(bool value)
{
isEnabled = value;
}
}
```
### Two-way Binding
```razor
@code {
private bool notificationsEnabled = false;
}
```
### With Label
```razor
@code {
private bool notificationsEnabled = false;
}
```
### Settings Example
```razor
Receive email updates
Receive push updates
@code {
private bool emailNotifications = false;
private bool pushNotifications = false;
}
```
### Disabled
```razor
```
## API Reference
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `Checked` | `bool` | `false` | Checked state |
| `CheckedChanged` | `EventCallback` | — | Fires when checked state changes |
| `Disabled` | `bool` | `false` | Disables the switch |
| `Class` | `string?` | `null` | Additional CSS classes |
## Accessibility
- Proper ARIA attributes (`role="switch"`, `aria-checked`)
- Keyboard navigation support (Space to toggle)
- Screen reader compatible