React

Text Field Textarea

여러 줄의 긴 텍스트를 입력받고 자동으로 높이를 조절하는 컴포넌트입니다.

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
defaultValue?string | undefined
name?string | undefined
value?string | undefined

TextFieldTextarea

Prop

Type

Examples

State

Enabled

Disabled

Read Only

Size

size로 TextField의 크기를 정합니다. (default: large)

responsive는 화면 너비에 따라 size가 자동으로 전환되는 값입니다. 여러 화면 너비를 함께 지원하는 제품에서 size=responsive를 사용하여 대응합니다.

Sizing

<TextFieldTextarea>height 관련 스타일을 직접 지정하여 높이를 고정하거나 최소/최대 높이를 설정할 수 있습니다.

Fixed Height

Auto Height with Constraints

Customizable Parts

Indicator

indicator 또는 showRequiredIndicator prop을 사용할 수 있습니다.

Grapheme Count

자소 단위로 쪼개진 value에 관한 정보를 onValueChange 콜백에서 graphemesslicedGraphemes로 제공합니다.

자소 분리는 unicode-segmenter를 통해 이루어집니다.

Use Cases

Form (Uncontrolled)

React Hook Form

Formatting

Slicing

Last updated on

On this page