# Textarea Textareas support longer-form text entry with helper messaging, counters, and validation states. **Category:** Components **Storybook:** https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-textarea--introduction ## Variants documented in Storybook - DefaultField: https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-textarea--defaultfield - ValidationStates: https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-textarea--validationstates ## Framework setup ### HTML / CDN ```html ``` ### React ```bash npm install ux4g-web-components ``` ```jsx import 'ux4g-web-components/styles.css'; import 'ux4g-web-components/design-system'; ``` ### Angular Update `angular.json`: ```json { "styles": [ "node_modules/ux4g-web-components/styles/ux4g.css", "src/styles.css" ], "scripts": [ "node_modules/ux4g-web-components/dist/runtime/design-system.js" ] } ``` ## Code examples The snippets below are extracted from the Storybook canvas for Textarea. Each example shows the rendered HTML, the equivalent React JSX, and the Angular template markup. ### 1. Default Field — Default Textarea HTML: ```html
Textareas support longer-form text entry with counters, helper messaging, and validation feedback using the UX4G design system.
Source-backed medium textarea markup with helper text and a live character counter.
Quickly copy source-backed utility classes for textarea structure, sizes, and states.
|
Textarea Container
ux4g-textarea-container
|
|
Field Shell
ux4g-textarea
|
|
Native Textarea
ux4g-textarea-input
|
|
Character Counter
ux4g-textarea-counter
|
|
Helper Message
ux4g-textarea-helper
|
|
Default State
ux4g-textarea-default
|
|
Error State
ux4g-textarea-error
|
|
Success State
ux4g-textarea-success
|
|
Warning State
ux4g-textarea-warning
|
|
Disabled State
ux4g-textarea-is-disabled
|
|
Small Size
ux4g-textarea-sm
|
|
Medium Size
ux4g-textarea-md
|
|
Large Size
ux4g-textarea-lg
|
Textareas support longer-form text entry with counters, helper messaging, and validation feedback using the UX4G design system.
Source-backed medium textarea markup with helper text and a live character counter.
Quickly copy source-backed utility classes for textarea structure, sizes, and states.
|
Textarea Container
ux4g-textarea-container
|
|
Field Shell
ux4g-textarea
|
|
Native Textarea
ux4g-textarea-input
|
|
Character Counter
ux4g-textarea-counter
|
|
Helper Message
ux4g-textarea-helper
|
|
Default State
ux4g-textarea-default
|
|
Error State
ux4g-textarea-error
|
|
Success State
ux4g-textarea-success
|
|
Warning State
ux4g-textarea-warning
|
|
Disabled State
ux4g-textarea-is-disabled
|
|
Small Size
ux4g-textarea-sm
|
|
Medium Size
ux4g-textarea-md
|
|
Large Size
ux4g-textarea-lg
|
Textareas support longer-form text entry with counters, helper messaging, and validation feedback using the UX4G design system.
Source-backed medium textarea markup with helper text and a live character counter.
Quickly copy source-backed utility classes for textarea structure, sizes, and states.
|
Textarea Container
ux4g-textarea-container
|
|
Field Shell
ux4g-textarea
|
|
Native Textarea
ux4g-textarea-input
|
|
Character Counter
ux4g-textarea-counter
|
|
Helper Message
ux4g-textarea-helper
|
|
Default State
ux4g-textarea-default
|
|
Error State
ux4g-textarea-error
|
|
Success State
ux4g-textarea-success
|
|
Warning State
ux4g-textarea-warning
|
|
Disabled State
ux4g-textarea-is-disabled
|
|
Small Size
ux4g-textarea-sm
|
|
Medium Size
ux4g-textarea-md
|
|
Large Size
ux4g-textarea-lg
|