# Switch Component API A toggle switch component for binary on/off states. --- ## Installation ```toml # Cargo.toml [dependencies] shadcn-ui-leptos-switch = "0.7" ``` ```rust use shadcn_ui_leptos_switch::Switch; ``` --- ## Import ```rust use shadcn_ui_leptos_switch::{ Switch, SwitchRoot, SwitchThumb, SwitchLabel, SwitchVariant, SwitchSize }; ``` --- ## Component API ### Switch | Prop | Type | Default | Description | |------|------|---------|-------------| | `checked` | `Signal` | **Required** | Switch state | | `on_change` | `Option>` | `None` | Change handler | | `variant` | `MaybeProp` | `Default` | Visual variant | | `size` | `MaybeProp` | `Md` | Switch size | | `disabled` | `Signal` | `false` | Disable switch | | `animated` | `Signal` | `true` | Enable animation | | `class` | `MaybeProp` | `None` | Additional CSS classes | | `id` | `MaybeProp` | `None` | Unique identifier | | `style` | `Signal