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}
61import { Textarea } from '@devup-ui/components'
2
3export default function Default() {
4 return <Textarea placeholder="Enter your message..." />
5}
6Error
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}
121import { 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}
12Disabled 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}
121import { 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}
12Colors 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}
181import { 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}
18API
Textarea props는 textarea HTML 속성을 확장합니다.
| 속성 | 설명 | 타입 | 기본값 |
|---|---|---|---|
| typography | textarea에 적용할 타이포그래피 토큰 |
|
|
| error | textarea의 유효하지 않은 상태 여부 |
|
|
| errorMessage |
|
|
|
| rows | 표시할 텍스트 행 수 |
|
|
| classNames | 내부 요소에 적용할 사용자 정의 클래스 이름 |
|
|
| colors | textarea의 사용자 정의 색상 변수 |
|
|