2024-06-27 14:51:36 +08:00
|
|
|
# Combobox
|
|
|
|
|
|
|
|
```rust demo
|
2024-07-25 15:10:49 +08:00
|
|
|
let selected_options = RwSignal::new(None::<String>);
|
2024-06-27 14:51:36 +08:00
|
|
|
|
|
|
|
view! {
|
2024-07-01 16:32:28 +08:00
|
|
|
<Combobox selected_options>
|
|
|
|
<ComboboxOption value="cat" text="Car" />
|
|
|
|
<ComboboxOption value="dog" text="Dog" />
|
2024-06-27 14:51:36 +08:00
|
|
|
</Combobox>
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2024-06-27 17:31:52 +08:00
|
|
|
### Clearable
|
|
|
|
|
|
|
|
```rust demo
|
2024-07-01 16:32:28 +08:00
|
|
|
let selected_options = RwSignal::new(vec![]);
|
2024-06-27 17:31:52 +08:00
|
|
|
|
|
|
|
view! {
|
2024-07-25 15:10:49 +08:00
|
|
|
<Combobox selected_options clearable=true>
|
2024-07-01 16:32:28 +08:00
|
|
|
<ComboboxOption value="cat" text="Car" />
|
|
|
|
<ComboboxOption value="dog" text="Dog" />
|
2024-06-27 17:31:52 +08:00
|
|
|
</Combobox>
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2024-06-27 14:51:36 +08:00
|
|
|
### Multiselect
|
|
|
|
|
|
|
|
```rust demo
|
2024-07-01 16:32:28 +08:00
|
|
|
let selected_options = RwSignal::new(vec![]);
|
2024-06-27 14:51:36 +08:00
|
|
|
|
|
|
|
view! {
|
2024-07-25 15:10:49 +08:00
|
|
|
<Combobox selected_options>
|
2024-07-01 16:32:28 +08:00
|
|
|
<ComboboxOption value="cat" text="Car" />
|
|
|
|
<ComboboxOption value="dog" text="Dog" />
|
2024-06-27 14:51:36 +08:00
|
|
|
</Combobox>
|
|
|
|
}
|
|
|
|
```
|