Skip to content

Commit 092c3f2

Browse files
committed
docs(components/checkbox): add checkbox documentation
1 parent 7dbf1e5 commit 092c3f2

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

docs/en/components/checkbox.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
title: Checkbox component
3+
order: 17
4+
---
5+
6+
# Checkbox
7+
8+
```rust
9+
pub fn checkbox(args: impl Into<CheckboxArgs>, state: Arc<CheckboxState>)
10+
```
11+
12+
The `checkbox` component is an interactive checkbox that allows users to select or deselect an option.
13+
14+
## Arguments
15+
16+
- `args: impl Into<CheckboxArgs>`
17+
18+
This argument configures the style of the checkbox and can register a callback for change events.
19+
20+
- `state: Arc<CheckboxState>`
21+
22+
This argument manages the checkbox state, including whether it is checked and animation progress.
23+
24+
## Preview
25+
26+
![checkbox](/checkbox_example.gif)

docs/public/checkbox_example.gif

64.3 KB
Loading

docs/zhHans/components/checkbox.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
title: CheckBox 组件
3+
order: 17
4+
---
5+
6+
# CheckBox
7+
8+
```rust
9+
pub fn checkbox(args: impl Into<CheckboxArgs>, state: Arc<CheckboxState>)
10+
```
11+
12+
`checkbox` 组件是一个可以交互的复选框,允许用户选择或取消选择某个选项。
13+
14+
## 参数
15+
16+
- `args: impl Into<CheckboxArgs>`
17+
18+
此参数用于配置复选框的样式,以及注册改变时的回调函数。
19+
20+
- `state: Arc<CheckboxState>`
21+
22+
此参数用于管理复选框的状态,包括是否被选中,动画进度等。
23+
24+
## 预览
25+
26+
![checkbox](/checkbox_example.gif)

0 commit comments

Comments
 (0)