문서 설정 폼
문서 메타데이터와 공개 설정을 하나의 의미 있는 폼 구조로 연결합니다.
- 카테고리
- 폼
- 사용 컴포넌트
fieldinputnative-selectcheckboxswitchalert
실제 미리보기
사용할 때
사용 기준
여러 관련 필드와 즉시 적용 설정을 한 작업으로 편집할 때 사용합니다.
사용하지 않을 때
서로 관계없는 설정을 한 Panel에 모으거나 읽기 전용 요약을 표시할 때는 사용하지 않습니다.
구조
설정 그룹 legend
문서 식별 정보
공개와 고정 설정
저장 상태 피드백
상태
default고정 예시편집 가능한 기본 문서 설정입니다.
invalid고정 예시문제가 있는 필드만 오류 상태와 구체적인 안내를 표시합니다.
disabled고정 예시권한이나 문서 상태로 편집할 수 없는 설정을 명확히 비활성화합니다.
saving고정 예시저장 중에는 중복 제출을 막고 현재 진행 상태를 알립니다.
반응형 동작
작은 화면에서는 가로 필드를 label 다음 입력 순서의 한 열로 바꿉니다.
설명과 오류는 관련 입력 바로 아래에 남깁니다.
접근성
fieldset과 legend로 작업을 이름 붙이고 모든 안내와 오류를 해당 필드에 연결합니다.
사용 예시
import { Checkbox } from "@/components/ui/checkbox"
import {
Field,
FieldGroup,
FieldLabel,
FieldLegend,
FieldSet,
} from "@/components/ui/field"
import { Input } from "@/components/ui/input"
import { NativeSelect } from "@/components/ui/native-select"
import { Switch } from "@/components/ui/switch"
<FieldSet>
<FieldLegend>Document settings</FieldLegend>
<FieldGroup>
<Field>
<FieldLabel>Title</FieldLabel>
<Input />
</Field>
<Field>
<FieldLabel>Category</FieldLabel>
<NativeSelect defaultValue="notice">
<option value="notice">Notice</option>
<option value="disclosure">Disclosure</option>
</NativeSelect>
</Field>
<Checkbox label="Pin document" />
<Switch label="Publish immediately" />
</FieldGroup>
</FieldSet>관련 문서
소스 경로
components/design-system/recipes/document-settings-form-demo.tsx소스 보기