2023-12-31 23:33:05 +08:00
|
|
|
# Tabs
|
|
|
|
|
|
|
|
```rust demo
|
2024-06-04 17:30:40 +08:00
|
|
|
let selected_value = RwSignal::new(String::new());
|
2023-12-31 23:33:05 +08:00
|
|
|
|
|
|
|
view! {
|
2024-06-04 17:30:40 +08:00
|
|
|
<TabList selected_value>
|
|
|
|
<Tab value="apple">
|
2024-06-05 10:04:34 +08:00
|
|
|
"Apple"
|
2023-12-31 23:33:05 +08:00
|
|
|
</Tab>
|
2024-06-04 17:30:40 +08:00
|
|
|
<Tab value="pear">
|
2024-06-05 10:04:34 +08:00
|
|
|
"Pear"
|
|
|
|
</Tab>
|
|
|
|
<Tab value="item1">
|
|
|
|
"Item 1"
|
|
|
|
</Tab>
|
|
|
|
<Tab value="item2">
|
|
|
|
"Item 2"
|
2023-12-31 23:33:05 +08:00
|
|
|
</Tab>
|
2024-06-04 17:30:40 +08:00
|
|
|
</TabList>
|
2024-01-25 22:18:33 +08:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2023-12-31 23:33:05 +08:00
|
|
|
### Tabs Props
|
|
|
|
|
2024-02-09 22:44:22 +08:00
|
|
|
| Name | Type | Default | Description |
|
|
|
|
| -------- | ----------------------------------- | -------------------- | --------------------------------------- |
|
|
|
|
| class | `OptionalProp<MaybeSignal<String>>` | `Default::default()` | Addtional classes for the tabs element. |
|
|
|
|
| value | `Model<String>` | `Default::default()` | Tabs value. |
|
|
|
|
| children | `Children` | | Tabs content. |
|
2023-12-31 23:33:05 +08:00
|
|
|
|
|
|
|
### Tab Props
|
|
|
|
|
2024-02-09 22:44:22 +08:00
|
|
|
| Name | Type | Default | Description |
|
|
|
|
| -------- | ----------------------------------- | -------------------- | -------------------------------------- |
|
|
|
|
| class | `OptionalProp<MaybeSignal<String>>` | `Default::default()` | Addtional classes for the tab element. |
|
|
|
|
| key | `String` | | The indentifier of the tab. |
|
|
|
|
| label | `String` | `Default::default()` | The label of the tab. |
|
|
|
|
| children | `Children` | | Tabs content. |
|
2024-01-25 22:18:33 +08:00
|
|
|
|
|
|
|
### Tab Slots
|
|
|
|
|
|
|
|
| Name | Default | Description |
|
|
|
|
| -------- | ------- | -------------- |
|
|
|
|
| TabLabel | `None` | label content. |
|