import { Story, Canvas, ArgsTable } from '@storybook/addon-docs';
import { Text } from '..';
import { HelpText } from './help-text';
# HelpText
The `HelpText` is used as feedback text under a form field including error, success, warning or info messages
## Props
The `HelpText` accepts all props below as well as all [Box](/docs/components-ui-box--default-story#props) component props
`HelpText` accepts all [Text](/docs/components-componentlibrary-text--default-story#props) component props
### Children
`HelpText` renders as a `
` tag if the child is a `string` or a `
` if the child is an `object`.
```jsx
import { Size, IconColor } from '../../../helpers/constants/design-system';
import { HelpText, Icon, ICON_NAMES } from '../../component-library';
Plain text // renders as
Plain text
Text and icon
// renders as
```
### Severity
Use the `severity` prop and `SEVERITIES` object to change the severity of the `HelpText`
```jsx
import { SEVERITIES } from '../../../helpers/constants/design-system';
import { HelpText } from '../../component-library';
HelpText without severity prop
HelpText with severity: SEVERITY.DANGER
HelpText with severity: SEVERITY.SUCCESS
HelpText with severity: SEVERITY.WARNING
HelpText with severity: SEVERITY.INFO
```
### Color
It may be useful to change the color of the `HelpText`. Use the `color` prop and the `Color` object to change the color of the `HelpText`. Defaults to `Color.textDefault`.
```jsx
import { Color } from '../../../helpers/constants/design-system';
import { HelpText } from '../../component-library';
This HelpText default color is TextColor.textDefault
This HelpText color is TextColor.textAlternative
This HelpText color is TextColor.textMuted
```