# 분할 조절 막대 (Splitter)

분류: 컴포넌트 > 입력 (Components > Input)
주소: https://ui-glossary-xi.vercel.app/components/splitter
다른 이름: 분할 조절 막대, 분할 막대, 창 나누기 막대, 크기 조절 막대, splitter, window splitter, resizable, resizable panels, resizable handle

두 칸 사이를 끌거나 화살표로 옮겨 칸 크기를 바꾸는 막대. 창을 두 칸(판)으로 나눈 경계의 막대. 끌거나 키보드로 옮기면 한쪽 칸이 커지고 다른 쪽이 작아진다. APG는 '창의 두 구역(판) 사이에서 움직일 수 있는 구분자'(window splitter)로, 앤트 디자인은 Splitter('크기를 바꿀 수 있는 분할 판 배치')로, 섀드씨엔은 Resizable('키보드를 지원하는, 접근성 있는 크기 조절 판 묶음과 배치')로 부른다. APG에서 막대는 초점을 받는 role="separator"이고, 주 칸의 크기를 aria-valuenow로 알린다(최솟값은 흔히 0, 최댓값은 흔히 100).

## 용도
- 두 칸의 크기를 사용자가 자유롭게 끌어 정하게 할 때(앤트).
- 칸마다 최소·최대 크기를 정할 수 있다(앤트 min·max).
- 가로·세로 어느 쪽으로도 나눈다(앤트·섀드씨엔 orientation).
- APG는 어느 위치로든 옮기는 가변형과 두 자리만 오가는 고정형으로 나누고, 고정형은 화살표 키를 두지 않는다.

## 헷갈릴 수 있는 UI
- 구분선 (Divider (separator), https://ui-glossary-xi.vercel.app/md/divider.md): 구분선은 내용 묶음 사이의 선으로 움직이지 않는다. 분할 조절 막대는 초점을 받는 separator로, 끌거나 화살표로 옮겨 두 칸 크기를 바꾼다(APG).
- 슬라이더 (Slider, https://ui-glossary-xi.vercel.app/md/slider.md): 슬라이더는 값을 고르는 입력이다. 분할 조절 막대도 aria-valuenow로 위치를 알리지만, 그 값이 곧 두 칸의 크기다.
- 마스터-디테일 (List-detail (master-detail) layout, https://ui-glossary-xi.vercel.app/md/list-detail.md): 마스터-디테일은 목록과 상세 두 칸 배치다. 분할 조절 막대는 그런 두 칸 사이에 두어 비율을 바꾸게 하는 부품이다.

## AI에게 이렇게 말하세요
- 한국어: 메일 화면의 목록 | 본문 사이에 분할 조절 막대를 넣어 줘. 막대는 role="separator" tabindex="0" aria-orientation="vertical"(separator 기본 방향은 가로), aria-valuenow(목록 폭 %)·aria-valuemin="0"·aria-valuemax="80", aria-controls는 목록 칸, 이름은 목록 칸 이름과 같게(aria-label="메일 목록"). 끌거나 ←/→로 옮기고, Enter로 목록을 접고 다시 펴고, Home/End로 끝까지.
- English: Put a splitter between the message list and the message body: role="separator" tabindex="0" aria-orientation="vertical" (separators default to horizontal) with aria-valuenow (list width %), aria-valuemin="0", aria-valuemax="80", aria-controls pointing to the list pane, and the same name as the list pane (aria-label="Mail list"). Drag or ←/→ moves it, Enter collapses and restores the list, Home/End go to the ends.

이렇게 말하면 엉뚱한 게 나와요:
- "가운데 구분선 넣어 줘" — 움직이지 않는 선이 나온다. 끌어서 크기를 바꾸려면 '분할 조절 막대(window splitter)'. (대신 나오는 것: 구분선)
- "화면 분할해 줘" — 반반 고정 배치가 나올 수 있다. 사용자가 비율을 바꾸게 하려면 '분할 조절 막대'까지 말한다. (대신 나오는 것: 스플릿 화면)

## 핵심 구조 요점
### 태그
- 두 칸 사이에 초점을 받는 막대 요소(tabindex="0"). 막대 값에 따라 주 칸 크기를 바꾼다.
- 섀드씨엔 Resizable은 react-resizable-panels 위에 만들고, orientation으로 가로·세로를 정한다.

### 접근성 속성
- role="separator"(초점을 받는 separator는 위젯으로 동작 — APG). aria-valuenow = 지금 위치, aria-valuemin = 주 칸이 가장 작을 때, aria-valuemax = 가장 클 때(APG).
- 이름은 주 칸 이름과 같게(aria-labelledby 또는 aria-label), aria-controls로 주 칸을 가리킨다(APG). 이 사전의 체험은 세로 막대라 aria-orientation="vertical"을 단다.

### 키보드
- ←/→(세로 막대) 또는 ↑/↓(가로 막대): 막대를 옮긴다. Enter: 주 칸을 접고, 접혀 있으면 전 자리로 되돌린다(APG).
- 선택 키 Home·End: 주 칸을 가장 작게·크게(APG). 이 사전의 체험은 Home·End도 하고, 한 번에 10%씩 옮기며, 최댓값은 70%이고 좁은 화면에서는 본문 칸이 남도록 낮춘다(aria-valuemax도 함께).
- APG에만 있는 선택 키 F6(판 사이 이동)은 이 체험에 없다.

## 출처
- [WAI-ARIA APG — Window Splitter Pattern](https://www.w3.org/WAI/ARIA/apg/patterns/windowsplitter/)
- [Ant Design — Splitter](https://ant.design/components/splitter)
- [shadcn/ui — Resizable](https://ui.shadcn.com/docs/components/base/resizable)
