import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs';
import TextArea from '../TextArea';

<Meta
  title="Components/Inputs/TextArea"
  component={TextArea}
  decorators={[(storyFn) => <div className="input-story">{storyFn()}</div>]}
/>

# TextArea API

The API documentation of the TextArea React component. Learn more about the props and the CSS customization points.

## Import

```javascript
import { TextArea } from '@useblu/ocean-react';
```

## Usage

<Canvas>
  <Story
    name="TextArea"
    args={{
      label: 'Label',
      placeholder: 'Placeholder...',
      helperText: 'Some text here!',
      error: false,
      disabled: false,
    }}
    parameters={{
      controls: { exclude: /^blocked*/ },
    }}
    argTypes={{
      label: {
        control: 'text',
      },
      placeholder: {
        control: 'text',
      },
      defaultValue: {
        control: 'text',
      },
      disabled: {
        control: 'boolean',
      },
      helperText: {
        control: 'text',
      },
    }}
  >
    {(props) => <TextArea id="textarea-playground" {...props} />}
  </Story>
</Canvas>

## Props

<ArgsTable of="." />

The ref is forwarded to the root element.

Any other props supplied will be provided to the root element (native element).

## CSS

| Global class          | Description                                              |
| --------------------- | -------------------------------------------------------- |
| .ods-textarea         | Styles applied to the textarea element.                  |
| .ods-textarea--filled | Styles applied to the textarea element when it's filled. |
| .ods-textarea--error  | Styles applied to the textarea element if error={true}.  |

If that's not sufficient, you can check the [implementation of the component](https://github.com/ocean-ds/ocean-web/blob/master/packages/ocean-react/src/TextArea/TextArea.tsx) for more detail.

## Inheritance

The props of the [FormControl](?path=/docs/components-formcontrol--page) component are also available.
