React

Text Field Textarea

A component for entering multi-line text that automatically adjusts height.

Available since@seed-design/react@1.1.0, @seed-design/css@1.1.0

Installation

npx @seed-design/cli@latest add ui:text-field

Props

TextField

Prop

Type

label?React.ReactNode
indicator?React.ReactNode
prefixIcon?React.ReactNode
prefix?React.ReactNode
suffixIcon?React.ReactNode
suffix?React.ReactNode
description?React.ReactNode
errorMessage?React.ReactNode
hideCharacterCount?boolean | undefined
maxGraphemeCount?number | undefined
showRequiredIndicator?boolean | undefined
fieldRef?React.Ref<HTMLDivElement> | undefined
onValueChange?((values: { value: string; graphemes: string[]; slicedValue: string; slicedGraphemes: string[]; }) => void) | undefined
value?string | undefined
defaultValue?string | undefined
name?string | undefined

TextFieldTextarea

Prop

Type

Examples

State

Enabled

Disabled

Read Only

Size

Use size to set the TextField's size. (default: large)

responsive automatically switches the size based on screen width. Use size=responsive to support multiple screen widths in products that need to support various screen sizes.

Sizing

You can fix the height or set minimum/maximum height by directly specifying height-related styles on <TextFieldTextarea>.

Fixed Height

Auto Height with Constraints

Customizable Parts

Indicator

You can use either the indicator or showRequiredIndicator prop.

Grapheme Count

Information about the value split by grapheme units is provided in the onValueChange callback as graphemes and slicedGraphemes.

Grapheme segmentation is performed through unicode-segmenter.

Use Cases

Form (Uncontrolled)

React Hook Form

Formatting

Slicing

Table of contents