{"name":"splitter","title":"Splitter","description":"","kind":"component","category":"display","status":"beta","props":{"panels":{"type":"array","items":{"id":"string","content":"node? (a string is padded text)","minSize":"number? (percent)","maxSize":"number? (percent)","collapsible":"boolean?","collapsedSize":"number? (percent)"},"description":"The panels in order, with their limits. Every pair gets a handle."},"size":{"type":"array","items":{"type":"number"},"model":true,"description":"One percentage per panel, adding up to 100. Controlled: size with onSizeChange. Uncontrolled: defaultSize. Without either, the panels share the room equally."},"orientation":{"type":"enum","values":["horizontal","vertical"],"default":"horizontal","description":"horizontal: panels side by side, the handles are vertical rules. vertical: panels stacked, the handles are horizontal rules."},"grip":{"type":"boolean","default":false,"description":"Show the grip on every handle."},"keyboardStep":{"type":"number","default":1,"description":"Percent an arrow key moves a handle; Shift + arrow moves 10."},"handleLabel":{"type":"string","default":"Resize","description":"Accessible name of every handle."}},"playground":{"name":"Playground","props":{"orientation":"horizontal","grip":false,"keyboardStep":1,"panels":[{"id":"pull-request","content":"#482 Add retry to webhook delivery. Daniel Okafor wants to merge 3 commits into main.","minSize":20},{"id":"checks","content":"Build passed, 12 tests passed, preview ready.","minSize":30}],"size":[40,60],"style":{"height":160}}},"exampleFiles":[{"file":"files-and-editor","title":"Files beside the editor"},{"file":"editor-and-terminal","title":"Editor above the terminal"},{"file":"review-layout","title":"Three panes with a reset"}],"worstCase":[{"name":"Long text in narrow panels","props":{"style":{"width":320,"height":200},"panels":[{"id":"a","content":"A panel whose text is much longer than the room it has, so it wraps and then scrolls inside the panel rather than pushing the handle away from where the user left it"},{"id":"b","content":"averyveryverylongunbrokenwordthatcannotwrapanywhereatall"}],"size":[50,50]}},{"name":"Many panels","props":{"style":{"width":320,"height":160},"grip":true,"panels":[{"id":"p1","content":"1"},{"id":"p2","content":"2"},{"id":"p3","content":"3"},{"id":"p4","content":"4"},{"id":"p5","content":"5"},{"id":"p6","content":"6"}]}},{"name":"At the minimum","props":{"style":{"width":320,"height":160},"panels":[{"id":"a","content":"Min","minSize":10},{"id":"b","content":"Rest"}],"size":[10,90]}},{"name":"Right-to-left text","props":{"style":{"width":320,"height":160},"grip":true,"panels":[{"id":"a","content":"لوحة التنقل"},{"id":"b","content":"المحتوى الرئيسي للصفحة"}],"size":[40,60]}},{"name":"One panel","props":{"style":{"width":320,"height":120},"panels":[{"id":"only","content":"Nothing to split"}]}}],"anatomy":[{"part":"root","element":"div","description":"Ark's splitter root: a flex row (a column when vertical) as large as its container (the engine sets width and height to 100% and clips). Give it, or its parent, a height. No frame of its own: the caller frames it (a card, a window)."},{"part":"panel","element":"div","repeat":true,"description":"One region, sized by the engine (flex-grow from a zero basis, from its percentage), so it never pads itself. Scrolls its own content when it overflows (the engine's inline overflow: hidden is overridden) and hands the wheel on to the page at its ends."},{"part":"text","element":"p","optional":true,"repeat":true,"description":"A panel's content when it is plain text: padded 12px, text.sm ink-2, wrapping anywhere; author text keeps its own direction."},{"part":"handle","element":"div","repeat":true,"description":"Ark's resize trigger between two panels: role=separator, focusable, the 1px rule in color.line (1px wide in a row, 1px high in a column). Its hit area reaches 4px each side under a mouse (9px) and 20px each side on a coarse pointer (41px), without changing its look. Hovered by a mouse: ink-3; dragged: accent. The cursor is the engine's col-resize / row-resize; touch-action none, so a drag never scrolls the page."},{"part":"grip","element":"div","optional":true,"description":"The optional grip (grip prop), Ark's resize trigger indicator: a 12×24 tab centred on the rule by flex centring (never a fractional translate) (24×12 in a column), surface with shadow.btn and radius.chip, holding the dots-six-vertical glyph at 10px in ink-3 (turned a quarter in a column). Decoration; the handle is what is dragged and focused."}],"slots":{},"events":{"sizeChange":"(size: number[]) while dragging and on every key","sizeChangeEnd":"(size: number[]) when a drag or a key press ends"},"states":["hover","dragging","focus-visible"],"tokens":["color.line","color.ink-2","color.ink-3","color.accent","color.surface","shadow.btn","radius.chip","text.sm","duration.fast"],"a11y":{"role":"separator","keyboard":["Tab moves to each handle in turn","Arrow Left / Right (horizontal) or Up / Down (vertical) move the focused handle by keyboardStep percent; with Shift, 10. Right-to-left, Left and Right are mirrored (the engine's keys)","Home / End: the panel before the handle shrinks to its minimum / grows to its maximum","Enter collapses or expands a collapsible panel (the engine's key)","F6 moves to the next handle (the engine's key)"],"notes":["Each handle is role=separator with aria-valuenow (the size of the panel before it), aria-valuemin, aria-valuemax, aria-orientation (perpendicular to the layout) and aria-controls naming both panels.","Name the handles with handleLabel (\"Resize\" by default); give the panels their own headings when they have names.","Resizing is never animated: the panels follow the pointer 1:1 and a key moves them at once."]},"motion":["panels: no transition; they follow the pointer 1:1 while dragged and change at once from the keyboard","handle hover (a real pointer only): line → ink-3 over duration.fast; while dragged: accent at once; back to line over duration.fast","grip: never moves on its own","first paint: the panels are laid out at their given sizes from the first frame; a collapsible panel given its collapsed size is shut from the first frame (its minSize only applies once it is open; React renders a frame before the engine resolves the sizes, so its adapter holds the collapsed minimum meanwhile)"]}