useSplitter

Resize two panes by dragging the handle between them, in percent of the container.

This is custom React hooks, you need to follow the Basic Rules when you use it.

General

Drag the bar to resize the panes.

APIs

useSplitter

const useSplitter = <
  C extends HTMLElement = HTMLElement,
  H extends HTMLElement = HTMLElement,
>(options?: {
  initialSize?: number
  min?: number
  max?: number
  direction?: 'horizontal' | 'vertical'
}) => {
  containerRef: RefObject<C | null>
  handleRef: RefObject<H | null>
  size: number
  dragging: boolean
}
Edit this page on GitHub