import { Story, Canvas, ArgsTable } from '@storybook/addon-docs'; import { Text } from '..'; import { Label } from './label'; # Label `Label` is used to describe the purpose of a form field ## Props The `Label` accepts all props below as well as all [Box](/docs/components-ui-box--default-story#props) component props `Label` accepts all [Text](/docs/components-componentlibrary-text--default-story#props) component props ### Children The `children` of the label can be text or a react node ```jsx import { DISPLAY, AlignItems, FLEX_DIRECTION, Size, IconColor } from '../../../helpers/constants/design-system'; import { Label, TextField, Icon, IconName, IconSize } from '../../component-library'; ``` ### Html For Use the `htmlFor` prop to allow the `Label` to focus on an input with the same id when clicked. The cursor will also change to a `pointer` when the `htmlFor` has a value. ```jsx import { Label, TextField } from '../../component-library'; ``` ### Internal Resources - [Figma component](https://www.figma.com/file/HKpPKij9V3TpsyMV1TpV7C/branch/7uyrueQIFQBLqo9uzkxclr/DS-Components?node-id=13879%3A38076&t=dBHjnJTMSVE8N2UP-1) - [Insight report](https://www.figma.com/file/aGW8sk6X6Jf9ac0MRMD4kX/TextField-Audit?node-id=282%3A22&t=ZgCGFwGOBmOwQR5c-1)