다른 컴포넌트 보기

COMPONENT / 폼과 입력

FormField

설명과 오류를 함께 보여주는 필드.

LIVE PREVIEWWEB
업데이트를 보내드릴게요.
PLAYGROUND미리보기 안의 요소를 직접 조작해 보세요.

사용 코드

import { useId } from 'react';
import * as W from 'woosign-system';

// ThemeProvider와 ToastProvider 안에서 렌더링하세요.
export function Example() {
  const id = useId();
  return (
    <W.FormField
      id={id}
      label="이메일"
      description="업데이트를 보내드릴게요."
      required
    >
      {(props) => (
        <W.Input
          id={props.id}
          required={props.required}
          placeholder="hello@example.com"
          inputProps={{ 'aria-describedby': props['aria-describedby'] }}
        />
      )}
    </W.FormField>
  );
}
PropType필수
idstring●
labelstring●
descriptionstring—
errorstring—
requiredboolean—
disabledboolean—
children(props: FormFieldInputProps) => ReactNode●

공통 API 기준입니다. 플랫폼별 style, className 및 세부 타입은 타입 정의에서 확인하세요.

← 전체 컴포넌트로 돌아가기