프리뷰 또는 이전 버전의 문서를 보고 있습니다.seed-design.io 방문
우리는 왜 디자인 엔지니어를 찾게 됐을까
Skip to Content
Lynx

Text Field Input

한 줄 텍스트를 입력받고 Field의 레이블·설명·오류 상태와 조합하는 컴포넌트입니다.

Engine ≥ 3.6<input>
사용 가능 버전@seed-design/[email protected], @seed-design/[email protected]
Lynx 예제를 불러오는 중입니다.

Lynx의 TextFieldInput은 React의 autoFocus prop을 지원하지 않습니다. 처음부터 focus해야 한다면 입력에 id를 지정하고, 화면이 준비된 뒤 Lynx native input의 focus UI method를 호출하세요.

Installation

npx @seed-design/cli@latest add ui:text-field

Props

TextField

Prop

Type

children?React.ReactNode
label?React.ReactNode
labelWeight?"bold" | "medium" | undefined
indicator?React.ReactNode
prefixIcon?React.ReactElement<LynxIconElementProps, string | React.JSXElementConstructor<any>> | undefined
prefix?React.ReactNode
suffixIcon?React.ReactElement<LynxIconElementProps, string | React.JSXElementConstructor<any>> | undefined
suffix?React.ReactNode
description?React.ReactNode
errorMessage?React.ReactNode
hideCharacterCount?boolean | undefined
maxGraphemeCount?number | undefined
showRequiredIndicator?boolean | undefined
fieldRef?React.Ref<NodesRef> | undefined
onValueChange?((values: { value: string; graphemes: string[]; slicedValue: string; slicedGraphemes: string[]; }) => void) | undefined
value?string | undefined
defaultValue?string | undefined

Default

""

required?boolean | undefined

FieldRoot 안에서 생략하면 Field 값을 따릅니다.

Default

false

name?string | undefined

입력 파트의 native name으로 전달됩니다.

variant?"outline" | "underline" | undefined

Default

"outline"

size?"large" | "medium" | undefined

Default

"large"

invalid?boolean | undefined

Default

false

readOnly?boolean | undefined

Default

false

disabled?boolean | undefined

Default

false

TextFieldInput

Prop

Type

show-soft-input-on-focus?boolean | undefined

포커스할 때 시스템 키보드를 표시한다. undefined가 native attribute로 전달되지 않도록 true를 명시적으로 적용한다.

Default

true

android-set-soft-input-mode?AndroidSetSoftInputMode | undefined

Android host window의 soft input mode를 지정한다. 생략하면 KeyboardAvoidingScrollView 안에서는 컴포넌트가 키보드 회피를 맡도록 "nothing"을, 그 밖에서는 "unspecified"를 명시적으로 적용한다.

Default

KeyboardAvoidingScrollView 안에서 "nothing", 그 밖에서 "unspecified"

Examples

State

Enabled

Lynx 예제를 불러오는 중입니다.

Disabled

Lynx 예제를 불러오는 중입니다.

Read Only

Lynx 예제를 불러오는 중입니다.

Size

size로 TextField의 크기를 정합니다. 기본값은 large입니다.

Lynx에서는 large와 medium을 지원합니다. CSS viewport breakpoint가 없어 responsive는 지원하지 않습니다.

Lynx 예제를 불러오는 중입니다.

Customizable Parts

아이콘만으로 맥락을 전달할 때는 description 또는 label에 아이콘의 의미를 설명하는 텍스트를 포함하세요. 아이콘 자체를 읽어야 한다면 accessibility-label을 지정하세요.

Prefix

Lynx 예제를 불러오는 중입니다.

Suffix

Lynx 예제를 불러오는 중입니다.

Both Affixes

Lynx 예제를 불러오는 중입니다.

Indicator

indicator 또는 showRequiredIndicator prop을 사용할 수 있습니다.

Lynx 예제를 불러오는 중입니다.

Grapheme Count

Lynx 예제를 불러오는 중입니다.

value를 사용자 인식 문자(grapheme cluster) 단위로 나눈 결과를 onValueChange 콜백의 graphemes와 slicedGraphemes로 제공합니다.

Lynx 예제를 불러오는 중입니다.

Use Cases

Controlled State

Lynx는 HTML Form을 지원하지 않습니다. value와 onValueChange를 사용해 입력값을 React state로 관리할 수 있습니다.

Lynx 예제를 불러오는 중입니다.

Number Formatting

Lynx 예제를 불러오는 중입니다.

Slicing

Lynx 예제를 불러오는 중입니다.

Lynx Usage

Tap to Focus

입력 영역의 여백·prefix·suffix를 포함해 어디를 탭해도 TextFieldInput이 focus됩니다. disabled·readOnly 상태에서는 focus하지 않습니다. 다른 입력이 focus된 상태에서 탭해도 키보드가 내려가지 않도록 입력 영역에는 ignore-focus를, TextFieldInput에는 ignore-focus={false}를 기본으로 적용합니다. 다른 동작이 필요하면 각 값을 직접 지정하세요.

Keyboard Avoidance

KeyboardAvoidingScrollView.Content 안에 배치하면 TextFieldInput이 focus될 때 자동으로 등록되어 키보드에 가려지지 않는 위치로 스크롤됩니다. KeyboardAvoidingScrollView.Footer 안에 배치하면 Footer와 함께 키보드 위로 올라가므로 스크롤하지 않습니다.

import { KeyboardAvoidingScrollView } from "@seed-design/lynx-react";
import { TextField, TextFieldInput } from "@/components/ui/text-field";

export function KeyboardAwareFields() {
  return (
    <KeyboardAvoidingScrollView.Root className="screen-body">
      <KeyboardAvoidingScrollView.Content>
        <TextField label="제목">
          <TextFieldInput accessibility-label="제목" />
        </TextField>
      </KeyboardAvoidingScrollView.Content>
    </KeyboardAvoidingScrollView.Root>
  );
}

Web Version Differences

  • 편집 가능한 상태에서는 HTML <input> 대신 Lynx native <input>을 렌더링합니다.
  • readOnly 상태에서는 focus, selection, 잘라내기 메뉴가 없는 <text>를 렌더링합니다. 이때 ref는 <text>를 가리키므로 input 전용 UI method와 이벤트를 사용할 수 없습니다.
  • onChange 대신 TextField의 onValueChange를 사용합니다. native bindinput은 TextFieldInput에 직접 전달할 수 있습니다.
  • DOM id로 label을 연결하지 않으므로 입력에 accessibility-label을 직접 지정하세요.
  • show-soft-input-on-focus의 기본값은 true입니다. 커스텀 키보드를 사용한다면 false로 지정하세요.
  • android-set-soft-input-mode는 host window 전체에 영향을 줍니다. 생략하면 Keyboard Avoiding Scroll View 안에서는 "nothing", 그 밖에서는 "unspecified"를 적용합니다. 값은 입력이 화면에 붙을 때 window에 적용되고 마지막에 붙은 입력의 값이 남으므로, 같은 window의 입력에는 같은 값을 사용하세요.

Unsupported Lynx Features

  • HTML form submit, browser validation, React Hook Form, aria-describedby id 연결은 지원하지 않습니다.

Last updated on 2026. 12. 3.