组件
import { Checkbox } from "@/components/ui/checkbox"
import { Label } from "@/components/ui/label"
对于表单字段,请使用 Field 组件,该组件包含内置的标签、描述和错误处理功能。
安装
🌐 Installation
pnpm dlx shadcn@latest add label
用法
🌐 Usage
import { Label } from "@/components/ui/label"<Label htmlFor="email">Your email address</Label>字段中的标签
🌐 Label in Field
对于表单字段,请使用包含内置 FieldLabel、FieldDescription 和 FieldError 组件的 Field 组件。
🌐 For form fields, use the Field component which
includes built-in FieldLabel, FieldDescription, and FieldError components.
<Field>
<FieldLabel htmlFor="email">Your email address</FieldLabel>
<Input id="email" />
</Field>import { Button } from "@/components/ui/button"
import { Checkbox } from "@/components/ui/checkbox"
import {从右到左
🌐 RTL
要在 shadcn/ui 中启用 RTL 支持,请参阅 RTL 配置指南。
🌐 To enable RTL support in shadcn/ui, see the RTL configuration guide.
"use client"
import * as React from "react"API参考
🌐 API Reference
有关更多信息,请参阅 Radix UI Label 文档。
🌐 See the Radix UI Label documentation for more information.