A splitter component that provides a resizable split-pane layout, dividing the view into two panels - start and end - separated by a draggable bar.
Panels can be resized by dragging the bar, using keyboard shortcuts, or collapsed/expanded
using the built-in collapse buttons or the programmatic toggle() API.
Nested splitters are supported for more complex layouts.
Keyboard interactions
When the splitter bar is focused:
| Key | Action |
|---|---|
Arrow Left / Arrow Right |
Resize panes (horizontal orientation) |
Arrow Up / Arrow Down |
Resize panes (vertical orientation) |
Home |
Snap start pane to its minimum size |
End |
Snap start pane to its maximum size |
Ctrl + Arrow Left / Ctrl + Arrow Up |
Expand the end pane if it is collapsed, else toggle the start pane |
Ctrl + Arrow Right / Ctrl + Arrow Down |
Expand the start pane if it is collapsed, else toggle the end pane |
In a right-to-left context, Arrow Left and Arrow Right swap their actions.
- Element
-
igc-splitter
- Slots
-
start— Content projected into the start panel, at the inline start or the top. -
end— Content projected into the end panel, at the inline end or the bottom.
- CSS Parts
-
base— The container of the panels and the splitter bar. -
splitter-bar— The resizable bar element between the two panels. -
drag-handle— The drag handle icon/element on the splitter bar. -
start-pane— The container for the start panel content. -
end-pane— The container for the end panel content. -
start-collapse-btn— The button to collapse the start panel. -
end-collapse-btn— The button to collapse the end panel. -
start-expand-btn— The button to expand the start panel when collapsed. -
end-expand-btn— The button to expand the end panel when collapsed.
Remarks
The bar holds two expander elements, one on either side of the drag handle,
and each carries whichever part name applies to the current collapsed state.
A part name is therefore not tied to a fixed side: with the end pane
collapsed, end-expand-btn lands on the first of the two.
Example
<!-- Basic horizontal splitter -->
<igc-splitter>
<div slot="start">Start panel</div>
<div slot="end">End panel</div>
</igc-splitter> Properties
Section titled "Properties"disableCollapse
Section titled "disableCollapse"Whether collapsing either pane is disabled. When true, this also hides
the expand/collapse buttons on the splitter bar.
disableCollapse: boolean = false Defined in src/components/splitter/splitter.ts:277
disableResize
Section titled "disableResize"Whether resizing the panes by dragging the splitter bar or using keyboard
shortcuts is disabled. When true, this also hides the drag handle on the
splitter bar.
disableResize: boolean = false Defined in src/components/splitter/splitter.ts:287
Optional endMaxSize
Section titled "endMaxSize"The maximum size of the end pane.
Accepts a CSS length with an explicit unit, e.g. 500px or 80%, or a
unitless 0. Setting auto, any other unitless or unparsable value, a
negative value, or a percentage above 100 removes the constraint.
endMaxSize: string = undefined Defined in src/components/splitter/splitter.ts:364
Optional endMinSize
Section titled "endMinSize"The minimum size of the end pane.
Accepts a CSS length with an explicit unit, e.g. 100px or 20%, or a
unitless 0. Setting auto, any other unitless or unparsable value, a
negative value, or a percentage above 100 removes the constraint.
endMinSize: string = undefined Defined in src/components/splitter/splitter.ts:340
hideCollapseButtons
Section titled "hideCollapseButtons"Whether the expand/collapse buttons on the splitter bar are hidden.
The buttons are also hidden when disable-collapse is true. While a pane
is collapsed, only its expand button shows.
hideCollapseButtons: boolean = false Defined in src/components/splitter/splitter.ts:302
hideDragHandle
Section titled "hideDragHandle"Whether the drag handle on the splitter bar is hidden.
The drag handle is also hidden when disable-resize is true.
hideDragHandle: boolean = false Defined in src/components/splitter/splitter.ts:316
orientation
Section titled "orientation"The orientation of the splitter, which determines the direction of resizing and collapsing.
Changing the orientation after the initial render returns the panes to the
sizes set through startSize and endSize, or to automatic sizing. The
sizes from a drag, a key press or a collapse were measured on the other
axis, so they are dropped. The minimum and maximum sizes stay.
orientation: SplitterOrientation = 'horizontal' Defined in src/components/splitter/splitter.ts:268
Optional startMaxSize
Section titled "startMaxSize"The maximum size of the start pane.
Accepts a CSS length with an explicit unit, e.g. 500px or 80%, or a
unitless 0. Setting auto, any other unitless or unparsable value, a
negative value, or a percentage above 100 removes the constraint.
startMaxSize: string = undefined Defined in src/components/splitter/splitter.ts:352
Optional startMinSize
Section titled "startMinSize"The minimum size of the start pane.
Accepts a CSS length with an explicit unit, e.g. 100px or 20%, or a
unitless 0. Setting auto, any other unitless or unparsable value, a
negative value, or a percentage above 100 removes the constraint.
startMinSize: string = undefined Defined in src/components/splitter/splitter.ts:328
tagName
Section titled "tagName"The tagName read-only property of the Element interface returns the tag name of the element on which it's called.
tagName: "igc-splitter" = 'igc-splitter' Defined in src/components/splitter/splitter.ts:194
Accessors
Section titled "Accessors"endCollapsed
Section titled "endCollapsed"get endCollapsed(): any Defined in src/components/splitter/splitter.ts:422
Whether the end pane is currently collapsed. Set this property to collapse or expand the pane programmatically.
set endCollapsed(value: boolean): void Defined in src/components/splitter/splitter.ts:422
Parameters
- value:
boolean
Returns void
endSize
Section titled "endSize"get endSize(): any Defined in src/components/splitter/splitter.ts:392
The size of the end pane.
Accepts a CSS length with an explicit unit, e.g. 200px or 50%, or a
unitless 0. Setting auto, any other unitless or unparsable value, a
negative value, or a percentage above 100 falls back to automatic sizing.
set endSize(value: string | undefined): void Defined in src/components/splitter/splitter.ts:392
Parameters
- value:
string | undefined
Returns void
startCollapsed
Section titled "startCollapsed"get startCollapsed(): any Defined in src/components/splitter/splitter.ts:407
Whether the start pane is currently collapsed. Set this property to collapse or expand the pane programmatically.
set startCollapsed(value: boolean): void Defined in src/components/splitter/splitter.ts:407
Parameters
- value:
boolean
Returns void
startSize
Section titled "startSize"get startSize(): any Defined in src/components/splitter/splitter.ts:375
The size of the start pane.
Accepts a CSS length with an explicit unit, e.g. 200px or 50%, or a
unitless 0. Setting auto, any other unitless or unparsable value, a
negative value, or a percentage above 100 falls back to automatic sizing.
set startSize(value: string | undefined): void Defined in src/components/splitter/splitter.ts:375
Parameters
- value:
string | undefined
Returns void
Methods
Section titled "Methods"disconnectedCallback
Section titled "disconnectedCallback"Invoked when the component is removed from the document's DOM.
This callback is the main signal to the element that it may no longer be
used. disconnectedCallback() should ensure that nothing is holding a
reference to the element (such as event listeners added to nodes external
to the element), so that it is free to be garbage collected.
``
An element may be re-connected after being disconnected.
disconnectedCallback(): void Defined in src/components/splitter/splitter.ts:499
Returns void
toggle
Section titled "toggle"Toggles the collapsed state of the specified pane.
Does not emit igcLayoutChanged - that event reports user-driven changes,
and a programmatic call is already known to the caller.
toggle(position: PanePosition): void Defined in src/components/splitter/splitter.ts:1040
Parameters
- position:
PanePosition