# Code

## Props

| Props        | Data Type      | Required             |
| ------------ | -------------- | -------------------- |
| defaultValue | string         | :x:                  |
| id           | string         | :white\_check\_mark: |
| className    | string         | :x:                  |
| name         | string         | :x:                  |
| placeholder  | string         | :x:                  |
| label        | string         | :x:                  |
| info         | string         | :x:                  |
| maxLength    | string         | :x:                  |
| helptext     | string         | :x:                  |
| error        | boolean        | :x:                  |
| errorMessage | string         | :x:                  |
| disabled     | boolean        | :x:                  |
| readOnly     | boolean        | :x:                  |
| onBlur       | function event | :x:                  |
| onChange     | function event | :x:                  |
| onFocus      | function event | :x:                  |

### Event Response

| Property | Data Type |
| -------- | --------- |
| id       | string    |
| name     | string    |
| label    | string    |
| value    | string    |

### onBlur, onChange, onFocus

For this example it is going to be use the onChange event, but the same logic can be applied to the other events.

```jsx
import React, {useState} from 'react';
import {Textarea} from '@2600hz/sds-react-components';

const Example = ()=>{
    const [textarea, setTextarea] = useState('');
    
    const updateState = (e)=>{
        setTextarea(e.value);
    }
    
    return(
        <div className='container'>
            <Textarea id='textarea' onChange={updateState} />
        </div>
    )
}
```

## Components Dependency

For this component elaboration there were used the following internal components:

* [Label](/sds/sds-components/form-controls/label.md)
* [Telicon](/sds/sds-components/simple-components/telicon.md)

## Live Demo

For detailed code usage documentation, see the Storybooks for each framework below.

### React

{% embed url="<https://sipster-react-component-storybook.netlify.app/?path=%2Fstory%2Fform-controls-textarea--basic-textarea>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://2600hz.gitbook.io/sds/sds-components/form-controls/textarea/code.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
