Splitter API

API documentation for Splitter component

Splitter#

Props#

Defines valid properties in Splitter component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: SplitterInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: SplitterInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<SplitterPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: SplitterInstance) => ReactNode)
null
The children to render.
orientation"horizontal" | "vertical"
horizontal
Orientation of the panels.
gutterSizenumber
4
Size of the divider in pixels.
stateKeystring
null
Storage identifier of a stateful Splitter.
stateStorage"local" | "session"
session
Defines where a stateful splitter keeps its state, valid values are 'session' for sessionStorage and 'local' for localStorage.
stepnumber
5
Step factor to increment/decrement the size of the panels while pressing the arrow keys.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

State#

Defines valid state in Splitter component.

nametypedefaultdescription
panelsReactNode[]
null

Exposes#

Defines the methods and properties exposed by Splitter component.

nametypedefaultdescription
stateuseSplitterState
null
The state of the useSplitter.
registerPanel() => number
null
Registers a new panel and returns its index.
registerGutter() => number
null
Registers a new gutter and returns its index.
registerThumb() => number
null
Registers a new thumb and returns its index.
panelCounterRefObject<number>
null
Counter tracking the number of panels.
panelSizesnumber[]
null
Array storing the size of each panel.
prevSizenumber
null
Previous size of the panel during resize.
gutterRefRefObject<HTMLDivElement>
null
Reference to the currently active gutter element.
gutterRefsRefObject<HTMLDivElement[]>
null
References to all gutter elements.
onResizeStart(event: MouseEvent<Element, MouseEvent> | TouchEvent<Element> | KeyboardEvent, index: number, isKeyDown: boolean) => void
null
Handler for resize start events.
onResize(event: MouseEvent<Element, MouseEvent> | TouchEvent<Element> | KeyboardEvent, step: number, isKeyDown: boolean) => void
null
Handler for resize events.
onResizeEnd() => void
null
Handler for resize end events.
onGutterMouseDown(event: MouseEvent, index: number) => void
null
Handler for mouse down events on gutters.
onGutterTouchStart(event: TouchEvent, index: number) => void
null
Handler for touch start events on gutters.
onGutterTouchMove(event: TouchEvent) => void
null
Handler for touch move events on gutters.
onGutterTouchEnd(event: TouchEvent) => void
null
Handler for touch end events on gutters.
onGutterKeyUp() => void
null
Handler for key up events on gutters.
onGutterKeyDown(event: KeyboardEvent, index: number) => void
null
Handler for key down events on gutters.

Interfaces#

Defines passthrough(pt) options of Splitter component.

nametypedefaultdescription
rootSplitterPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.
panelSplitterPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the panel's DOM element.
gutterSplitterPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the gutter's DOM element.
thumbSplitterPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the thumb's DOM element.

Types#

Instance of Splitter component.

values
ComponentInstance<SplitterProps, SplitterState, SplitterExposes>

SplitterPanel#

Props#

Defines valid properties in SplitterPanel component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: SplitterPanelInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: SplitterPanelInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<SplitterPanelPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: SplitterPanelInstance) => ReactNode)
null
The children to render.
sizenumber
null
Size of the element relative to 100%.
minSizenumber
null
Minimum size of the element relative to 100%.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by SplitterPanel component.

nametypedefaultdescription
splitterSplitterInstance
null
The Splitter component instance.

Interfaces#

Defines passthrough(pt) options of SplitterPanel component.

nametypedefaultdescription
rootSplitterPanelPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of SplitterPanel component.

values
ComponentInstance<SplitterPanelProps, SplitterPanelState, SplitterPanelExposes>

SplitterGutter#

Props#

Defines valid properties in SplitterGutter component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: SplitterGutterInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: SplitterGutterInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<SplitterGutterPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: SplitterGutterInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by SplitterGutter component.

nametypedefaultdescription
splitterSplitterInstance
null
The Splitter component instance.

Interfaces#

Defines passthrough(pt) options of SplitterGutter component.

nametypedefaultdescription
rootSplitterGutterPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of SplitterGutter component.

values
ComponentInstance<SplitterGutterProps, SplitterGutterState, SplitterGutterExposes>

SplitterThumb#

Props#

Defines valid properties in SplitterThumb component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: SplitterThumbInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: SplitterThumbInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<SplitterThumbPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: SplitterThumbInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by SplitterThumb component.

nametypedefaultdescription
splitterSplitterInstance
null
The Splitter component instance.

Interfaces#

Defines passthrough(pt) options of SplitterThumb component.

nametypedefaultdescription
rootSplitterThumbPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of SplitterThumb component.

values
ComponentInstance<SplitterThumbProps, SplitterThumbState, SplitterThumbExposes>

useSplitter#

Props#

Defines valid properties in useSplitter.

nametypedefaultdescription
orientation"horizontal" | "vertical"
horizontal
Orientation of the panels.
gutterSizenumber
4
Size of the divider in pixels.
stateKeystring
null
Storage identifier of a stateful Splitter.
stateStorage"local" | "session"
session
Defines where a stateful splitter keeps its state, valid values are 'session' for sessionStorage and 'local' for localStorage.
stepnumber
5
Step factor to increment/decrement the size of the panels while pressing the arrow keys.

State#

Defines valid state in useSplitter.

nametypedefaultdescription
panelsReactNode[]
null

Exposes#

Defines the methods and properties exposed by useSplitter.

nametypedefaultdescription
stateuseSplitterState
null
The state of the useSplitter.
registerPanel() => number
null
Registers a new panel and returns its index.
registerGutter() => number
null
Registers a new gutter and returns its index.
registerThumb() => number
null
Registers a new thumb and returns its index.
panelCounterRefObject<number>
null
Counter tracking the number of panels.
panelSizesnumber[]
null
Array storing the size of each panel.
prevSizenumber
null
Previous size of the panel during resize.
gutterRefRefObject<HTMLDivElement>
null
Reference to the currently active gutter element.
gutterRefsRefObject<HTMLDivElement[]>
null
References to all gutter elements.
onResizeStart(event: MouseEvent<Element, MouseEvent> | TouchEvent<Element> | KeyboardEvent, index: number, isKeyDown: boolean) => void
null
Handler for resize start events.
onResize(event: MouseEvent<Element, MouseEvent> | TouchEvent<Element> | KeyboardEvent, step: number, isKeyDown: boolean) => void
null
Handler for resize events.
onResizeEnd() => void
null
Handler for resize end events.
onGutterMouseDown(event: MouseEvent, index: number) => void
null
Handler for mouse down events on gutters.
onGutterTouchStart(event: TouchEvent, index: number) => void
null
Handler for touch start events on gutters.
onGutterTouchMove(event: TouchEvent) => void
null
Handler for touch move events on gutters.
onGutterTouchEnd(event: TouchEvent) => void
null
Handler for touch end events on gutters.
onGutterKeyUp() => void
null
Handler for key up events on gutters.
onGutterKeyDown(event: KeyboardEvent, index: number) => void
null
Handler for key down events on gutters.

Events#

Types#

Instance of useSplitter headless.

values
HeadlessInstance<useSplitterProps, useSplitterState, useSplitterExposes>