텍스트 입력 필드

텍스트 입력 필드는 사용자가 키보드로 글자, 숫자, 기호 등이 조합된 한 줄의 짧은 텍스트를 입력하는 경우에 사용하는 요소이다.

텍스트 입력 필드는 사용자가 키보드로 글자, 숫자, 기호 등이 조합된 한 줄의 짧은 텍스트를 입력하는 경우에 사용하는 요소이다.

사용 지침

이름·아이디·검색어 같은 짧은 입력에 사용하고, 라벨·플레이스홀더·오류 메시지·아이콘을 일관된 위치에 배치해 폼 흐름을 예측 가능하게 만듭니다.

예제

Default

도움말

examples/text-input/TextInputDefault.tsx
import { TextInput } from "@/components/ui/dynamic/text-input"
import { FieldHint } from "@/components/ui/dynamic/field-message"

Sizes

도움말

도움말

도움말

examples/text-input/TextInputSizes.tsx
import { TextInput } from "@/components/ui/dynamic/text-input"
import { FieldHint } from "@/components/ui/dynamic/field-message"

States

도움말

성공 메시지
정보 메시지

도움말

도움말

examples/text-input/TextInputStates.tsx
import { TextInput } from "@/components/ui/dynamic/text-input"

export default function TextInputStates() {

With Password Toggle

examples/text-input/TextInputWithPasswordToggle.tsx
import { TextInput } from "@/components/ui/dynamic/text-input"

export default function TextInputWithPasswordToggle() {

With Clear Button

examples/text-input/TextInputWithClearButton.tsx
import { TextInput } from "@/components/ui/dynamic/text-input"

export default function TextInputWithClearButton() {

With Multiple Buttons

examples/text-input/TextInputWithMultipleButtons.tsx
import { TextInput } from "@/components/ui/dynamic/text-input"

export default function TextInputWithMultipleButtons() {

Controlled

현재 값: 제어된 입력

examples/text-input/TextInputControlled.tsx
"use client"

import * as React from "react"

Uncontrolled

비제어 상태로 동작합니다

examples/text-input/TextInputUncontrolled.tsx
import { TextInput } from "@/components/ui/dynamic/text-input"
import { FieldHint } from "@/components/ui/dynamic/field-message"

Without Label

레이블 없이도 사용할 수 있습니다

examples/text-input/TextInputWithoutLabel.tsx
import { TextInput } from "@/components/ui/dynamic/text-input"
import { FieldHint } from "@/components/ui/dynamic/field-message"

Without Hint

examples/text-input/TextInputWithoutHint.tsx
import { TextInput } from "@/components/ui/dynamic/text-input"

export default function TextInputWithoutHint() {

속성

이름타입기본값설명
aria-labelstringDefines a string value that labels the current element. @see aria-labelledby.
classNamestring
defaultValuestring
disabledboolean
errorReactNode
hintReactNode
idstring
informationReactNode
labelstring
onChange((value: string) => void)
onClickMouseEventHandler<HTMLInputElement>
showClearButtonbooleanfalse
showPasswordTogglebooleanfalse
sizeenumlarge
styleCSSProperties
successReactNode
tabIndexnumber
typeHTMLInputTypeAttribute
valuestring