Inputs

TextField

label · helper · error · slot을 포함한 텍스트 입력.

단일 줄 텍스트 입력. 라벨은 useId로 자동 연결되어 접근성 보장, 좌우 슬롯으로 아이콘·키바인딩 힌트 추가 가능.

import { TextField } from "@nxtgen-org/react";

Basic

With label & helper

실명을 입력해주세요.

tsx
<TextField
label="이름"
placeholder="홍길동"
helper="실명을 입력해주세요."
required
/>

Error state

올바른 이메일 형식이 아닙니다.

tsx
<TextField
label="이메일"
value={email}
error={invalid ? "올바른 이메일 형식이 아닙니다." : undefined}
onChange={(e) => setEmail(e.target.value)}
/>

Sizes

sm / md / lg

tsx
<TextField size="sm" />
<TextField size="md" />
<TextField size="lg" />

Slots

Left / Right slot

⌘K
tsx
<TextField leftSlot={<Search size={16} />} placeholder="검색" />
<TextField rightSlot={<kbd>⌘K</kbd>} placeholder="검색" />

API

NameTypeDefaultDescription
labelstring라벨 텍스트.
helperstring보조 설명.
errorstring에러 메시지. 있으면 invalid 스타일.
leftSlotReactNodeinput 좌측 (아이콘 등).
rightSlotReactNodeinput 우측 (키 힌트 등).
size"sm" | "md" | "lg""md"
requiredboolean라벨에 * 표시.
...propsInputHTMLAttributes<HTMLInputElement>표준 input 속성.