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

React Deprecated

원문 보기 위키 갱신

Wizard는 여러 단계로 나누어 사용자를 안내하는 컴포넌트예요. 단계 구성, 비활성 단계, 펼칠 수 있는 단계, 완료 상태, 폼 검증, 드로어 등을 지원해요.

출처: 문서

본문

경고 알림: 사용 중단(Deprecated) 기능입니다. 이 컴포넌트 구현은 더 나은 솔루션으로 대체되어 사용 중단 처리되었고, 더 이상 유지·개선되지 않아요. 사용 중단된 컴포넌트에 대해 더 알아보려면 PatternFly 소개를 방문해 주세요.

더 많은 합성(composition)을 허용하는 wizard 솔루션을 찾고 있다면 React 탭을 참고해 주세요.

예시 (Examples)

기본 (Basic)

이 단계의 콘텐츠는 넘쳐서 스크롤바를 만들며, tabindex="0", role="region", 그리고 aria-label 또는 aria-labelledby가 적용됩니다.

  • Lorem ipsum … (예시 본문 텍스트)

비활성 단계가 있는 기본 (Basic with disabled steps)

  • Step 1 content

네비게이션 항목용 앵커 (Anchors for nav items)

점진적으로 활성화되는 단계 (Incrementally enabled steps)

  • Step 1 content

펼칠 수 있는 단계 (Expandable steps)

  • Substep A content

완료 (Finished)

  • Step 1 content

폼 검증 시 활성화 (Enabled on form validation)

  • Step 1 content

버튼 누름 시 검증 (Validate on button press)

이 예시는 WizardContextConsumer를 사용해 WizardContext를 소비하는 방법을 보여줘요. WizardContext를 사용하면 특정 wizard 단계로 명령적으로 이동할 수 있어요. WizardContext의 정의는 다음과 같아요:

interface WizardContext {
  goToStepById: (stepId: number | string) => void;
  goToStepByName: (stepName: string) => void;
  onNext: () => void;
  onBack: () => void;
  onClose: () => void;
  activeStep: WizardStep;
}
  • Step 1 content

점진적 단계 (Progressive steps)

  • Create a new thing
  • Update an existing thing

현재 단계 가져오기 (Get current step)

  • Step 1 content

모달 안의 Wizard (Wizard in modal)

서랍이 있는 Wizard (Wizard with drawer)

  • Information step content

속성 (Props)

Wizard

*필수(required)

이름(name) 타입(Type) 기본값(Default) 설명(Description)
steps *필수 WizardStep[] wizard 단계 구성 객체입니다.
appendTo HTMLElement | (() => HTMLElement) null 모달을 추가할 부모 컨테이너입니다. 기본값은 document.body입니다.
backButtonText React.ReactNode 'Back' (푸터를 제어하면 사용되지 않음) Back 버튼 텍스트입니다.
cancelButtonText React.ReactNode 'Cancel' (푸터를 제어하면 사용되지 않음) Cancel 버튼 텍스트입니다.
className string '' Wizard에 펼쳐지는 추가 클래스입니다.
closeButtonAriaLabel string 'Close' (푸터를 제어하면 사용되지 않음) 닫기 버튼의 aria-label입니다.
description React.ReactNode '' wizard 설명입니다.
descriptionComponent 'div' | 'p' 'p' 설명의 컴포넌트 타입입니다.
descriptionId string 설명의 선택적 id입니다.
footer React.ReactNode null (푸터를 제어하려면 사용) 푸터 컴포넌트를 전달하면 버튼을 직접 제어할 수 있습니다.
hasDrawer boolean false wizard에 단계 중 적어도 하나에 대한 드로어가 있는지 나타내는 플래그입니다.
hasNoBodyPadding boolean false true로 설정하면 메인 본문 콘텐츠 주변의 기본 패딩을 제거할 수 있습니다.
height number | string null wizard의 커스텀 높이입니다.
hideClose boolean false 닫기 버튼이 헤더에 있어야 하는지 나타내는 플래그입니다.
isDrawerExpanded boolean false wizard 드로어가 펼쳐졌는지 나타내는 플래그입니다.
isNavExpandable boolean false 하위 단계가 있는 nav 항목이 펼칠 수 있는지 나타내는 플래그입니다.
isOpen boolean undefined Wizard 모달이 열려 있는지 나타내는 플래그입니다. 이 prop이 제공되면 Wizard가 모달 안에 배치됩니다.
mainAriaLabel string null 본문 콘텐츠가 넘쳐서 스크롤바를 렌더링할 때 wizard 본문에 접근 가능한 이름을 추가합니다.
mainAriaLabelledBy string null 하나 이상의 요소 id를 전달해서 wizard 본문에 접근 가능한 이름을 추가합니다. aria-labelledby는 본문 콘텐츠가 넘쳐서 스크롤바를 렌더링할 때만 적용됩니다.
navAriaLabel string null Nav의 aria-label입니다.
navAriaLabelledBy string null nav 요소에 aria-labelledby를 설정합니다.
nextButtonText React.ReactNode 'Next' (푸터를 제어하면 사용되지 않음) Next 버튼 텍스트입니다.
onBack (newStep: { id?: string | number; name: React.ReactNode }, prevStep: { prevId?: string | number; prevName: React.ReactNode }) => void null (푸터를 제어하면 사용되지 않음) Back 버튼을 클릭한 후의 콜백 함수입니다.
onClose () => void () => undefined as any wizard를 닫는 콜백 함수입니다.
onCurrentStepChanged (step: WizardStep) => void wizard의 현재 단계를 알리는 콜백 함수입니다.
onExpandDrawer () => void () => undefined as any 드로어가 토글될 때의 콜백 함수입니다. 드로어에 브라우저 포커스를 설정하는 데 사용할 수 있습니다.
onGoToStep (newStep: { id?: string | number; name: React.ReactNode }, prevStep: { prevId?: string | number; prevName: React.ReactNode }) => void null nav에서 단계를 클릭했을 때의 콜백 함수입니다.
onNext (newStep: { id?: string | number; name: React.ReactNode }, prevStep: { prevId?: string | number; prevName: React.ReactNode }) => void null (푸터를 제어하면 사용되지 않음) Next 버튼을 클릭한 후의 콜백 함수입니다.
onSave () => void (푸터를 제어하면 사용되지 않음) wizard 끝에서 저장하는 콜백 함수이며, 지정되지 않으면 onClose를 사용합니다.
startAtStep number 1 wizard가 현재 있는 단계(1 이상)입니다.
title string null 헤더를 원할 경우 표시할 wizard 제목입니다.
titleId string 제목의 선택적 id입니다.
width number | string null wizard의 커스텀 너비입니다.

