- Prop
label- Type
string | undefined- Default
- —
- Requirement
- optional
- Description
- —
Docs Components Forms
Textarea
React example follows below.
Vue example follows below.
Angular example follows below.
Svelte example follows below.
Solid example follows below.
- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
import { Textarea } from "@grassroot/ui-react"; export default function TextareaDemo() { return ( <div className="flex flex-col gap-3.5"> <Textarea label="Engagement brief" placeholder="Describe the work…" hint="Markdown supported." /> <Textarea label="Summary" showCount maxLength={600} defaultValue="…" /> <Textarea label="Notes" error="Brief is required." /> </div> );}- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
<script setup lang="ts">import { Textarea } from "@grassroot/ui-vue";</script> <template> <div class="flex flex-col gap-3.5"> <Textarea label="Engagement brief" placeholder="Describe the work…" hint="Markdown supported." /> <Textarea label="Summary" show-count :max-length="600" default-value="…" /> <Textarea label="Notes" error="Brief is required." /> </div></template>- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
import { Component } from "@angular/core";import { GrassrootTextarea } from "@grassroot/ui-angular"; @Component({ selector: "app-textarea-demo", standalone: true, imports: [GrassrootTextarea], host: { style: "display: contents" }, template: ` <div class="flex flex-col gap-3.5"> <grassroot-textarea label="Engagement brief" placeholder="Describe the work…" hint="Markdown supported." /> <grassroot-textarea label="Summary" [showCount]="true" [maxLength]="600" defaultValue="…" /> <grassroot-textarea label="Notes" error="Brief is required." /> </div> `,})export class TextareaDemoComponent {} export default TextareaDemoComponent;- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
<script lang="ts"> import { Textarea } from "@grassroot/ui-svelte";</script> <div class="flex flex-col gap-3.5"> <Textarea label="Engagement brief" placeholder="Describe the work…" hint="Markdown supported." /> <Textarea label="Summary" showCount maxLength={600} defaultValue="…" /> <Textarea label="Notes" error="Brief is required." /></div>- parts
- —
- nodes
- —
- size
- —
- part
- —
ts
/** @jsxImportSource solid-js */import { Textarea } from "@grassroot/ui-solid"; export default function TextareaDemo() { return ( <div class="flex flex-col gap-3.5"> <Textarea label="Engagement brief" placeholder="Describe the work…" hint="Markdown supported." /> <Textarea label="Summary" showCount maxLength={600} defaultValue="…" /> <Textarea label="Notes" error="Brief is required." /> </div> );}Installation
API Reference
Import
import { Textarea } from "@grassroot/ui-react";
Props
Prop
Type
Default
Requirement
Description
labelstring | undefined—
optional
—
hintstring | undefined—
optional
—
errorstring | undefined—
optional
—
showCountboolean | undefinedfalseoptional
Show a live "n / maxLength" counter.
- Prop
hint- Type
string | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
error- Type
string | undefined- Default
- —
- Requirement
- optional
- Description
- —
- Prop
showCount- Type
boolean | undefined- Default
false- Requirement
- optional
- Description
- Show a live "n / maxLength" counter.
Native attributes
Standard DOM and ARIA attributes not listed above spread onto the root element.
Import
import { Textarea } from "@grassroot/ui-vue";
Props
Prop
Type
Default
Requirement
modelValuestring | undefined—
optional
defaultValuestring | undefined—
optional
idstring | undefined—
optional
disabledboolean | undefined—
optional
placeholderstring | undefined—
optional
rowsnumber | undefined—
optional
labelstring | undefined—
optional
hintstring | undefined—
optional
errorstring | undefined—
optional
maxLengthnumber | undefined—
optional
showCountboolean | undefined—
optional
requiredboolean | undefined—
optional
- Prop
modelValue- Type
string | undefined- Default
- —
- Requirement
- optional
- Prop
defaultValue- Type
string | undefined- Default
- —
- Requirement
- optional
- Prop
id- Type
string | undefined- Default
- —
- Requirement
- optional
- Prop
disabled- Type
boolean | undefined- Default
- —
- Requirement
- optional
- Prop
placeholder- Type
string | undefined- Default
- —
- Requirement
- optional
- Prop
rows- Type
number | undefined- Default
- —
- Requirement
- optional
- Prop
label- Type
string | undefined- Default
- —
- Requirement
- optional
- Prop
hint- Type
string | undefined- Default
- —
- Requirement
- optional
- Prop
error- Type
string | undefined- Default
- —
- Requirement
- optional
- Prop
maxLength- Type
number | undefined- Default
- —
- Requirement
- optional
- Prop
showCount- Type
boolean | undefined- Default
- —
- Requirement
- optional
- Prop
required- Type
boolean | undefined- Default
- —
- Requirement
- optional
Events
| Event | Payload |
|---|---|
update:modelValue | [value: string] |
Import
import { Component } from "@angular/core";
import { GrassrootTextarea } from "@grassroot/ui-angular";
Props
Prop
Type
Default
Requirement
valuestring—
optional
defaultValuestring—
optional
idstring—
optional
rowsnumber3optional
placeholderstring—
optional
disabledbooleanfalseoptional
readonlybooleanfalseoptional
labelstring—
optional
hintstring—
optional
errorstring—
optional
maxLengthnumber—
optional
showCountbooleanfalseoptional
requiredbooleanfalseoptional
namestring—
optional
- Prop
value- Type
string- Default
- —
- Requirement
- optional
- Prop
defaultValue- Type
string- Default
- —
- Requirement
- optional
- Prop
id- Type
string- Default
- —
- Requirement
- optional
- Prop
rows- Type
number- Default
3- Requirement
- optional
- Prop
placeholder- Type
string- Default
- —
- Requirement
- optional
- Prop
disabled- Type
boolean- Default
false- Requirement
- optional
- Prop
readonly- Type
boolean- Default
false- Requirement
- optional
- Prop
label- Type
string- Default
- —
- Requirement
- optional
- Prop
hint- Type
string- Default
- —
- Requirement
- optional
- Prop
error- Type
string- Default
- —
- Requirement
- optional
- Prop
maxLength- Type
number- Default
- —
- Requirement
- optional
- Prop
showCount- Type
boolean- Default
false- Requirement
- optional
- Prop
required- Type
boolean- Default
false- Requirement
- optional
- Prop
name- Type
string- Default
- —
- Requirement
- optional
- Prop
autocomplete- Type
string- Default
- —
- Requirement
- optional
- Prop
"aria-label"- Type
string- Default
undefined- Requirement
- optional
Events
| Event | Payload |
|---|---|
valueChange | string |
Import
import { Textarea } from "@grassroot/ui-svelte";
Props
Prop
Type
Default
Requirement
valuestring—
optional
defaultValuestring—
optional
idstring—
optional
disabledboolean—
optional
placeholderstring—
optional
rowsnumber—
optional
labelstring—
optional
hintstring—
optional
errorstring—
optional
maxLengthnumber—
optional
showCountbooleanfalseoptional
requiredboolean—
optional
classstring—
optional
classNamestring—
optional
- Prop
value- Type
string- Default
- —
- Requirement
- optional
- Prop
defaultValue- Type
string- Default
- —
- Requirement
- optional
- Prop
id- Type
string- Default
- —
- Requirement
- optional
- Prop
disabled- Type
boolean- Default
- —
- Requirement
- optional
- Prop
placeholder- Type
string- Default
- —
- Requirement
- optional
- Prop
rows- Type
number- Default
- —
- Requirement
- optional
- Prop
label- Type
string- Default
- —
- Requirement
- optional
- Prop
hint- Type
string- Default
- —
- Requirement
- optional
- Prop
error- Type
string- Default
- —
- Requirement
- optional
- Prop
maxLength- Type
number- Default
- —
- Requirement
- optional
- Prop
showCount- Type
boolean- Default
false- Requirement
- optional
- Prop
required- Type
boolean- Default
- —
- Requirement
- optional
- Prop
class- Type
string- Default
- —
- Requirement
- optional
- Prop
className- Type
string- Default
- —
- Requirement
- optional
Import
import { Textarea } from "@grassroot/ui-solid";
Props
Prop
Type
Default
Requirement
valuestring—
optional
defaultValuestring""optional
rowsnumber3optional
maxLengthnumber—
optional
classNamestring—
optional
labelstring—
optional
hintstring—
optional
errorstring—
optional
showCountboolean—
optional
onInputJSX.InputEventHandlerUnion<HTMLTextAreaElement, InputEvent>—
optional
onChangeJSX.ChangeEventHandlerUnion<HTMLTextAreaElement, Event>—
optional
- Prop
value- Type
string- Default
- —
- Requirement
- optional
- Prop
defaultValue- Type
string- Default
""- Requirement
- optional
- Prop
rows- Type
number- Default
3- Requirement
- optional
- Prop
maxLength- Type
number- Default
- —
- Requirement
- optional
- Prop
className- Type
string- Default
- —
- Requirement
- optional
- Prop
label- Type
string- Default
- —
- Requirement
- optional
- Prop
hint- Type
string- Default
- —
- Requirement
- optional
- Prop
error- Type
string- Default
- —
- Requirement
- optional
- Prop
showCount- Type
boolean- Default
- —
- Requirement
- optional
- Prop
onInput- Type
JSX.InputEventHandlerUnion<HTMLTextAreaElement, InputEvent>- Default
- —
- Requirement
- optional
- Prop
onChange- Type
JSX.ChangeEventHandlerUnion<HTMLTextAreaElement, Event>- Default
- —
- Requirement
- optional
Native attributes
Standard DOM and ARIA attributes not listed above spread onto the root element.