Components
@shadcn/react
@shadcn/helpers
Utilities
import { Checkbox } from "@/components/ui/checkbox"
import { Label } from "@/components/ui/label"
对于表单字段,请使用 Field 组件,该组件内置了标签、描述和错误处理功能。
安装#
pnpm dlx shadcn@latest add label
用法#
import { Label } from "@/components/ui/label"<Label htmlFor="email">您的电子邮件地址</Label>字段中的标签#
对于表单字段,请使用 Field 组件,其中包含内置的 FieldLabel、FieldDescription 和 FieldError 组件。
<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 配置指南。
"use client"
import * as React from "react"