Html
Toolbar는 그룹(.pf-v6-c-toolbar__group)과 항목(.pf-v6-c-toolbar__item)을 기반으로 동작하는 HTML 컴포넌트예요. 기본 열·행 간격 값을 가지며, 그룹 유형에 따라 간격을 조절하는 수정자 선택자를 제공해요.
출처: 문서
본문
Toolbar는 기본 열/행 간격 값을 가진 그룹(.pf-v6-c-toolbar__group)과 항목(.pf-v6-c-toolbar__item)에 의존해요. 그룹과 항목은 형제(sibling)가 될 수 있고, 항목이 그룹 안에 중첩될 수도 있어요. 그룹 유형에 따라 간격을 조절하는 수정자 선택자가 적용돼요. 항목과 그룹의 기본 column-gap 값은 --pf-v6-c--ColumnGap으로 설정되며, 그 값은 --pf-t--global--spacer--md, 즉 16px이에요. 항목과 그룹의 기본 row-gap 값은 --pf-v6-c--RowGap으로 설정되며, 그 값은 --pf-t--global--spacer--sm, 즉 8px이에요.
항목과 그룹의 기본 간격:
| 클래스(Class) | CSS 변수(CSS Variable) | 계산값(Computed Value) |
|---|---|---|
.pf-v6-c-toolbar__group |
--pf-v6-c-toolbar__group--ColumnGap |
16px |
.pf-v6-c-toolbar__item |
--pf-v6-c-toolbar__item--ColumnGap |
16px |
.pf-m-[column/row]-gap-[none/sm/md/lg/xl/2xl]{-on-[breakpoint]} |
.pf-v6-c-toolbar__content-section, .pf-v6-c-toolbar__group, .pf-v6-c-toolbar__item |
선택적 중단점에서 toolbar 그룹이나 항목 간격을 수정합니다. |
.pf-m-gap-[none/sm/md/lg/xl/2xl]{-on-[breakpoint]} |
.pf-v6-c-toolbar__content-section, .pf-v6-c-toolbar__group, .pf-v6-c-toolbar__item |
선택적 중단점에서 toolbar 그룹이나 항목 간격의 열·행 간격을 모두 수정합니다. |
Toolbar 항목 유형 (Toolbar item types)
| 클래스(Class) | 적용 대상(Applied to) | 결과(Outcome) |
|---|---|---|
.pf-m-pagination |
.pf-v6-c-toolbar__item |
페이지네이션과 margin을 생성합니다. |
수정자 (Modifiers)
| 클래스(Class) | 적용 대상(Applied to) | 결과(Outcome) |
|---|---|---|
.pf-m-[hidden/visible] |
.pf-v6-c-toolbar > * |
toolbar 요소를 숨기거나 보이게 수정합니다. |
.pf-m-[hidden/visible]{-on-[breakpoint]} |
.pf-v6-c-toolbar__content-section, .pf-v6-c-toolbar__group, .pf-v6-c-toolbar__item |
선택적 중단점에서 toolbar 요소를 숨기거나 보이게 수정합니다. |
.pf-m-[hidden/visible]{-on-[breakpoint]}-height |
.pf-v6-c-toolbar__content-section, .pf-v6-c-toolbar__group, .pf-v6-c-toolbar__item |
선택적 높이 중단점에서 toolbar 요소를 숨기거나 보이게 수정합니다. 주로 세로 toolbar에 사용됩니다. |
.pf-m-flex-grow |
.pf-v6-c-toolbar__group, .pf-v6-c-toolbar__item |
toolbar 요소를 flex-grow: 1로 수정하여 사용 가능한 주축 공간을 차지하게 합니다. |
.pf-m-align-[start/end] |
.pf-v6-c-toolbar__group, .pf-v6-c-toolbar__item |
toolbar 주축(main axis) 요소 정렬을 수정합니다. |
.pf-m-align-items-[stretch/baseline/start/center/end] |
.pf-v6-c-toolbar__content-section, .pf-v6-c-toolbar__group, .pf-v6-c-toolbar__item |
toolbar 요소 교차축(cross axis) 자식 정렬을 수정합니다. |
.pf-m-align-self-[stretch/baseline/start/center/end] |
.pf-v6-c-toolbar__group, .pf-v6-c-toolbar__item |
toolbar 요소 교차축 자기 정렬을 수정합니다. |
특별 참고 (Special notes)
다음 예시의 여러 컴포넌트는 기능 및/또는 접근성 명세를 포함하지 않아요(예: .pf-v6-c-select, .pf-v6-c-options-menu). .pf-v6-c-toolbar는 오히려 그 자체에만 적용되는 기능과 접근성 명세에 집중해요.
사용 가능한 중단점은 -on-sm, -on-md, -on-lg, -on-xl, -on-2xl이에요.
예시 (Examples)
Simple (간단)
항목 유형 (Item types)
| 클래스(Class) | 적용 대상(Applied to) | 결과(Outcome) |
|---|---|---|
.pf-v6-c-toolbar__item |
<div> |
toolbar 컴포넌트 항목을 생성합니다. 필수입니다. |
.pf-v6-c-toolbar__group |
<div> |
toolbar 컴포넌트 그룹을 생성합니다. |
No padding (패딩 없음)
Adjusted group column gap (그룹 열 간격 조정)
Insets (여백)
Toolbar 스페이서와 inset (Toolbar spacers and insets)
| 클래스(Class) | 적용 대상(Applied to) | 결과(Outcome) |
|---|---|---|
.pf-m-column-gap-[none/sm/md/lg] |
.pf-v6-c-toolbar__group |
toolbar 그룹 자식 간격을 수정합니다. |
.pf-m-inset-[none/sm/md/lg/xl/2xl] |
.pf-v6-c-toolbar |
toolbar 가로를 수정합니다. |
Width control (너비 제어)
Width control 사용법 (Width control usage)
| 클래스(Class) | 적용 대상(Applied to) | 결과(Outcome) |
|---|---|---|
--pf-v6-c-toolbar__item--Width: {width} |
.pf-v6-c-toolbar__item |
선택적 중단점에서 toolbar 항목의 너비 값을 수정합니다. |
--pf-v6-c-toolbar__item--MinWidth: {width} |
.pf-v6-c-toolbar__item |
선택적 중단점에서 toolbar 항목의 최소 너비 값을 수정합니다. |
그룹 유형 (Group types)
Filter group (필터 그룹) — 표준 필터, 입력 그룹과 필터
Action group (액션 그룹)
Action group plain (플레인 액션 그룹)
Action group inline (인라인 액션 그룹)
- 6 filters applied
Label group (라벨 그룹)
- Status: Label one, Label two, Label three
- Risk: Label one, Label two, Label three
Toggle group on mobile — filters collapsed, expandable content expanded (모바일의 토글 그룹 — 필터 접힘, 펼쳐지는 콘텐츠 펼쳐짐)
Toggle group on desktop (데스크톱의 토글 그룹)
Toolbar 그룹 유형 (Toolbar group types)
| 클래스(Class) | 적용 대상(Applied to) | 결과(Outcome) |
|---|---|---|
.pf-m-filter-group |
.pf-v6-c-toolbar__group |
toolbar 그룹 열 간격을 수정합니다. |
.pf-m-action-group |
.pf-v6-c-toolbar__group |
액션 그룹의 toolbar 그룹 열 간격을 수정합니다. |
.pf-m-action-group-plain |
.pf-v6-c-toolbar__group |
플레인 액션 그룹의 toolbar 그룹 열 간격을 수정합니다. |
.pf-m-action-group-inline |
.pf-v6-c-toolbar__group |
인라인 액션 그룹의 toolbar 그룹 열 간격을 수정합니다. |
.pf-m-toggle-group |
.pf-v6-c-toolbar__group |
.pf-m-toggle-group은 필터가 숨겨지거나 보이는 시점과 중단점을 제어합니다. 기본적으로 지정된 중단점에 도달할 때까지 모든 필터가 숨겨집니다. .pf-m-show-on-{md, lg, xl}은 필터가 보이는 시점과 토글 버튼이 숨겨지는 시점을 제어합니다. |
접근성 (Accessibility)
| 속성(Attribute) | 적용 대상(Applied to) | 결과(Outcome) |
|---|---|---|
hidden |
.pf-v6-c-toolbar__item, .pf-v6-c-toolbar__group, .pf-v6-c-toolbar__toggle, .pf-v6-c-toolbar__expandable-content |
토글 그룹 요소가 숨겨져 있음을 나타냅니다. 필수입니다. |
aria-expanded="[true/false]" |
.pf-v6-c-toolbar__toggle > .pf-v6-c-button |
펼쳐지는 콘텐츠가 보이는지 숨겨졌는지 나타냅니다. 필수입니다. |
aria-controls="[id of expandable content]" |
.pf-v6-c-toolbar__toggle > .pf-v6-c-button |
토글 버튼이 제어하는 펼쳐진 콘텐츠를 식별합니다. 필수입니다. |
id="[expandable-content_id]" |
.pf-v6-c-toolbar__expandable-content |
토글 버튼 설명을 위한 참조를 제공합니다. 필수입니다. |
반응형 속성 (Responsive attributes)
| 속성(Attribute) | 적용 대상(Applied to) | 결과(Outcome) |
|---|---|---|
aria-haspopup=true |
.pf-v6-c-toolbar__toggle > .pf-v6-c-button |
펼쳐지는 콘텐츠가 콘텐츠 위에 나타날 때(모바일 뷰포트) 포커스가 갇혀야 함을 나타내기 위해 aria-haspopup=true를 적용해야 합니다. 필수입니다. |
사용법 (Usage)
| 클래스(Class) | 적용 대상(Applied to) | 결과(Outcome) |
|---|---|---|
.pf-m-[show/hide][-on-[sm/md/lg/xl/2xl]] |
.pf-v6-c-toolbar__group, .pf-v6-c-toolbar__item, .pf-v6-c-toolbar__expandable-content |
toolbar 요소 가시성을 수정합니다. |
.pf-m-expanded |
.pf-v6-c-toolbar__expandable-content, .pf-v6-c-toolbar__toggle |
컴포넌트를 펼쳐진 상태로 수정합니다. |
Selected (선택됨)
모바일의 선택된 필터 — 필터 접힘, 선택된 필터 요약 표시 (Selected filters on mobile — filters collapsed, selected filters summary visible)
- 6 filters applied
- 6 filters applied
모바일의 선택된 필터 — 필터 접힘, 펼쳐지는 콘텐츠 펼쳐짐 (Selected filters on mobile — filters collapsed, expandable content expanded)
- Status: Label one, Label two, Label three
- Risk: Label one, Label two, Label three
- 6 filters applied
데스크톱의 선택된 필터 — 반응형 아님 (Selected filters on desktop — not responsive)
- Status: Label one, Label two, Label three
- Risk: Label one, Label two, Label three
- 6 filters applied
Stacked (스택됨)
데스크톱에서 스택 (Stacked on desktop)
- 37 items
- of 4
모바일에서 스택 — 필터 접힘, 펼쳐지는 콘텐츠 펼쳐짐 (Stacked on mobile — filters collapsed, expandable content expanded)
- Status: Label one, Label two, Label three
- Risk: Label one, Label two, Label three
- 37 items
- of 4
배경색 변형 (Background color variants)
스티키 toolbar (Sticky toolbar)
이 예시는 Lorem ipsum 텍스트와 함께 스크롤에서 고정된 toolbar를 보여줘요.
동적 스티키 toolbar (Dynamic sticky toolbar)
이 예시는 .pf-m-sticky-base와 .pf-m-sticky-stuck의 사용을 보여줘요. .pf-m-sticky-stuck은 페이지가 스크롤되면서 toolbar가 "걸린(stuck)" 상태로 콘텐츠 위에 떠 있을 때만 스티키 스타일을 표시하도록 동적으로 적용될 수 있어요.
Vertical (세로)
높이 가시성 중단점이 있는 세로 toolbar (Vertical with height visibility breakpoints)
가시성은 중단점별로 설정해서 뷰포트 높이에 따라 항목과 그룹을 보이거나 숨길 수 있어요.
- Item
- Item
- Item (md 아래에서 숨김)
- Item (lg 아래에서 숨김)
- Item (lg 아래에서 숨김)
- Item (lg 아래에서 숨김)
문서 (Documentation)
개요 (Overview)
toolbar 컴포넌트는 하이브리드 레이아웃 겸 컴포넌트이므로, 그중 일부 요소는 표시용(presentational)이고 일부는 접근성 지원이 필요해요.
사용법 (Usage)
| 클래스(Class) | 적용 대상(Applied to) | 결과(Outcome) |
|---|---|---|
.pf-v6-c-toolbar |
<div> |
toolbar 컴포넌트를 생성합니다. 필수입니다. |
.pf-v6-c-toolbar__item |
<div> |
toolbar 항목을 생성합니다. 필수입니다. |
.pf-v6-c-toolbar__group |
<div> |
toolbar 그룹을 생성합니다. |
.pf-v6-c-toolbar__content |
<div> |
toolbar 콘텐츠 컨테이너를 생성합니다. 필수입니다. |
.pf-v6-c-toolbar__content-section |
<div> |
toolbar 콘텐츠 섹션을 생성합니다. 콘텐츠 컨테이너 안에서 정적 요소와 동적 요소를 분리하는 데 사용합니다. .pf-v6-c-toolbar__content 하나당 .pf-v6-c-toolbar__content-section이 하나를 넘으면 안 됩니다. 필수입니다. |
.pf-v6-c-toolbar__expandable-content |
<div> |
toolbar 펼쳐지는 콘텐츠 섹션을 생성합니다. |
.pf-v6-c-toolbar__expand-all-icon |
<span> |
toolbar 모두 펼치기 아이콘을 생성합니다. |
.pf-m-sticky |
.pf-v6-c-toolbar |
toolbar 컴포넌트를 컨테이너 상단에 붙도록(sticky) 수정합니다. |
.pf-m-full-height |
.pf-v6-c-toolbar, .pf-v6-c-toolbar__content-section, .pf-v6-c-toolbar__group |
toolbar 컴포넌트를 컨테이너의 전체 높이로 수정하고 세로 패딩을 제거합니다. |
.pf-m-static |
.pf-v6-c-toolbar |
펼쳐지는 콘텐츠 섹션이 toolbar 컴포넌트 바깥의 가장 가까운 절대 위치 부모에 배치되도록 수정합니다. 주로 마스트헤드(masthead) toolbar에 사용됩니다. |
.pf-m-primary |
.pf-v6-c-toolbar |
toolbar에 기본(primary) 배경색을 가지도록 수정합니다. |
.pf-m-secondary |
.pf-v6-c-toolbar |
toolbar에 보조(secondary) 배경색을 가지도록 수정합니다. |
.pf-m-no-padding |
.pf-v6-c-toolbar |
toolbar에 패딩이 없도록 수정합니다. |
.pf-m-no-background |
.pf-v6-c-toolbar |
toolbar에 배경색이 없도록 수정합니다. |
.pf-m-vertical |
.pf-v6-c-toolbar |
toolbar를 세로 레이아웃으로 수정합니다. |
.pf-m-expanded |
.pf-v6-c-toolbar__expandable-content |
펼쳐지는 콘텐츠 섹션을 펼쳐진 상태로 수정합니다. |
.pf-m-expanded |
.pf-v6-c-toolbar__item.pf-m-expand-all |
모두 펼치기 버튼을 펼쳐진 상태로 수정합니다. |
.pf-m-action-group |
.pf-v6-c-toolbar__group |
액션 그룹 간격을 생성합니다. |
.pf-m-action-group-inline |
.pf-v6-c-toolbar__group |
인라인 액션 그룹 간격을 생성합니다. |
.pf-m-action-group-plain |
.pf-v6-c-toolbar__group |
플레인 액션 그룹 간격을 생성합니다. |
.pf-m-filter-group |
.pf-v6-c-toolbar__group |
필터 그룹 간격을 생성합니다. |
.pf-m-label |
.pf-v6-c-toolbar__item |
라벨 항목 프레젠테이션을 생성합니다. |
.pf-m-label-group |
.pf-v6-c-toolbar__group |
라벨 그룹 간격을 생성합니다. |
.pf-m-overflow-container |
.pf-v6-c-toolbar__item, .pf-v6-c-toolbar__group |
toolbar 요소가 오버플로를 숨기고 사용 가능한 공간에 반응하도록 수정합니다. 가로 내비게이션에 사용됩니다. |
.pf-m-expanded |
.pf-v6-c-toolbar__expandable-content, .pf-v6-c-toolbar__toggle |
컴포넌트를 펼쳐진 상태로 수정합니다. |
.pf-m-[wrap/nowrap] |
.pf-v6-c-toolbar__content, .pf-v6-c-toolbar__content-section, .pf-v6-c-toolbar__group, .pf-v6-c-toolbar__item |
toolbar 요소를 줄바꿈하거나 하지 않게 수정합니다. |
.pf-m-align-[start/center/end] |
.pf-v6-c-toolbar__group, .pf-v6-c-toolbar__item |
toolbar 주축 요소 정렬을 수정합니다. |
.pf-m-align-items-[stretch/baseline/start/center/end] |
.pf-v6-c-toolbar__content, .pf-v6-c-toolbar__content-section, .pf-v6-c-toolbar__group, .pf-v6-c-toolbar__item |
toolbar 요소 교차축 자식 정렬을 수정합니다. |
.pf-m-align-self-[stretch/baseline/start/center/end] |
.pf-v6-c-toolbar__group, .pf-v6-c-toolbar__item |
toolbar 요소 교차축 자기 정렬을 수정합니다. |
.pf-m-inset-[none/sm/md/lg/xl/2xl] |
.pf-v6-c-toolbar |
toolbar 가로를 수정합니다. |
접근성 (Accessibility)
| 속성(Attribute) | 적용 대상(Applied to) | 결과(Outcome) |
|---|---|---|
hidden |
.pf-v6-c-toolbar__item, .pf-v6-c-toolbar__group, .pf-v6-c-toolbar__toggle, .pf-v6-c-toolbar__expandable-content |
toolbar 요소가 숨겨져 있음을 나타냅니다. 필수입니다. |
aria-expanded="[true/false]" |
.pf-v6-c-toolbar__toggle > .pf-v6-c-button |
펼쳐지는 콘텐츠가 숨겨졌거나 보이는지 나타냅니다. 필수입니다. |
aria-controls="[id of expandable content]" |
.pf-v6-c-toolbar__toggle > .pf-v6-c-button |
토글 버튼이 제어하는 펼쳐진 콘텐츠를 식별합니다. 필수입니다. |
id="[expandable-content_id]" |
.pf-v6-c-toolbar__expandable-content |
토글 버튼 설명을 위한 참조를 제공합니다. 필수입니다. |
aria-label="Expand all" |
.pf-v6-c-toolbar__item.pf-m-expand-all |
모두 펼치기 항목 버튼에 접근 가능한 라벨을 제공합니다. 필수입니다. |
aria-label="Collapse all" |
.pf-v6-c-toolbar__item.pf-m-expand-all.pf-m-expanded |
모두 펼치기 항목 버튼에 접근 가능한 라벨을 제공합니다. 필수입니다. |
토글 그룹 사용법 (Toggle group usage)
| 클래스(Class) | 적용 대상(Applied to) | 결과(Outcome) |
|---|---|---|
.pf-m-toggle-group |
.pf-v6-c-toolbar__group |
필터가 숨겨지거나 보이는 시점과 중단점을 제어하도록 toolbar 그룹을 수정합니다. 기본적으로 지정된 중단점에 도달할 때까지 모든 필터가 숨겨집니다. |
.pf-m-[show/hide] |
.pf-v6-c-toolbar__group.pf-m-toggle-group, .pf-v6-c-toolbar__expandable-content |
toolbar 요소를 숨기도록 수정합니다. |
스페이서 시스템 (Spacer system)
| 클래스(Class) | 적용 대상(Applied to) | 결과(Outcome) |
|---|---|---|
.pf-m-[column/row]-gap-[none/sm/md/lg/xl/2xl] |
.pf-v6-c-toolbar__group, .pf-v6-c-toolbar__item |
선택적 중단점에서 toolbar 그룹이나 항목 간격을 수정합니다. |
.pf-m-gap-[none/sm/md/lg/xl/2xl] |
.pf-v6-c-toolbar__group, .pf-v6-c-toolbar__item |
선택적 중단점에서 toolbar 그룹이나 항목 간격의 열·행 간격을 모두 수정합니다. |