Docs Components Forms

Textarea

React example follows below.
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>
);
}
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>
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;
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>
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
label
string | undefined
—
optional
—
hint
string | undefined
—
optional
—
error
string | undefined
—
optional
—
showCount
boolean | undefined
false
optional
Show a live "n / maxLength" counter.
Prop
label
Type
string | undefined
Default
—
Requirement
optional
Description
—
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
modelValue
string | undefined
—
optional
defaultValue
string | undefined
—
optional
id
string | undefined
—
optional
disabled
boolean | undefined
—
optional
placeholder
string | undefined
—
optional
rows
number | undefined
—
optional
label
string | undefined
—
optional
hint
string | undefined
—
optional
error
string | undefined
—
optional
maxLength
number | undefined
—
optional
showCount
boolean | undefined
—
optional
required
boolean | 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

EventPayload
update:modelValue[value: string]

Import

import { Component } from "@angular/core";
import { GrassrootTextarea } from "@grassroot/ui-angular";

Props

Prop
Type
Default
Requirement
value
string
—
optional
defaultValue
string
—
optional
id
string
—
optional
rows
number
3
optional
placeholder
string
—
optional
disabled
boolean
false
optional
readonly
boolean
false
optional
label
string
—
optional
hint
string
—
optional
error
string
—
optional
maxLength
number
—
optional
showCount
boolean
false
optional
required
boolean
false
optional
name
string
—
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

EventPayload
valueChangestring

Import

import { Textarea } from "@grassroot/ui-svelte";

Props

Prop
Type
Default
Requirement
value
string
—
optional
defaultValue
string
—
optional
id
string
—
optional
disabled
boolean
—
optional
placeholder
string
—
optional
rows
number
—
optional
label
string
—
optional
hint
string
—
optional
error
string
—
optional
maxLength
number
—
optional
showCount
boolean
false
optional
required
boolean
—
optional
class
string
—
optional
className
string
—
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
value
string
—
optional
defaultValue
string
""
optional
rows
number
3
optional
maxLength
number
—
optional
className
string
—
optional
label
string
—
optional
hint
string
—
optional
error
string
—
optional
showCount
boolean
—
optional
onInput
JSX.InputEventHandlerUnion<HTMLTextAreaElement, InputEvent>
—
optional
onChange
JSX.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.