import { Story, Canvas, ArgsTable } from '@storybook/addon-docs'; import { HelpText } from './help-text'; # HelpText The `HelpText` is intended to be used as the help or error text under a form element ## Props The `HelpText` accepts all props below as well as all [Text](/docs/ui-components-component-library-text-text-stories-js--default-story#props) and [Box](/docs/ui-components-ui-box-box-stories-js--default-story#props) component props. ### Children The `children` of the `HelpText` can be plain text or react nodes. ```jsx import { SIZES, COLORS } from '../../../helpers/constants/design-system'; import { Icon, ICON_NAMES } from '../../ui/components/component-library'; import { HelpText } from '../../ui/components/component-library'; Plain text Text and icon ``` ### Error Use the `error` prop to show the `HelpText` in error state. ```jsx import { HelpText } from '../../ui/components/component-library'; This HelpText in error state; ``` ### Color It may be useful to change the color of the `HelpText`. Use the `color` prop and the `COLORS` object to change the color of the `HelpText`. Defaults to `COLORS.TEXT_DEFAULT`. ```jsx import { COLORS } from '../../../helpers/constants/design-system'; import { HelpText } from '../../ui/components/component-library'; The HelpText default color is COLORS.TEXT_DEFAULT This HelpText color is COLORS.INFO_DEFAULT This HelpText color is COLORS.WARNING_DEFAULT This HelpText color is COLORS.SUCCESS_DEFAULT ; ```