Components
Splitter

Splitter

The Splitter is a flexible and dynamic component that allows division of the screen or a section into multiple resizable areas.

API reference docs for the component. Learn about the props, CSS, and other APIs of this exported module.

SplitterProps

defaultSize

PanelSizeData[]

dir

'ltr' | 'rtl'

The document's text/writing direction.

getRootNode

() => ShadowRoot | Node | Document

A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron.

id

string

The unique identifier of the machine.

ids

Partial<{ root: string resizeTrigger(id: string): string label(id: string): string panel(id: string | number): string }>

The ids of the elements in the splitter. Useful for composition.

onSizeChange

(details: SizeChangeDetails) => void

Function called when the splitter is resized.

onSizeChangeEnd

(details: SizeChangeDetails) => void

Function called when the splitter resize ends.

onSizeChangeStart

(details: SizeChangeDetails) => void

Function called when the splitter resize starts.

orientation

'horizontal' | 'vertical'

The orientation of the splitter. Can be `horizontal` or `vertical`

size

PanelSizeData[]

The size data of the panels

SplitterContext

getPanelProps

(props: PanelProps) => Dict<any>

getResizeTriggerProps

(props: ResizeTriggerProps) => Dict<any>

getResizeTriggerState

(props: ResizeTriggerProps) => ResizeTriggerState

Returns the state details for a resize trigger.

isDragging

boolean

Whether the splitter is being dragged.

isFocused

boolean

Whether the splitter is focused.

rootProps

Dict<any>

setSize

(id: PanelId, size: number) => void

Function to set the size of a panel.

setToMaxSize

(id: PanelId) => void

Function to set a panel to its maximum size.

setToMinSize

(id: PanelId) => void

Function to set a panel to its minimum size.

bounds

PanelBounds

The bounds of the currently dragged splitter handle.

SplitterPanelProps

id

PanelId

snapSize

number

SplitterResizeTriggerProps

id

type ONLY_FOR_FORMAT = | `${string}:${string}` | `${string}:${number}` | `${number}:${string}` | `${number}:${number}`

disabled

boolean

step

number