Skip to main content

SplitView

shadow

The Split view element is a versatile component that allows you to create a split view with two or more sections. Provides a divider slider that allows you to dynamically resize sections. Two orientations are supported - vertical and horizontal, and nesting another SplitView to create more complex views.

Basic usage

Vertical SplitView

Two orientations are supported. Add the vertical attribute to display a vertical SplitView.

Min/Max

Adding the min and max properties with values "0" to "100" will limit the range of motion of the separator.

Disabled

Adding the disabled attribute disables the ability to scroll the separator.

Nested SplitView

By nesting another SplitView, more complex views can be created.

Editing styles

Attributes and Properties

initial

DescriptionInitial value of the distribution in percentage.
Attributeinitial
Typenumber
Default50

Events

No events available for this component.

Methods

pixelsToPercentage

DescriptionConverts the pixel value to a percentage.
SignaturepixelsToPercentage(value: number) => number

CSS Shadow Parts

NameDescription
dividerRefers to the slider.

CSS Custom Properties

NameDescription
--wje-split-view-divider-areaDefines the interactive area (hitbox) of the resizing slider. Accepts any valid CSS length unit (e.g., px, rem, %).
--wje-split-view-divider-widthSpecifies the visual width of the slider. Controls the display thickness of the slider.
--wje-split-view-minSets the minimum size for split views. Ensures that the view cannot be scaled below this value.
--wje-split-view-maxSets the maximum size for split views. Ensures that the view cannot be enlarged beyond this value.
--wje-split-view-calc-aRepresents the calculated size of the first view. It is used to dynamically adjust the size of the first view.
--wje-split-view-calc-bRepresents the calculated size of the second view. It is used to dynamically adjust the size of the second view.
--wje-split-view-clamp-aLimits the size of the first view between the minimum and maximum limits. Ensures that the calculated size remains within the defined range.
--wje-split-view-clamp-bLimits the size of the second view between the minimum and maximum limits. Ensures that the calculated size remains within the defined range.
--wje-split-view-divider-backgroundSets the background color of the slider. Accepts any valid CSS color value (e.g., hex, RGB, or CSS variable).
--wje-split-view-divider-sizeDefines the overall size of the slider, affecting its visual and interactive dimensions. Accepts any valid CSS length unit.

Slots

NameDescription
startSlot for initial display.
endSlot for end display.
dividerSlot for slider.