Skip to main content

Splitter

Splits an area into resizable panels with a draggable handle between each one. Compose it from Splitter.Panel children; the handle is inserted automatically. Give the Splitter a sized container (it fills 100% height/width).

import { Splitter } from '@jbpark/ui-kit';

<div style={{ height: 256 }}>
<Splitter>
<Splitter.Panel defaultSize="30%" minSize="20%">
Sidebar
</Splitter.Panel>
<Splitter.Panel defaultSize="70%" minSize="30%">
Content
</Splitter.Panel>
</Splitter>
</div>;
Sidebar
Content

Props

Splitter

PropTypeDefault
orientation'horizontal' | 'vertical''horizontal'
withHandleboolean (show the grip on handles)true
handleReactNode (custom handle content)-
handleClassNamestring-
onResize(layout) => void (during drag)-
onResizeEnd(layout) => void (drag finished)-
classNamestring-
childrenReactNode (Splitter.Panels)-

Splitter.Panel

PropTypeDefault
defaultSizestring | number-
minSizestring | number-
maxSizestring | number-
classNamestring-
childrenReactNode-

Splitter.Panel forwards the rest of the underlying resizable panel props. The handle between adjacent panels is added automatically — you only render the panels.