> ## Documentation Index
> Fetch the complete documentation index at: https://neo.tvk.company/llms.txt
> Use this file to discover all available pages before exploring further.

# Text Area

> A multi-line text input widget with auto-resizing, manual resizing, and advanced keyboard shortcuts for capturing longer text content.

## Examples

<Tabs>
  <Tab title="Basic Usage">
    <Frame caption="Basic text area with different configurations and features.">
      <img src="https://mintcdn.com/tvk/xOcwrKRVA4J0vbxn/images/widgets/inputs/text-area/text_area_basic_light.png?fit=max&auto=format&n=xOcwrKRVA4J0vbxn&q=85&s=b85260f1248a2c2e17e532fda87946a8" alt="Basic text area example" noZoom className="block dark:hidden" width="1536" height="384" data-path="images/widgets/inputs/text-area/text_area_basic_light.png" />

      <img src="https://mintcdn.com/tvk/xOcwrKRVA4J0vbxn/images/widgets/inputs/text-area/text_area_basic_dark.png?fit=max&auto=format&n=xOcwrKRVA4J0vbxn&q=85&s=f448112bd17638746818deaf54f1dea7" alt="Basic text area example" noZoom className="hidden dark:block" width="1536" height="384" data-path="images/widgets/inputs/text-area/text_area_basic_dark.png" />
    </Frame>

    <CodeGroup>
      ```dart With Label and Description lines theme={null}
      NeoTextArea(
        controller: controller, // Using e.g. useTextEditingController() hook
        label: "Comments",
        description: "Share your thoughts and feedback",
        onChanged: (value) {
          // Handle input
        },
      ),
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Keyboard Shortcuts">
    <Frame caption="Text area with different keyboard submission behaviors.">
      <img src="https://mintcdn.com/tvk/xOcwrKRVA4J0vbxn/images/widgets/inputs/text-area/text_area_shortcuts_light.png?fit=max&auto=format&n=xOcwrKRVA4J0vbxn&q=85&s=3e21f0020ca3e6e1af13cb8337a48764" alt="Text area keyboard shortcuts" noZoom className="block dark:hidden" width="1536" height="512" data-path="images/widgets/inputs/text-area/text_area_shortcuts_light.png" />

      <img src="https://mintcdn.com/tvk/xOcwrKRVA4J0vbxn/images/widgets/inputs/text-area/text_area_shortcuts_dark.png?fit=max&auto=format&n=xOcwrKRVA4J0vbxn&q=85&s=fb732a9dec232f9dcaa9e36df0c0b4bf" alt="Text area keyboard shortcuts" noZoom className="hidden dark:block" width="1536" height="512" data-path="images/widgets/inputs/text-area/text_area_shortcuts_dark.png" />
    </Frame>

    <CodeGroup>
      ```dart Cmd/Ctrl+Enter to Submit (Editor-style) lines theme={null}
      NeoTextArea(
        controller: controller, // Using e.g. useTextEditingController() hook
        placeholder: "Write your document...",
        minLines: 8,
        maxLines: 20,
        onSubmitted: (value) {
          NeoLogger.trace("Document saved: $value");
        },
      ),
      ```

      ```dart Enter to Submit (Chat-style) lines theme={null}
      NeoTextArea(
        controller: controller, // Using e.g. useTextEditingController() hook
        placeholder: "Type a message...",
        minLines: 1,
        maxLines: 5,
        submitOnEnter: true,
        maintainFocusOnSubmit: true,
        showResizeHandle: false,
        onSubmitted: (value) {
          NeoLogger.trace("Message sent: $value");
          controller.clear();
        },
      ),
      ```
    </CodeGroup>
  </Tab>

  <Tab title="States">
    <Frame caption="Text area with different states.">
      <img src="https://mintcdn.com/tvk/xOcwrKRVA4J0vbxn/images/widgets/inputs/text-area/text_area_states_light.png?fit=max&auto=format&n=xOcwrKRVA4J0vbxn&q=85&s=3574e6d6b4a74e4d1ea0613213b2f1fd" alt="Text area states" noZoom className="block dark:hidden" width="1536" height="384" data-path="images/widgets/inputs/text-area/text_area_states_light.png" />

      <img src="https://mintcdn.com/tvk/xOcwrKRVA4J0vbxn/images/widgets/inputs/text-area/text_area_states_dark.png?fit=max&auto=format&n=xOcwrKRVA4J0vbxn&q=85&s=704505a9fbc81653c84687e7175aeace" alt="Text area states" noZoom className="hidden dark:block" width="1536" height="384" data-path="images/widgets/inputs/text-area/text_area_states_dark.png" />
    </Frame>

    <CodeGroup>
      ```dart With Error State lines theme={null}
      NeoTextArea(
        controller: controller, // Using e.g. useTextEditingController() hook
        label: "Product Description",
        placeholder: "Describe your product...",
        errorText: controller.text.isEmpty ? "Description is required" : null,
        onChanged: (value) {
          // Trigger rebuild to update error state
        },
      ),
      ```

      ```dart Disabled State lines theme={null}
      NeoTextArea(
        controller: controller, // Using e.g. useTextEditingController() hook
        label: "Read-only Content",
        placeholder: "This content cannot be edited",
        isEnabled: false,
      ),
      ```
    </CodeGroup>
  </Tab>
</Tabs>

## Properties

### Required

<ParamField path="controller" type="TextEditingController" required>
  The controller for managing the text content of the text area.
</ParamField>

### Content

<ParamField path="label" type="String?">
  Optional label text displayed above the text area.
</ParamField>

<ParamField path="placeholder" type="String?" default="Type here...">
  Hint text displayed when the text area is empty.
</ParamField>

<ParamField path="description" type="String?">
  Optional helper text displayed below the text area. Hidden when `errorText` is present.
</ParamField>

<ParamField path="errorText" type="String?">
  Error message displayed below the text area. Takes priority over `description`.
</ParamField>

<ParamField path="inputFormatters" type="List<TextInputFormatter>?">
  List of input formatters to control text input behavior (e.g., length limits, character restrictions).
</ParamField>

<ParamField path="autofillHints" type="List<String>?">
  Hints for autofill services.
</ParamField>

### Layout

<ParamField path="minLines" type="int" default="3">
  Minimum number of lines to display.
</ParamField>

<ParamField path="maxLines" type="int" default="5">
  Maximum number of lines for auto-sizing.
</ParamField>

<ParamField path="maxResizeLines" type="int?" default="20">
  Maximum number of lines when manually resized. Set to null for unlimited resizing.
</ParamField>

<ParamField path="showResizeHandle" type="bool" default="true">
  Whether to show the resize handle for manual height adjustment.

  <Tip>Double-tap the resize handle to reset to auto-sizing mode.</Tip>
</ParamField>

### Behavior

<ParamField path="onChanged" type="ValueChanged<String>?">
  Callback triggered when the text content changes.
</ParamField>

<ParamField path="onSubmitted" type="ValueChanged<String>?">
  Callback triggered when text is submitted via keyboard shortcuts.
</ParamField>

<ParamField path="onBlur" type="VoidCallback">
  Callback function called when the text area loses focus. Useful for explicit blur event handling.
</ParamField>

<ParamField path="submitOnEnter" type="bool" default="false">
  Controls keyboard submission behavior:

  * `true`: Enter submits, Shift+Enter adds new line (chat-style)
  * `false`: Cmd/Ctrl+Enter submits, Enter adds new line (editor-style)
</ParamField>

<ParamField path="maintainFocusOnSubmit" type="bool" default="false">
  Whether to keep focus on the text area after submission.
</ParamField>

### State

<ParamField path="isEnabled" type="bool" default="true">
  Controls whether the text area is interactive. When disabled, the field appears dimmed and prevents all interaction.
</ParamField>

<ParamField path="focusNode" type="FocusNode?">
  Optional focus node for advanced focus management. If not provided, an internal focus node is created.
</ParamField>

## Best Practices

* **Use appropriate line limits**: Set `minLines` and `maxLines` based on expected content length
* **Use chat-style submission for messaging**: Set `submitOnEnter: true` with `maintainFocusOnSubmit: true` for chat interfaces. You would also probably want to set `minLines` to `1`.
