# Button
```rust demo
view! {
}
```
### Color
```rust demo
view! {
}
```
### Icon
```rust demo
let icon = create_rw_signal(Some(icondata::AiCloseOutlined));
let on_click = move |_| {
icon.update(|icon| {
*icon = match icon {
Some(data) => {
if *data == icondata::AiCloseOutlined {
icondata::AiCheckOutlined
} else {
icondata::AiCloseOutlined
}
}
None => icondata::AiCloseOutlined
}.into();
});
};
view! {
}
```
### Loading
```rust demo
let loading = create_rw_signal(false);
let on_click = move |_| {
loading.set(true);
set_timeout(
move || {
loading.set(false);
},
std::time::Duration::new(2, 0),
);
};
view! {
}
```
### Disabled
```rust demo
view! {
}
```
### Size
```rust demo
view! {
}
```
### Block
```rust demo
view! {
}
```
### Group
```rust demo
view! {
}
```
### Button Props
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| class | `OptionalProp>` | `Default::default()` | Additional classes for the button element. |
| style | `Option>` | `Default::default()` | Button's style. |
| variant | `MaybeSignal` | `ButtonAppearance::Primary` | Button's variant. |
| color | `MaybeSignal` | `ButtonColor::Primary` | Button's color. |
| block | `MaybeSignal` | `false` | Whether the button is displayed as block. |
| round | `MaybeSignal` | `false` | Whether the button shows rounded corners. |
| circle | `MaybeSignal` | `false` | Whether the button is round. |
| icon | `OptionalMaybeSignal` | `None` | The icon of the button. |
| loading | `MaybeSignal` | `false` | Whether the button shows the loading status. |
| disabled | `MaybeSignal` | `false` | Whether the button is disabled. |
| size | `MaybeSignal` | `ButtonSize::Medium` | Button size. |
| on_click | `Option>` | `None` | Listen for button click events. |
| children | `Option` | | Button's content. |
### ButtonGroup props
| Name | Type | Default | Description |
| -------- | ----------------------------------- | -------------------- | ----------------------------------------- |
| class | `OptionalProp>` | `Default::default()` | Additional classes for the group element. |
| vertical | `bool` | `false` | Directions of buttons in the group. |
| children | `Children` | | ButtonGroup's content. |