FormField | CoUI

FormField

라벨·에러·설명을 가진 폼 필드 래퍼 — Form 이 내부적으로 사용하는 통일 컴포넌트

FormField#

라벨 행(필수 표시 포함) · 입력 child · 그 아래 description 또는 error 를 세로로 쌓는 폼 필드 래퍼입니다. Form 컴포넌트가 내부적으로 각 필드를 이 위젯으로 감쌉니다. Gap 간격은 CoreFormFieldStyle 의 nested CoreGapStyle 슬롯으로 흐릅니다. Flutter / Web 1:1 동일 API 입니다.

Live Preview#

Web

회사 이메일을 입력하세요.

Flutter
Loading Flutter...
class FormFieldDefaultExample extends StatelessComponent {
  const FormFieldDefaultExample({super.key});

  @override
  Component build(BuildContext context) {
    return div(
      styles: Styles(raw: {'width': '320px'}),
      [
        FormField(
          label: '이메일',
          description: '회사 이메일을 입력하세요.',
          required: true,
          child: TextField(placeholder: Text('you@company.com')),
        ),
      ],
    );
  }
}
class FormFieldDefaultExample extends StatelessWidget {
  const FormFieldDefaultExample({super.key});

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      width: 320,
      child: FormField(
        label: '이메일',
        description: '회사 이메일을 입력하세요.',
        required: true,
        child: TextField(placeholder: const Text('you@company.com')),
      ),
    );
  }
}

사용법#

// Flutter / Web 동일
FormField(
  label: '이메일',
  description: '회사 이메일을 입력하세요.',
  required: true,
  child: TextField(placeholder: const Text('you@company.com')),
)

Props#

파라미터타입기본값설명
labelString?null라벨 텍스트
labelWidget Widget / Component? null 커스텀 라벨 위젯 (label 대신)
child Widget / Component? null 입력 위젯
error String? null 에러 메시지 (있으면 description 대체)
description String? null 보조 설명
required bool false 라벨에 필수 표시
enabledbooltrue활성/비활성 상태
formFieldStyle CoreFormFieldStyle? null 색·간격·타이포 단일 진입점 (labelInputGapStyle 등 nested Gap 슬롯)

FormControl 도 유사한 라벨·에러·설명 래퍼지만, FormFieldForm 컴포넌트의 실제 필드 래퍼입니다.