import { ArgsTable, Canvas, Story } from '@storybook/addon-docs/blocks';
import { TextField } from '../TextField';
import { ArchitectureSvg } from './ArchitectureSvg';

# TextField

Inputs allow users to enter text into a UI. They typically appear in forms and dialogs.
`<TextField />` component is a complete form control including a label, input helper text as well as state messages.

<Story id="inputs-textfield--with-everything" />

## Architecture

Inputs may have a leading icon, a prefix, a suffix and a trailing icon. By default, they also contain a button to clear input value.

<ArchitectureSvg />

### Leading/Trailing icons

To add icons use `<Icon />` component

### State handling

By passing either `error`, `warning` or `success` you can change the state of the input.

<Story id="inputs-textfield--text-field-states" />

## Props

<ArgsTable of={TextField} />
