InputField

Form Controls

폼 값에 연결된 한 줄 텍스트 입력 필드.

미리보기 없음

form.AppField 안의 field.InputField로 연결하는 필드다. 독립 미리보기 대신 폼 연동 예제에서 값·검증·제출 조합을 확인한다.

용도

폼에 연결된 한 줄 텍스트 입력

필수 조건: form.AppField 안에서 field.InputField로 사용한다. 폼 컨텍스트 없이 독립 렌더링하지 않는다. 조립 방법은 section:Field/form-architecture.

참고: 폼에서 여러 필드를 세로로 쌓을 때는 fullWidth로 폭을 맞춘다. 기본 폭은 내용 폭이라 TextAreaField·라디오 그룹처럼 꽉 차는 필드와 폭이 달라진다.

import

import

import { InputField } from '@mildang/design-system/InputField';

API 참조

InputField Props

PropTypeDefault설명
autoComplete

string

-특히 모바일에서 사용자가 폼을 더 빠르게 채우도록 돕는 속성. 이름과 달리 실제로는 자동완성(autofill)에 가까움. 자세한 내용은 [스펙](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill) 참고.
autoFocus

boolean

-true면 첫 마운트 시 input 엘리먼트에 포커스가 감.
defaultValue

string | number | readonly string[]

-처음 값 (비제어 컴포넌트).
description

ReactNode

-라벨 아래에 표시되는 보조 설명. 컨트롤 아래에 붙는 도움말(helperText)과는 다른 자리.
disabled

boolean

-비활성화 상태. 조작을 받지 않고 흐리게 표시됨.
endAdornment

ReactNode

-input 뒤(오른쪽)에 붙는 보조 요소 (아이콘 등).
error

boolean

-에러 상태. true면 테두리·헬퍼텍스트가 에러 톤으로 표시됨.
fullWidth

boolean

-true면 너비를 100%로 채움.
ghost

boolean

false컨테이너의 배경과 테두리를 비워 입력만 남긴 형태.
helperText

ReactNode

-컨트롤 아래에 표시되는 도움말. error/warning/success 상태 톤을 따라감.
hideHelperText

boolean

-true면 helperText를 렌더하지 않는다(공간만 필요 없을 때).
inputContainerClassName

string

-input을 감싸는 내부 컨테이너 엘리먼트에 붙는 className.
inputElementClassName

string

-실제 <input> DOM 엘리먼트에 붙일 className. 감싸는 요소가 아니라 입력 요소 자체에 스타일을 줄 때 사용.
inputMode

"search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal"

-모바일에서 띄울 가상 키보드 종류.
label

ReactNode

-필드 라벨.
max

string | number

-허용하는 가장 큰 값.
maxLength

number

-입력할 수 있는 최대 글자 수.
min

string | number

-허용하는 가장 작은 값.
minLength

number

-입력해야 하는 최소 글자 수.
multiple

boolean

-true면 input 엘리먼트가 여러 값을 가질 수 있음.
name

string

-input 엘리먼트의 name 속성.
onBlur

FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>

-input이 blur 될 때 호출되는 콜백. 첫 번째 인자(event)는 undefined 일 수도 있음.
onChange

ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>

-값이 바뀔 때 호출되는 콜백. @param event 콜백의 이벤트 소스. event.target.value(문자열)로 새 값을 꺼낼 수 있음.
onFocus

FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>

-input이 포커스를 받았을 때 호출되는 콜백.
onInvalid

FormEventHandler<HTMLInputElement | HTMLTextAreaElement>

-네이티브 유효성 검사(required, pattern 등)에 실패했을 때 호출되는 콜백.
onKeyDown

KeyboardEventHandler<HTMLInputElement | HTMLTextAreaElement>

-키를 누르는 동안 호출되는 콜백.
onKeyUp

KeyboardEventHandler<HTMLInputElement | HTMLTextAreaElement>

-누른 키에서 손을 뗄 때 호출되는 콜백.
outEndAdornment

ReactNode

-컨트롤 바깥(오른쪽)에 나란히 배치되는 보조 요소. 예: 인증번호 입력의 "전송" 버튼.
placeholder

string

-값이 없을 때 보이는 안내 문구.
readOnly

boolean

-true 면 값을 볼 수 있지만 고칠 수 없음.
required

boolean

-필수 입력 여부. true면 라벨에 필수 표시가 붙음.
sideContent

ReactNode

-라벨 옆에 붙는 보조 콘텐츠. 예: 중복확인 버튼/링크.
size

"xs" | "sm" | "md" | "lg" | "xl"

md입력창 최소 높이·글자 크기·좌우 아이콘 크기를 함께 정하는 5단계(xs~xl) 스케일.
startAdornment

ReactNode

-input 앞(왼쪽)에 붙는 보조 요소 (아이콘 등).
step

string | number

-값이 한 번에 바뀌는 단위.
success

boolean

-성공 상태. true면 테두리·헬퍼텍스트가 성공 톤으로 표시됨.
type

HTMLInputTypeAttribute

-입력 종류 (text·number·password 등).
value

string

-입력 값. controlled 로 쓸 때 onChange와 함께 사용.
warning

boolean

-경고 상태. true면 테두리·헬퍼텍스트가 경고 톤으로 표시됨.
className

string

-루트 요소에 추가되는 className.
style

CSSProperties

-루트 요소에 병합되는 인라인 스타일.

관련 컴포넌트

같은 @mildang/design-system/InputField 에서 함께 제공되는 컴포넌트입니다.

예제

폼 연결

form.AppField 안에서 field.InputField 로 이름을 입력받는다. 검증에 실패하면 helperText 자리에 에러 메시지가 뜬다.

여러 필드 조합

여러 InputField를 한 폼 안에 조합한 예시다.

native input 속성 전달

maxLength·inputMode 같은 native <input> 속성이 field.InputField 를 통해 실제 DOM 까지 전달된다.