# Description 描述 **Category**: react **URL**: https://www.heroui.com/cn/docs/react/components/description **Source**: https://raw.githubusercontent.com/heroui-inc/heroui/refs/heads/v3/apps/docs/content/docs/cn/react/components/(forms)/description.mdx > 为表单字段及其他组件提供补充说明文字。 *** ## 引入 ```tsx import { Description } from '@heroui/react'; ``` ## 用法 ```tsx import {Description, Input, Label} from "@heroui/react"; export function Basic() { return (
我们不会将你的邮箱分享给任何人。
); } ``` ## Related Components - **TextField**: Composition-friendly fields with labels and validation - **Input**: Single-line text input built on React Aria - **TextArea**: Multiline text input with focus management ## API 参考 ### Description Props | Prop | 类型 | 默认值 | 描述 | |------|------|--------|------| | `className` | `string` | - | 额外的 Tailwind CSS 类。 | | `children` | `ReactNode` | - | Description 的内容。 | ## 无障碍 Description 组件通过以下方式增强无障碍: - 使用语义化 HTML,屏幕阅读器可识别 - 提供 `slot="description"` 属性以便与 React Aria 集成 - 支持适宜的文本对比度 ## 样式 Description 组件使用以下 CSS 类: - `.description` - 基础 Description 样式,使用弱化(muted)文本颜色 ## 示例 ### 与表单字段一起使用 ```tsx
Must be at least 8 characters with one uppercase letter
``` ### 与 TextField 集成 ```tsx import {TextField, Label, Input, Description} from '@heroui/react'; We'll never share your email ``` 使用 [TextField](./text-field) 组件时,无障碍属性会自动应用到 Label 与 Description 上。