Agriculture Design System
Beta
Design System for the Export Service

Textarea

A text area lets users enter long-form, plain text over multiple lines and is commonly found in forms.

View in FigmaView in StorybookView in Github
import { ... } from '@ag.ds-next/react/textarea';

Usage

Textarea components can be imported via the textarea entrypoint in the @ag.ds-next/react package.

For example:

import { ... } from '@ag.ds-next/react/textarea';

Props

Textarea Props
PropTypeDescription
labelstring
Describes the purpose of the field.
autoFocus?boolean
block?boolean
If true, the field will stretch to the fill the width of its container.
disabled?boolean
hideOptionalLabel?boolean
If true, "(optional)" will never be appended to the label.
hint?string
Provides extra information about the field.
id?string
inputMode?"numeric" | "none" | "text" | "tel" | "url" | "email" | "decimal" | "search"
invalid?boolean
If true, the invalid state will be rendered.
maxWidth?"md" | "lg" | "xl"Default: "md"
The maximum width of the field.
message?string
Message to show when the field is invalid.
name?string
onBlur?FocusEventHandler<HTMLTextAreaElement>
onChange?ChangeEventHandler<HTMLTextAreaElement>
onFocus?FocusEventHandler<HTMLTextAreaElement>
placeholder?string
ref?Ref<HTMLTextAreaElement>
required?boolean
If false, "(optional)" will be appended to the label.
rows?number
value?string | number | readonly string[]

Source

You can view the full source code for this package on Github.