본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

Field

원문 보기 위키 갱신

Field (필드)

Field 컴포넌트는 입력 요소와 레이블, 도움말 텍스트, 오류 메시지를 함께 묶어 관리할 때 사용합니다.

출처: Park UI

본문

Installation

설치:

import { Field, Input } from '@/components/ui'

Usage

용법:

<Field.Root>
  <Field.Label>
    <Field.RequiredIndicator />
  </Field.Label>
  <Input />
  <Field.HelperText />
  <Field.ErrorText />
</Field.Root>

Examples

예시를 살펴보겠습니다.

Invalid

Field.Root에 invalid prop을 전달하고 Field.ErrorText를 사용하면 필드가 유효하지 않음을 표시할 수 있습니다.

HelperText

Field.HelperText를 사용하면 필드에 도움말 텍스트를 추가할 수 있습니다.

Disabled

disabled prop을 사용하면 필드를 비활성화할 수 있습니다.

Required

Field.Root에 required prop을 전달하고 Field.RequiredIndicator를 사용하면 필드가 필수임을 표시할 수 있습니다.

Closed Component

닫힌 컴포넌트 조합을 위해 필드를 설정하는 방법입니다.

Props

속성(Props)에 대한 자세한 내용은 아래를 참고하세요.

Root

Root 부분에 대한 속성입니다.

RequiredIndicator

RequiredIndicator 부분에 대한 속성입니다.

Textarea

Textarea 부분에 대한 속성입니다.

더 알아보기 (Learn more)