Inputs
TextField
label · helper · error · slot을 포함한 텍스트 입력.
단일 줄 텍스트 입력. 라벨은 useId로 자동 연결되어 접근성 보장, 좌우 슬롯으로 아이콘·키바인딩 힌트 추가 가능.
import { TextField } from "@nxtgen-org/react";
Basic
With label & helper
실명을 입력해주세요.
tsx
<TextFieldlabel="이름"placeholder="홍길동"helper="실명을 입력해주세요."required/>
Error state
올바른 이메일 형식이 아닙니다.
tsx
<TextFieldlabel="이메일"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
| Name | Type | Default | Description |
|---|---|---|---|
| label | string | — | 라벨 텍스트. |
| helper | string | — | 보조 설명. |
| error | string | — | 에러 메시지. 있으면 invalid 스타일. |
| leftSlot | ReactNode | — | input 좌측 (아이콘 등). |
| rightSlot | ReactNode | — | input 우측 (키 힌트 등). |
| size | "sm" | "md" | "lg" | "md" | — |
| required | boolean | — | 라벨에 * 표시. |
| ...props | InputHTMLAttributes<HTMLInputElement> | — | 표준 input 속성. |