WizardNav

*필수(required)

이름(name) 타입(Type) 기본값(Default) 설명(Description)
aria-label string nav 요소에 적용되는 aria-label입니다.
aria-labelledby string nav 요소에 aria-labelledby 속성을 설정합니다.
children any children은 WizardNavItem 컴포넌트여야 합니다.
isOpen boolean false nav가 펼쳐졌는지 여부입니다.
ouiaId number | string
ouiaSafe boolean true
returnList boolean false true이면 감싸는 nav 요소 없이 내부 목록을 반환합니다.

WizardNavItem

*필수(required)

이름(name) 타입(Type) 기본값(Default) 설명(Description)
step *필수 number onNavItemClick 콜백에 전달되는 단계입니다.
children React.ReactNode null 하위 단계를 위해 WizardNav 컴포넌트를 중첩할 수 있습니다.
content React.ReactNode '' nav 항목에 표시할 콘텐츠입니다.
href string null 앵커 컴포넌트를 사용할 때 사용할 선택적 url입니다.
id string | number nav 항목의 id입니다.
isCurrent boolean false nav 항목이 현재 활성 항목인지 여부입니다.
isDisabled boolean false nav 항목이 비활성인지 여부입니다.
isExpandable boolean false 이 NavItem에 자식 단계가 있고 펼칠 수 있음을 나타내는 플래그입니다.
navItemComponent 'button' | 'a' 'button' WizardNavItem을 렌더링하는 데 사용하는 컴포넌트입니다.
onNavItemClick (step: number) => any () => undefined nav 항목을 클릭했을 때의 콜백입니다.
ouiaId number | string
ouiaSafe boolean true

WizardHeader

*필수(required)

이름(name) 타입(Type) 기본값(Default) 설명(Description)
title *필수 string wizard의 제목입니다.
closeButtonAriaLabel string X(닫기) 버튼에 적용되는 aria-label입니다.
description React.ReactNode wizard의 설명입니다.
descriptionComponent 'div' | 'p' 'div' 설명의 컴포넌트 타입입니다.
descriptionId string 설명의 id입니다.
hideClose boolean 닫기 버튼이 헤더에 있어야 하는지 나타내는 플래그입니다.
onClose () => void () => undefined X(닫기) 버튼을 클릭했을 때 호출되는 콜백 함수입니다.
titleId string 제목의 id입니다.

WizardBody

*필수(required)

