2023-12-31 23:33:05 +08:00
|
|
|
# Switch
|
|
|
|
|
|
|
|
```rust demo
|
2024-06-03 10:44:51 +08:00
|
|
|
let checked = RwSignal::new(false);
|
2023-12-31 23:33:05 +08:00
|
|
|
|
|
|
|
view! {
|
2024-06-03 10:44:51 +08:00
|
|
|
<Switch checked />
|
2023-12-31 23:33:05 +08:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### Switch Props
|
|
|
|
|
2024-02-09 22:44:22 +08:00
|
|
|
| Name | Type | Default | Description |
|
|
|
|
| ----- | ----------------------------------- | -------------------- | ----------------------------------------- |
|
|
|
|
| class | `OptionalProp<MaybeSignal<String>>` | `Default::default()` | Addtional classes for the switch element. |
|
|
|
|
| value | `Model<bool>` | `false` | Switch's value. |
|