Skip to content

Commit 976b66d

Browse files
committed
docs(components/text): add documentation for Text component
1 parent e190749 commit 976b66d

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

docs/en/components/text.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: Text
3+
order: 3
4+
---
5+
6+
# Text
7+
8+
```rust
9+
pub fn text(args: impl Into<TextArgs>)
10+
```
11+
12+
The Text component is used to display textual content.
13+
14+
## Arguments
15+
16+
- `args: impl Into<TextArgs>`
17+
18+
This argument configures the style of the `text` component, including content, font size, color, alignment, and other properties. You can build it via `TextArgsBuilder`.
19+
20+
Note that since `Into<TextArgs>` is implemented for types like `str` and `String`, you can use the shorthand `text("Hello, World!")`.

docs/zhHans/components/text.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: Text 组件
3+
order: 3
4+
---
5+
6+
# Text
7+
8+
```rust
9+
pub fn text(args: impl Into<TextArgs>)
10+
```
11+
12+
Text 组件用于显示文本内容。
13+
14+
## 参数
15+
16+
- `args: impl Into<TextArgs>`
17+
18+
此参数用于配置`text`组件的样式,包括文本内容、字体大小、颜色、对齐方式等属性。可以通过`TextArgsBuilder`来构建这个参数。
19+
20+
值得一提的是,由于为`str`、`String`等类型实现了`Into<TextArgs>`,因此可以使用`text("Hello, World!")`这样的简便写法。

0 commit comments

Comments
 (0)