이름(name) 타입(Type) 기본값(Default) 설명(Description)
activeStep *필수 WizardStep 현재 활성 WizardStep입니다.
aria-labelledby *필수 string 하나 이상의 요소 id를 전달해서 wizard 본문에 접근 가능한 이름을 추가합니다. aria-labelledby는 본문 콘텐츠가 넘쳐서 스크롤바를 렌더링할 때만 적용됩니다.
children *필수 any Wizard 본문에 렌더링할 수 있는 모든 것입니다.
aria-label string 본문 콘텐츠가 넘쳐서 스크롤바를 렌더링할 때 wizard 본문에 접근 가능한 이름을 추가합니다.
hasDrawer boolean
hasNoBodyPadding boolean false 기본 본문 패딩을 제거하려면 true로 설정합니다.
isDrawerExpanded boolean wizard 드로어가 펼쳐졌는지 나타내는 플래그입니다.
mainComponent React.ElementType 'div' 기본 콘텐츠 컨테이너로 사용되는 컴포넌트입니다.
onExpandDrawer () => void 드로어가 토글될 때의 콜백 함수입니다.

WizardFooter

*필수(required)

이름(name) 타입(Type) 기본값(Default) 설명(Description)
children *필수 any 푸터의 버튼입니다.

WizardToggle

*필수(required)

이름(name) 타입(Type) 기본값(Default) 설명(Description)
activeStep *필수 WizardStep 현재 활성 WizardStep입니다.
isNavOpen *필수 boolean nav가 열려 있는지 여부입니다.
nav *필수 (isWizardNavOpen: boolean) => React.ReactElement<any> WizardNav 컴포넌트를 반환하는 함수입니다.
onNavToggle *필수 (isOpen: boolean) => void nav가 토글될 때의 콜백 함수입니다.
steps *필수 WizardStep[] wizard 단계입니다.
aria-label string 'Wizard Toggle' 버튼의 aria-label입니다.
children React.ReactNode WizardFooter입니다.
hasDrawer boolean wizard에 단계 중 적어도 하나에 대한 드로어가 있는지 나타내는 플래그입니다.
hasNoBodyPadding boolean false 본문 패딩을 제거하려면 true로 설정합니다.
isDrawerExpanded boolean wizard 드로어가 펼쳐졌는지 나타내는 플래그입니다.
isInPage boolean true wizard가 페이지 안(in-page)에 있는지 여부입니다.
mainAriaLabel string null 본문 콘텐츠가 넘쳐서 스크롤바를 렌더링할 때 wizard 본문에 접근 가능한 이름을 추가합니다.
mainAriaLabelledBy string null 하나 이상의 요소 id를 전달해서 wizard 본문에 접근 가능한 이름을 추가합니다. aria-labelledby는 본문 콘텐츠가 넘쳐서 스크롤바를 렌더링할 때만 적용됩니다.
onExpandDrawer () => void 드로어가 토글될 때의 콜백 함수입니다.

WizardStep

*필수(required)

이름(name) 타입(Type) 기본값(Default) 설명(Description)
name *필수 React.ReactNode 단계의 이름입니다.
canJumpTo boolean 네비게이션에서 단계를 활성화하거나 비활성화합니다. 기본적으로 활성화됩니다.
component any 메인 본문에 렌더링할 컴포넌트입니다.
drawerPanelContent any 드로어 패널에서 렌더링할 콘텐츠입니다(wizard에 hasDrawer prop이 설정되었을 때 사용).
drawerToggleButton React.ReactNode 드로어를 여는 커스텀 드로어 토글 버튼입니다.
enableNext boolean (푸터를 제어하면 사용되지 않음) Next 버튼을 활성화하는 데 필요한 조건입니다.
hideBackButton boolean (푸터를 제어하면 사용되지 않음) true이면 Back 버튼을 숨깁니다.
hideCancelButton boolean (푸터를 제어하면 사용되지 않음) true이면 Cancel 버튼을 숨깁니다.
id string | number 선택적 식별자입니다.
isDisabled boolean 네비게이션에서 단계를 비활성화하는 플래그입니다.
isFinishedStep boolean true로 설정하면 사이드 nav와 푸터를 숨깁니다.
nextButtonText React.ReactNode (푸터를 제어하면 사용되지 않음) Next 버튼 텍스트를 바꿀 수 있습니다. Wizard에도 nextButtonText가 설정되어 있으면 이 단계별 값이 덮어씁니다.
stepNavItemProps React.HTMLProps<HTMLButtonElement | HTMLAnchorElement> | WizardNavItemProps WizardNavItem에 전달할 props입니다.
steps WizardStep[] 하위 단계입니다.

GitHub에서 이 페이지 편집하기

더 알아보기 (Learn more)