import { Story, Canvas, ArgsTable } from '@storybook/addon-docs';
import { Input } from './input';
# Input
`Input` lets user enter a text data. It’s a light-weighted borderless input used inside of custom inputs. See [TextField](/docs/components-componentlibrary-textfield--default-story#textfield) for common text input.
Use the `ref` prop to access the ref of the `<input />` html element of `Input`. This is useful for focusing the input from a button or other component.
Use the `autoFocus` prop to focus the `Input` during the first mount
To view story see [Canvas tab](/story/components-componentlibrary-input--auto-focus). Removing it from docs because created annoying reading experience 😁
```jsx
import { Input } from '../../component-library';
<Input autoFocus />;
```
### Default Value
Use the `defaultValue` prop to set the default value of the `Input`. Used for uncontrolled inputs.
Use the `error` prop to set `aria-invalid="true"`. This helps with screen readers for accessibility. There is no visual indicator for `error` this should be handled in the parent component.
Use the `required` prop to set the html `required` attribute used by the browser api. There is no visual indicator for `required` this should be handled in the parent component.
Use the `disableStyleStates` to remove disabled and focus styles
#### IMPORTANT NOTE
This sets the CSS to `outline: none` so ensure there is a proper fallback to enable accessibility for keyboard only and vision impaired users. Check `TextField` source code to see how it is done properly.