Skip to content

Commit 64c38f6

Browse files
committed
docs(components/bottom_sheet): add Bottom Sheet docs and preview video
1 parent ed03e64 commit 64c38f6

File tree

3 files changed

+90
-0
lines changed

3 files changed

+90
-0
lines changed

docs/en/components/bottom_sheet.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
title: Bottom Sheet
3+
order: 22
4+
---
5+
6+
# Bottom Sheet
7+
8+
```rust
9+
pub fn bottom_sheet_provider(
10+
args: BottomSheetProviderArgs,
11+
state: Arc<RwLock<BottomSheetProviderState>>,
12+
main_content: impl FnOnce() + Send + Sync + 'static,
13+
bottom_sheet_content: impl FnOnce() + Send + Sync + 'static,
14+
)
15+
```
16+
17+
The `bottom_sheet_provider` is used to create a bottom sheet dialog in your application.
18+
19+
## Arguments
20+
21+
- `args: BottomSheetProviderArgs`
22+
23+
This argument configures the style of the dialog. Notably, `bottom_sheet_provider` supports both glass-style and non-glass-style dialogs. You can configure this via the `style: BottomSheetStyle` field of `BottomSheetProviderArgs`. The default is `BottomSheetStyle::Material` (the non-glass version).
24+
25+
- `state: Arc<RwLock<BottomSheetProviderState>>`
26+
27+
This argument manages the dialog's state, including whether the bottom sheet is open and the animation progress.
28+
29+
Use its `open()` and `close()` methods to programmatically open and close the dialog.
30+
31+
- `main_content: impl FnOnce()`
32+
33+
A closure used to render the main contentthe content underneath the bottom sheet.
34+
35+
- `bottom_sheet_content: impl FnOnce() + Send + Sync + 'static`
36+
37+
A closure used to render the bottom sheet's content.
38+
39+
## Preview
40+
41+
<video autoplay loop muted>
42+
43+
<source src="/bottom_sheet_example.mp4" type="video/mp4">
44+
Your browser does not support the video tag
45+
</video>
319 KB
Binary file not shown.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
title: Bottom Sheet
3+
order: 22
4+
---
5+
6+
# Bottom Sheet
7+
8+
```rust
9+
pub fn bottom_sheet_provider(
10+
args: BottomSheetProviderArgs,
11+
state: Arc<RwLock<BottomSheetProviderState>>,
12+
main_content: impl FnOnce() + Send + Sync + 'static,
13+
bottom_sheet_content: impl FnOnce() + Send + Sync + 'static,
14+
)
15+
```
16+
17+
`bottom_sheet_provider` 用于在应用中创建一个底部弹出的对话框。
18+
19+
## 参数
20+
21+
- `args: BottomSheetProviderArgs`
22+
23+
该参数配置对话框的样式。值得一提的是,`bottom_sheet_provider` 同时支持玻璃态版本和非玻璃态版本的对话框。它可以通过 `BottomSheetProviderArgs` 的 `style: BottomSheetStyle` 字段来配置。默认为 `BottomSheetStyle::Material`,即非玻璃态版本。
24+
25+
- `state: Arc<RwLock<BottomSheetProviderState>>`
26+
27+
该参数管理对话框的状态,包括底部对话框是否弹出以及动画进度。
28+
29+
使用其 `open()` 和 `close()` 方法可以程序化的打开和关闭对话框。
30+
31+
- `main_content: impl FnOnce()`
32+
33+
该参数是一个闭包,用于渲染主内容。即对话框下方的内容。
34+
35+
- `dialog_content: impl FnOnce() + Send + Sync + 'static`
36+
37+
该参数是一个闭包,用于渲染底部对话框内容。
38+
39+
## 预览
40+
41+
<video autoplay loop muted>
42+
43+
<source src="/bottom_sheet_example.mp4" type="video/mp4">
44+
Your browser does not support the video tag
45+
</video>

0 commit comments

Comments
 (0)