Textarea

Textarea

Textarea 컴포넌트는 메시지, 댓글, 설명처럼 여러 줄의 텍스트를 입력할 때 사용합니다.

예제

Default Basic textarea for multi-line user input.

코드 보기
1import { Textarea } from '@devup-ui/components'
2
3export default function Default() {
4    return <Textarea placeholder="Enter your message..." />
5}
6
1import { Textarea } from '@devup-ui/components'
2
3export default function Default() {
4    return <Textarea placeholder="Enter your message..." />
5}
6
Please enter at least 10 characters.

Error Use error and errorMessage to show validation feedback.

코드 보기
1import { Textarea } from '@devup-ui/components'
2
3export default function Error() {
4    return (
5        <Textarea
6            error
7            errorMessage="Please enter at least 10 characters."
8            placeholder="Describe your request..."
9        />
10    )
11}
12
1import { Textarea } from '@devup-ui/components'
2
3export default function Error() {
4    return (
5        <Textarea
6            error
7            errorMessage="Please enter at least 10 characters."
8            placeholder="Describe your request..."
9        />
10    )
11}
12

Disabled Disabled textareas keep the value visible while preventing edits.

코드 보기
1import { Textarea } from '@devup-ui/components'
2
3export default function Disabled() {
4    return (
5        <Textarea
6            defaultValue="This message is read-only."
7            disabled
8            placeholder="Disabled textarea"
9        />
10    )
11}
12
1import { Textarea } from '@devup-ui/components'
2
3export default function Disabled() {
4    return (
5        <Textarea
6            defaultValue="This message is read-only."
7            disabled
8            placeholder="Disabled textarea"
9        />
10    )
11}
12

Colors Override the component color variables to match a custom theme.

코드 보기
1import { Textarea } from '@devup-ui/components'
2
3export default function Colors() {
4    return (
5        <Textarea
6            colors={{
7                primary: '#2563EB',
8                border: '#BFDBFE',
9                background: '#EFF6FF',
10                placeholder: '#60A5FA',
11                focusRing: 'rgba(37, 99, 235, 0.18)',
12            }}
13            placeholder="Custom themed textarea"
14            rows={4}
15        />
16    )
17}
18
1import { Textarea } from '@devup-ui/components'
2
3export default function Colors() {
4    return (
5        <Textarea
6            colors={{
7                primary: '#2563EB',
8                border: '#BFDBFE',
9                background: '#EFF6FF',
10                placeholder: '#60A5FA',
11                focusRing: 'rgba(37, 99, 235, 0.18)',
12            }}
13            placeholder="Custom themed textarea"
14            rows={4}
15        />
16    )
17}
18
API

Textarea props는 textarea HTML 속성을 확장합니다.

속성설명타입기본값
typography

textarea에 적용할 타이포그래피 토큰

keyof DevupThemeTypography

undefined

error

textarea의 유효하지 않은 상태 여부

boolean

false

errorMessage

error가 true일 때 textarea 아래에 표시할 유효성 검사 메시지

string

undefined

rows

표시할 텍스트 행 수

number

3

classNames

내부 요소에 적용할 사용자 정의 클래스 이름

{
container?: string

textarea?: string

errorMessage?: string

}

undefined

colors

textarea의 사용자 정의 색상 변수

{
primary?: string

error?: string

text?: string

border?: string

background?: string

placeholder?: string

focusRing?: string

}

undefined