import { Story, Canvas, ArgsTable } from '@storybook/addon-docs'; import { Text } from '..'; import { Label } from './label'; # Label The `Label` is a component used to label form inputs ## Props The `Label` accepts all props below as well as all [Box](/docs/ui-components-ui-box-box-stories-js--default-story#props) component props `Label` accepts all [Text](/docs/ui-components-component-library-text-text-stories-js--default-story#props) component props ### Children The `children` of the label can be text or a react node ```jsx import { DISPLAY, ALIGN_ITEMS, FLEX_DIRECTION, SIZES, COLORS } from '../../../helpers/constants/design-system'; import { Label, TextField, Icon, ICON_NAMES } 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, TextFieldBase } from '../../component-library'; ``` ### Required Use the `required` prop to add a required red asterisk next to the `children` of the `Label`. Note the required asterisk will always render after the `children`. ```jsx import { Label } from '../../component-library'; ; ``` ### Disabled Use the `disabled` prop to set the `Label` in disabled state ```jsx import { Label } from '../../component-library'; ; ```