# 标签 · JGuang UI

> 为表单控件提供可访问的文本标签。

- 页面: https://jiguang132.com/zh/systems/jguang-ui/docs/components/radix/label
- 改编自: shadcn/ui 文档 (MIT) @ bc0705384b51252af26dcc65425b216bf5eb063c
- 说明：正文保留英文原文。

> 示例 `label-demo`: 交互预览见 https://jiguang132.com/zh/systems/jguang-ui/docs/components/radix/label


  For form fields, use the [Field](/systems/jguang-ui/docs/components/radix/field) component which
  includes built-in label, description, and error handling.


## Installation


  

**Command**


  

**Manual**


```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```


### Install the following dependencies:


```bash
npm install radix-ui
```


### Copy and paste the following code into your project.


[View complete source: components/ui/label.tsx](/r/jguang-ui/radix/label.json)


### Update the import paths to match your project setup.


## Usage

```tsx
import { Label } from "@/components/ui/label"
```

```tsx
<Label htmlFor="email">Your email address</Label>
```

## Label in Field

For form fields, use the [Field](/systems/jguang-ui/docs/components/radix/field) component which
includes built-in `FieldLabel`, `FieldDescription`, and `FieldError` components.

```tsx
<Field>
  <FieldLabel htmlFor="email">Your email address</FieldLabel>
  <Input id="email" />
</Field>
```


> 示例 `field-demo`: 交互预览见 https://jiguang132.com/zh/systems/jguang-ui/docs/components/radix/label


## RTL

To enable RTL support in JGuang UI, see the [RTL configuration guide](/systems/jguang-ui/docs/rtl).


> 示例 `label-rtl`: 交互预览见 https://jiguang132.com/zh/systems/jguang-ui/docs/components/radix/label


## API Reference

See the [Radix UI Label](https://www.radix-ui.com/docs/primitives/components/label#api-reference) documentation for more information.

---

JGuang 全部资源索引: https://jiguang132.com/llms.txt
