Splitter JAVASCRIPT UI Component API

Splitter Javascript API

Class

Splitter

Splitter is a layout component that supports all important features such as resizing, collapsing, and nesting panels.

Selector

smart-splitter

Properties

AanimationSpecifies or retrieves the current animation mode. When the property is set to 'none', all animations are disabled, resulting in static display without transition effects. Assigning any other valid value enables the corresponding animation mode.
AautoFitModeSpecifies how items are positioned and resized within the Splitter component.Possible values: end – All items are resized to fit exactly within the available space of the Splitter. When a new item is inserted, the required space is taken from the adjacent (neighboring) item, adjusting their sizes so that the total size remains constant and nothing overflows. proportional – All items expand or contract proportionally to occupy the full size of the Splitter. When a new item is added, the space it needs is proportionally deducted from the existing items, maintaining their relative sizes within the total available space. overflow – Items are not resized to fit the Splitter. Instead, each item retains its natural size, even if the total size exceeds the Splitter’s dimensions. In this case, a scrollbar will appear, allowing users to scroll and view all the content that overflows beyond the visible area.
DdisabledDetermines whether the element is interactive or inactive. When enabled, users can interact with the element; when disabled, the element is non-interactive and typically appears visually distinct (e.g., grayed out) to indicate its inactive state.
DdataSourceConfigures or retrieves the data source for the splitter component. When setting, it specifies the structure and content (such as panels or sections) that will be managed and displayed within the splitter. When getting, it returns the current data source used by the splitter.
IitemsA getter method that retrieves and returns an array containing all the current Splitter items. This allows you to access the complete list of items managed by the Splitter component.
KkeepProportionsOnResizeWhen enabled, this setting ensures that all items within the element maintain their original aspect ratios relative to each other whenever the element is resized. This behavior is preserved regardless of whether the size properties of the items are defined in pixels, percentages, or other units. In other words, resizing the overall element will proportionally scale all its child items, keeping their relative dimensions consistent.
UunlockKeySets or retrieves the unlockKey value used to authorize and enable access to the product's features. When setting, this key unlocks the product for use. When getting, it returns the currently assigned unlockKey.
LlocaleSpecifies the language to be used for displaying messages. This property can be set to change the current language or retrieved to identify the active language. It works in conjunction with the messages property, which contains localized message strings for each supported language. Adjusting this property enables seamless switching between different language options in the application’s user interface.
LlocalizeFormatFunctionCallback function associated with the localization module, typically used to handle language changes, translate content, or process localization-related events within the application.
MmessagesDefines an object that maps password strength states to their corresponding string values. Each key in the object represents a specific password strength level (such as "weak," "medium," or "strong"), and its value provides the associated descriptive label or message to display to users. This allows for customizable text based on the current password strength state.
OorientationSets or retrieves the orientation of the splitter, determining whether it is displayed vertically (dividing the area into left and right sections) or horizontally (dividing the area into top and bottom sections).
RreadonlyWhen the element has the 'readonly' attribute, users can view its value but cannot modify, edit, or otherwise change its contents. However, the element may still be focused and its content can be selected and copied by the user. No direct interaction—such as typing, pasting, or deleting—is allowed.
RresizeMode'Specifies how the splitter handles resizing when a user drags the splitter bar. The available modes are:'- 'None:' Resizing is disabled; splitter bars cannot be moved.- 'Adjacent (default):' Only the two panels immediately adjacent to the splitter bar are resized when the bar is dragged. Other panels remain unchanged.- 'End:' Dragging the splitter bar affects only the first panel (located at the left or top, depending on splitter orientation) and the last panel. All intermediate panels between these two remain unaffected.- 'Proportional:' All panels located in the direction the splitter bar is dragged (for example, all panels to the right if dragging right, or below if dragging down) are resized proportionally. The new sizes are calculated based on the current size ratios of these panels, ensuring they maintain their proportional widths or heights relative to each other after resizing.'Use this property to control which panels are resized and how space is distributed when users interact with the splitter.'
RresizeStepSpecifies the increment or decrement value by which the element's size changes during a resize operation. This value controls how much the element grows or shrinks with each resizing step, allowing for precise adjustments.
RrightToLeftGets or sets a value that specifies whether the element's alignment should accommodate right-to-left (RTL) languages, such as Arabic or Hebrew. When enabled, the element's content and layout will adjust to support RTL text direction, ensuring proper display for locales that use right-to-left scripts.
LliveResizeWhen this feature is enabled, the resizing operation updates the layout in real-time as the user drags the splitter, providing immediate visual feedback. By default, live resizing is disabled; instead, a highlighted guide bar appears during the drag operation, showing where the splitter will be positioned once the user releases the mouse button. The actual layout is only updated after the drag is complete.
TthemeSpecifies the theme for the element. The theme determines the overall appearance, including colors, fonts, and styling, to ensure a consistent and visually appealing look.
UunfocusableIf set to true, the element will be excluded from keyboard navigation and cannot receive focus via keyboard or mouse interactions.

Events

CcollapseThis event is triggered when a splitter item is collapsed by the user, either through a UI interaction (such as clicking a collapse button) or programmatically. It allows you to execute custom logic or respond to the change when a particular panel within the splitter component is minimized or hidden.
EexpandThis event is triggered whenever a splitter item is expanded by the user, either through interaction (such as clicking or dragging) or programmatically. It allows developers to execute custom logic in response to the expansion of a specific splitter item within the UI component.
RresizeStartThis event is triggered when a user initiates the resizing of a splitter component, such as clicking and dragging the divider to adjust the size of adjacent panels. It marks the start of the resizing interaction, allowing developers to perform actions or apply styles in response to the beginning of the splitter's adjustment process.
RresizeEndThis event is triggered after the user completes resizing the splitter, indicating that the resizing action has finished and the new panel sizes have been set.

Methods

CcollapseCollapses the specified splitter panel, minimizing its size and hiding its content within the container or layout.
EexpandAttempts to expand the splitter item, provided sufficient space is available. The expansion is only performed if there is enough remaining space in the container to accommodate the item's increased size.
HhideBarConceals the splitter bar element from view, preventing users from interacting with or resizing the associated panels.
IinsertInserts a new Splitter component into the specified position within the layout, allowing the user to divide and resize adjacent sections of the interface.
LlockItemPrevents a splitter item from being resized by the user, ensuring that its current size remains fixed and unchangeable during layout adjustments.
LlockBarPrevents the splitter bar from being moved by disabling user drag interactions, effectively locking its position and ensuring that adjacent panes cannot be resized.
RremoveAtRemoves a Splitter item from the layout, detaching it from its parent container and updating the interface accordingly. This action permanently deletes the specified Splitter component and any associated layout adjustments.
RremoveAllClears all items currently contained within the Splitter component, effectively resetting it to an empty state. This operation removes every panel, section, or child element inside the Splitter, leaving no content displayed.
RrefreshReloads and updates the Splitter component, re-rendering its layout and recalculating its size and position to reflect any recent changes to its content, configuration, or container.
SshowBarReveals a previously hidden splitter bar, allowing users to resize adjacent panes or sections within the interface.
UunlockItemEnables access to a splitter item that was previously locked, allowing users to interact with or modify the item as intended. This action removes any restrictions, making the splitter fully functional within the application.
UunlockBarEnables user interaction with a previously disabled or locked splitter bar, allowing users to adjust the size of adjacent panes or panels by dragging the splitter.
UupdateUpdates the configuration of a specific Splitter item within a Splitter component, allowing changes to its properties such as size, orientation, minimum and maximum limits, or other customizable options. This enables dynamic adjustment of the Splitter item's behavior and appearance within the parent Splitter layout.

Properties

animation"none" | "simple" | "advanced"

Specifies or retrieves the current animation mode. When the property is set to 'none', all animations are disabled, resulting in static display without transition effects. Assigning any other valid value enables the corresponding animation mode.

Allowed Values

  • "none" - animation is disabled
  • "simple" - ripple animation is disabled
  • "advanced" - all animations are enabled

Default value

"advanced"

Example

Set the animation property.

 <smart-splitter animation='none'></smart-splitter>

Set the animation property by using the HTML Element's instance.

 const splitter = document.querySelector('smart-splitter');
 splitter.animation = 'simple';

Get the animation property.

 const splitter = document.querySelector('smart-splitter');
 let animation = splitter.animation;

autoFitMode"end" | "proportional" | "overflow"

Specifies how items are positioned and resized within the Splitter component.

Possible values:



  • end – All items are resized to fit exactly within the available space of the Splitter. When a new item is inserted, the required space is taken from the adjacent (neighboring) item, adjusting their sizes so that the total size remains constant and nothing overflows.


  • proportional – All items expand or contract proportionally to occupy the full size of the Splitter. When a new item is added, the space it needs is proportionally deducted from the existing items, maintaining their relative sizes within the total available space.


  • overflow – Items are not resized to fit the Splitter. Instead, each item retains its natural size, even if the total size exceeds the Splitter’s dimensions. In this case, a scrollbar will appear, allowing users to scroll and view all the content that overflows beyond the visible area.

Default value

"proportional"

Example

Set the autoFitMode property.

 <smart-splitter auto-fit-mode='end'></smart-splitter>

Set the autoFitMode property by using the HTML Element's instance.

 const splitter = document.querySelector('smart-splitter');
 splitter.autoFitMode = 'proportional';

Get the autoFitMode property.

 const splitter = document.querySelector('smart-splitter');
 let autoFitMode = splitter.autoFitMode;

disabledboolean

Determines whether the element is interactive or inactive. When enabled, users can interact with the element; when disabled, the element is non-interactive and typically appears visually distinct (e.g., grayed out) to indicate its inactive state.

Default value

false

Example

Set the disabled property.

 <smart-splitter disabled></smart-splitter>

Set the disabled property by using the HTML Element's instance.

 const splitter = document.querySelector('smart-splitter');
 splitter.disabled = false;

Get the disabled property.

 const splitter = document.querySelector('smart-splitter');
 let disabled = splitter.disabled;

dataSourcearray

Configures or retrieves the data source for the splitter component. When setting, it specifies the structure and content (such as panels or sections) that will be managed and displayed within the splitter. When getting, it returns the current data source used by the splitter.

Example

Set the dataSource property.

 <smart-splitter data-source='[object Object],[object Object]'></smart-splitter>

Set the dataSource property by using the HTML Element's instance.

 const splitter = document.querySelector('smart-splitter');
 splitter.dataSource = [object Object],[object Object],[object Object];

Get the dataSource property.

 const splitter = document.querySelector('smart-splitter');
 let dataSource = splitter.dataSource;

itemsarray

A getter method that retrieves and returns an array containing all the current Splitter items. This allows you to access the complete list of items managed by the Splitter component.

Default value

keepProportionsOnResizeboolean

When enabled, this setting ensures that all items within the element maintain their original aspect ratios relative to each other whenever the element is resized. This behavior is preserved regardless of whether the size properties of the items are defined in pixels, percentages, or other units. In other words, resizing the overall element will proportionally scale all its child items, keeping their relative dimensions consistent.

Default value

false

Example

Set the keepProportionsOnResize property.

 <smart-splitter keep-proportions-on-resize></smart-splitter>

Set the keepProportionsOnResize property by using the HTML Element's instance.

 const splitter = document.querySelector('smart-splitter');
 splitter.keepProportionsOnResize = false;

Get the keepProportionsOnResize property.

 const splitter = document.querySelector('smart-splitter');
 let keepProportionsOnResize = splitter.keepProportionsOnResize;

unlockKeystring

Sets or retrieves the unlockKey value used to authorize and enable access to the product's features. When setting, this key unlocks the product for use. When getting, it returns the currently assigned unlockKey.

Default value

""

Example

Set the unlockKey property.

 <smart-splitter unlock-key=''></smart-splitter>

Set the unlockKey property by using the HTML Element's instance.

 const splitter = document.querySelector('smart-splitter');
 splitter.unlockKey = '1111-2222-3333-4444-5555';

Get the unlockKey property.

 const splitter = document.querySelector('smart-splitter');
 let unlockKey = splitter.unlockKey;

localestring

Specifies the language to be used for displaying messages. This property can be set to change the current language or retrieved to identify the active language. It works in conjunction with the messages property, which contains localized message strings for each supported language. Adjusting this property enables seamless switching between different language options in the application’s user interface.

Default value

"en"

Example

Set the locale property.

 <smart-splitter locale='de'></smart-splitter>

Set the locale property by using the HTML Element's instance.

 const splitter = document.querySelector('smart-splitter');
 splitter.locale = 'fr';

Get the locale property.

 const splitter = document.querySelector('smart-splitter');
 let locale = splitter.locale;

localizeFormatFunctionfunction | null

Callback function associated with the localization module, typically used to handle language changes, translate content, or process localization-related events within the application.

Example

Set the localizeFormatFunction property.

 <smart-splitter localize-format-function='function(){return '...'}'></smart-splitter>

Set the localizeFormatFunction property by using the HTML Element's instance.

 const splitter = document.querySelector('smart-splitter');
 splitter.localizeFormatFunction = function(){return '...'};

Get the localizeFormatFunction property.

 const splitter = document.querySelector('smart-splitter');
 let localizeFormatFunction = splitter.localizeFormatFunction;

messagesobject

Defines an object that maps password strength states to their corresponding string values. Each key in the object represents a specific password strength level (such as "weak," "medium," or "strong"), and its value provides the associated descriptive label or message to display to users. This allows for customizable text based on the current password strength state.

Default value




"en": {

"propertyUnknownType": "'{{name}}' property is with undefined 'type' member!",

"propertyInvalidValue": "Invalid '{{name}}' property value! Actual value: {{actualValue}}, Expected value: {{value}}!",

"propertyInvalidValueType": "Invalid '{{name}}' property value type! Actual type: {{actualType}}, Expected type: {{type}}!",

"elementNotInDOM": "Element does not exist in DOM! Please, add the element to the DOM, before invoking a method.",

"moduleUndefined": "Module is undefined.",

"missingReference": "{{elementType}}: Missing reference to {{files}}.",

"htmlTemplateNotSuported": "{{elementType}}: Browser doesn't support HTMLTemplate elements.",

"invalidTemplate": "{{elementType}}: '{{property}}' property accepts a string that must match the id of an HTMLTemplate element from the DOM.",

"invalidIndex": "{{elementType}}: '{{method}}' method accepts an index of type number.",

"indexOutOfBound": "{{elementType}}: Out of bound index/indexes in '{{method}}' method.",

"invalidNode": "{{elementType}}: '{{method}}' method accepts an object or an array of objects as it's second parameter.",

"invalidSettings": "{{elementType}}: '{{method}}' method accepts a string or an object as it's second parameter.",

"invalidType": "{{elementType}}: '{{propertyName}}' must be of type string or number."

}

Example

Set the messages property.

 <smart-splitter messages='{"de":{"propertyUnknownType":"Die Eigenschaft '{{name}}' hat ein nicht definiertes 'type'-Member!","propertyInvalidValue":"Ungultiger Eigenschaftswert '{{name}}'! Aktueller Wert: {{actualValue}}, Erwarteter Wert: {{value}}!","propertyInvalidValueType":"Ungultiger Eigenschaftswert '{{name}}'! Aktueller Wert: {{actualType}}, Erwarteter Wert: {{type}}!","elementNotInDOM":"Element existiert nicht in DOM! Bitte fugen Sie das Element zum DOM hinzu, bevor Sie eine Methode aufrufen.","moduleUndefined":"Modul ist nicht definiert.","missingReference":"{{elementType}}: Fehlender Verweis auf {{files}}.","htmlTemplateNotSuported":"{{elementType}}: Browser unterstutzt keine HTMLTemplate-Elemente.","invalidTemplate":"{{elementType}}: '{{property}}' Die Eigenschaft akzeptiert eine Zeichenfolge, die mit der ID eines HTMLTemplate-Elements aus dem DOM ubereinstimmen muss.","invalidIndex":"{{elementType}}: '{{method}}' Methode akzeptiert einen Index der Typennummer.","indexOutOfBound":"{{elementType}}: Nicht gebundener Index / Indizes in Methode '{{method}}'.","invalidNode":"{{elementType}}: '{{method}}' Die Methode akzeptiert ein Objekt oder ein Array von Objekten als zweiten Parameter.","invalidSettings":"{{elementType}}: '{{method}}' 1  62/5000 Die Methode akzeptiert einen string oder ein Objekt als zweiten Parameter.","invalidType":"{{elementType}}: '{{propertyName}}' muss vom Typ string oder Nummer sein."}}'></smart-splitter>

Set the messages property by using the HTML Element's instance.

 const splitter = document.querySelector('smart-splitter');
 splitter.messages = {"en":{"propertyUnknownType":"'{{name}}' property is with undefined 'type' member!","propertyInvalidValue":"Invalid '{{name}}' property value! Actual value: {{actualValue}}, Expected value: {{value}}!","propertyInvalidValueType":"Invalid '{{name}}' property value type! Actual type: {{actualType}}, Expected type: {{type}}!","elementNotInDOM":"Element does not exist in DOM! Please, add the element to the DOM, before invoking a method.","moduleUndefined":"Module is undefined.","missingReference":"{{elementType}}: Missing reference to {{files}}.","htmlTemplateNotSuported":"{{elementType}}: Browser doesn't support HTMLTemplate elements.","invalidTemplate":"{{elementType}}: '{{property}}' property accepts a string that must match the id of an HTMLTemplate element from the DOM.","invalidIndex":"{{elementType}}: '{{method}}' method accepts an index of type number.","indexOutOfBound":"{{elementType}}: Out of bound index/indexes in '{{method}}' method.","invalidNode":"{{elementType}}: '{{method}}' method accepts an object or an array of objects as it's second parameter.","invalidSettings":"{{elementType}}: '{{method}}' method accepts a string or an object as it's second parameter.","invalidType":"{{elementType}}: '{{propertyName}}' must be of type string or number."}};

Get the messages property.

 const splitter = document.querySelector('smart-splitter');
 let messages = splitter.messages;

orientation"horizontal" | "vertical"

Sets or retrieves the orientation of the splitter, determining whether it is displayed vertically (dividing the area into left and right sections) or horizontally (dividing the area into top and bottom sections).

Default value

"vertical"

Example

Set the orientation property.

 <smart-splitter orientation='horizontal'></smart-splitter>

Set the orientation property by using the HTML Element's instance.

 const splitter = document.querySelector('smart-splitter');
 splitter.orientation = 'vertical';

Get the orientation property.

 const splitter = document.querySelector('smart-splitter');
 let orientation = splitter.orientation;

readonlyboolean

When the element has the 'readonly' attribute, users can view its value but cannot modify, edit, or otherwise change its contents. However, the element may still be focused and its content can be selected and copied by the user. No direct interaction—such as typing, pasting, or deleting—is allowed.

Default value

false

Example

Set the readonly property.

 <smart-splitter readonly></smart-splitter>

Set the readonly property by using the HTML Element's instance.

 const splitter = document.querySelector('smart-splitter');
 splitter.readonly = true;

Get the readonly property.

 const splitter = document.querySelector('smart-splitter');
 let readonly = splitter.readonly;

resizeMode"none" | "adjacent" | "end" | "proportional"

'Specifies how the splitter handles resizing when a user drags the splitter bar. The available modes are:'

- 'None:' Resizing is disabled; splitter bars cannot be moved.
- 'Adjacent (default):' Only the two panels immediately adjacent to the splitter bar are resized when the bar is dragged. Other panels remain unchanged.
- 'End:' Dragging the splitter bar affects only the first panel (located at the left or top, depending on splitter orientation) and the last panel. All intermediate panels between these two remain unaffected.
- 'Proportional:' All panels located in the direction the splitter bar is dragged (for example, all panels to the right if dragging right, or below if dragging down) are resized proportionally. The new sizes are calculated based on the current size ratios of these panels, ensuring they maintain their proportional widths or heights relative to each other after resizing.

'Use this property to control which panels are resized and how space is distributed when users interact with the splitter.'

Default value

"adjacent"

Example

Set the resizeMode property.

 <smart-splitter resize-mode='end'></smart-splitter>

Set the resizeMode property by using the HTML Element's instance.

 const splitter = document.querySelector('smart-splitter');
 splitter.resizeMode = 'proportional';

Get the resizeMode property.

 const splitter = document.querySelector('smart-splitter');
 let resizeMode = splitter.resizeMode;

resizeStepnumber

Specifies the increment or decrement value by which the element's size changes during a resize operation. This value controls how much the element grows or shrinks with each resizing step, allowing for precise adjustments.

Default value

5

Example

Set the resizeStep property.

 <smart-splitter resize-step='10'></smart-splitter>

Set the resizeStep property by using the HTML Element's instance.

 const splitter = document.querySelector('smart-splitter');
 splitter.resizeStep = 20;

Get the resizeStep property.

 const splitter = document.querySelector('smart-splitter');
 let resizeStep = splitter.resizeStep;

rightToLeftboolean

Gets or sets a value that specifies whether the element's alignment should accommodate right-to-left (RTL) languages, such as Arabic or Hebrew. When enabled, the element's content and layout will adjust to support RTL text direction, ensuring proper display for locales that use right-to-left scripts.

Default value

false

Example

Set the rightToLeft property.

 <smart-splitter right-to-left></smart-splitter>

Set the rightToLeft property by using the HTML Element's instance.

 const splitter = document.querySelector('smart-splitter');
 splitter.rightToLeft = false;

Get the rightToLeft property.

 const splitter = document.querySelector('smart-splitter');
 let rightToLeft = splitter.rightToLeft;

liveResizeboolean

When this feature is enabled, the resizing operation updates the layout in real-time as the user drags the splitter, providing immediate visual feedback. By default, live resizing is disabled; instead, a highlighted guide bar appears during the drag operation, showing where the splitter will be positioned once the user releases the mouse button. The actual layout is only updated after the drag is complete.

Default value

false

Example

Set the liveResize property.

 <smart-splitter live-resize></smart-splitter>

Set the liveResize property by using the HTML Element's instance.

 const splitter = document.querySelector('smart-splitter');
 splitter.liveResize = true;

Get the liveResize property.

 const splitter = document.querySelector('smart-splitter');
 let liveResize = splitter.liveResize;

themestring

Specifies the theme for the element. The theme determines the overall appearance, including colors, fonts, and styling, to ensure a consistent and visually appealing look.

Default value

""

Example

Set the theme property.

 <smart-splitter theme='blue'></smart-splitter>

Set the theme property by using the HTML Element's instance.

 const splitter = document.querySelector('smart-splitter');
 splitter.theme = 'red';

Get the theme property.

 const splitter = document.querySelector('smart-splitter');
 let theme = splitter.theme;

unfocusableboolean

If set to true, the element will be excluded from keyboard navigation and cannot receive focus via keyboard or mouse interactions.

Default value

false

Example

Set the unfocusable property.

 <smart-splitter unfocusable></smart-splitter>

Set the unfocusable property by using the HTML Element's instance.

 const splitter = document.querySelector('smart-splitter');
 splitter.unfocusable = false;

Get the unfocusable property.

 const splitter = document.querySelector('smart-splitter');
 let unfocusable = splitter.unfocusable;

Events

collapseCustomEvent

This event is triggered when a splitter item is collapsed by the user, either through a UI interaction (such as clicking a collapse button) or programmatically. It allows you to execute custom logic or respond to the change when a particular panel within the splitter component is minimized or hidden.

  • Bubbles Yes
  • Cancelable No
  • Interface CustomEvent
  • Event handler property onCollapse

Arguments

evCustomEvent

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of collapse event.

const splitter = document.querySelector('smart-splitter');
splitter.addEventListener('collapse', function (event) {
	// event handling code goes here.
})

expandCustomEvent

This event is triggered whenever a splitter item is expanded by the user, either through interaction (such as clicking or dragging) or programmatically. It allows developers to execute custom logic in response to the expansion of a specific splitter item within the UI component.

  • Bubbles Yes
  • Cancelable No
  • Interface CustomEvent
  • Event handler property onExpand

Arguments

evCustomEvent

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of expand event.

const splitter = document.querySelector('smart-splitter');
splitter.addEventListener('expand', function (event) {
	// event handling code goes here.
})

resizeStartCustomEvent

This event is triggered when a user initiates the resizing of a splitter component, such as clicking and dragging the divider to adjust the size of adjacent panels. It marks the start of the resizing interaction, allowing developers to perform actions or apply styles in response to the beginning of the splitter's adjustment process.

  • Bubbles Yes
  • Cancelable No
  • Interface CustomEvent
  • Event handler property onResizeStart

Arguments

evCustomEvent

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of resizeStart event.

const splitter = document.querySelector('smart-splitter');
splitter.addEventListener('resizeStart', function (event) {
	// event handling code goes here.
})

resizeEndCustomEvent

This event is triggered after the user completes resizing the splitter, indicating that the resizing action has finished and the new panel sizes have been set.

  • Bubbles Yes
  • Cancelable No
  • Interface CustomEvent
  • Event handler property onResizeEnd

Arguments

evCustomEvent

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of resizeEnd event.

const splitter = document.querySelector('smart-splitter');
splitter.addEventListener('resizeEnd', function (event) {
	// event handling code goes here.
})

Methods

appendChild( node: Node): T

Arguments

nodeNode

The node to append


collapse( item: any, far?: boolean): void

Collapses the specified splitter panel, minimizing its size and hiding its content within the container or layout.

Arguments

itemany

number indicating the index of the item or an isntance of Smart.SplitterItem

far?boolean

Indicates whether the item should collapse to it's far or near side


Invoke the collapse method.

const splitter = document.querySelector('smart-splitter');
splitter.collapse("1, true");

expand( item: any): void

Attempts to expand the splitter item, provided sufficient space is available. The expansion is only performed if there is enough remaining space in the container to accommodate the item's increased size.

Arguments

itemany

number indicating the index of the item or an isntance of Smart.SplitterItem


Invoke the expand method.

const splitter = document.querySelector('smart-splitter');
splitter.expand("1");

hideBar( splitterBar: number): number

Conceals the splitter bar element from view, preventing users from interacting with or resizing the associated panels.

Arguments

splitterBarnumber

A Smart.SplitterBar instance.

Returnsnumber

Invoke the hideBar method.

const splitter = document.querySelector('smart-splitter');
const result = splitter.hideBar(1);

insert( index: number, details: any): void

Inserts a new Splitter component into the specified position within the layout, allowing the user to divide and resize adjacent sections of the interface.

Arguments

indexnumber

The index at which a new item will be inserted.

detailsany

An Object or string used as content if the splitter item.


Invoke the insert method.

const splitter = document.querySelector('smart-splitter');
splitter.insert(1,{"label":"New TAB","content":"New content"});

insertBefore( newNode: Node, referenceNode?: Node | null): T

Arguments

newNodeNode

The "smart-splitter-item" node to insert.

referenceNode?Node | null

The "smart-splitter-item" node before which newNode is inserted.

ReturnsNode

lockItem( index: number): void

Prevents a splitter item from being resized by the user, ensuring that its current size remains fixed and unchangeable during layout adjustments.

Arguments

indexnumber

The index of a Splitter Bar or it's instance.


Invoke the lockItem method.

const splitter = document.querySelector('smart-splitter');
splitter.lockItem(5);

lockBar( index: number): void

Prevents the splitter bar from being moved by disabling user drag interactions, effectively locking its position and ensuring that adjacent panes cannot be resized.

Arguments

indexnumber

The index of a Splitter Bar or it's instance.


Invoke the lockBar method.

const splitter = document.querySelector('smart-splitter');
splitter.lockBar(5);

removeAt( index: number): void

Removes a Splitter item from the layout, detaching it from its parent container and updating the interface accordingly. This action permanently deletes the specified Splitter component and any associated layout adjustments.

Arguments

indexnumber

An item to be removed.


Invoke the removeAt method.

const splitter = document.querySelector('smart-splitter');
splitter.removeAt(5);

removeAll(): void

Clears all items currently contained within the Splitter component, effectively resetting it to an empty state. This operation removes every panel, section, or child element inside the Splitter, leaving no content displayed.


Invoke the removeAll method.

const splitter = document.querySelector('smart-splitter');
splitter.removeAll();

removeChild( node: Node): T

Arguments

nodeNode

The "smart-splitter-item" node to remove.

ReturnsNode

refresh(): void

Reloads and updates the Splitter component, re-rendering its layout and recalculating its size and position to reflect any recent changes to its content, configuration, or container.


Invoke the refresh method.

const splitter = document.querySelector('smart-splitter');
splitter.refresh();

showBar( splitterBar: number): void

Reveals a previously hidden splitter bar, allowing users to resize adjacent panes or sections within the interface.

Arguments

splitterBarnumber

An instance of a splitter bar.


Invoke the showBar method.

const splitter = document.querySelector('smart-splitter');
splitter.showBar(5);

unlockItem( item: number): void

Enables access to a splitter item that was previously locked, allowing users to interact with or modify the item as intended. This action removes any restrictions, making the splitter fully functional within the application.

Arguments

itemnumber

The index of a Splitter Item or it's instance.


Invoke the unlockItem method.

const splitter = document.querySelector('smart-splitter');
splitter.unlockItem(0);

unlockBar( item: number): void

Enables user interaction with a previously disabled or locked splitter bar, allowing users to adjust the size of adjacent panes or panels by dragging the splitter.

Arguments

itemnumber

The index of a Splitter Bar or it's instance.


Invoke the unlockBar method.

const splitter = document.querySelector('smart-splitter');
splitter.unlockBar(1);

update( item: any, settings: any): void

Updates the configuration of a specific Splitter item within a Splitter component, allowing changes to its properties such as size, orientation, minimum and maximum limits, or other customizable options. This enables dynamic adjustment of the Splitter item's behavior and appearance within the parent Splitter layout.

Arguments

itemany

The index of a Smart.SplitterItem or it's instance.

settingsany

An object containing the properties of a Smart.SplitterItem.


Invoke the update method.

const splitter = document.querySelector('smart-splitter');
splitter.update("0, settings");

CSS Variables

--smart-splitter-default-widthvar()

Default value

"var(--smart-box-width)"

smartSplitter default width

--smart-splitter-default-heightvar()

Default value

"var(--smart-box-height)"

smartSplitter default height

--smart-splitter-bar-sizevar()

Default value

"10px"

The width of the scrollbar when vertical and the height of the scrollbar when horizontal

--smart-splitter-bar-fit-sizevar()

Default value

"100%"

The size of the splitter according to the orientation of the Splitter. By 'default' a SplitterBar fits the size of the Splitter.

--smart-splitter-item-paddingvar()

Default value

"0"

Splitter item padding

--smart-splitter-item-content-paddingvar()

Default value

"0"

Splitter item content padding

--smart-splitter-item-sizevar()

Default value

"auto"

The default size of the Splitter Items


SplitterBar

SplitterBar splits two Split panels in a Splitter.

Selector

smart-splitter-bar

Methods

HhideConceals the splitter bar element from view, preventing users from seeing or interacting with it within the user interface.
SshowReveals a previously hidden splitter bar, allowing users to resize or adjust the layout between adjacent panels or sections within the user interface.
LlockPrevents the splitter bar from being moved or adjusted by the user, ensuring it remains fixed in its current position.
UunlockEnables user interaction with the splitter bar, allowing users to drag and resize adjacent panels or sections within the interface.

Properties

Methods

hide(): void

Conceals the splitter bar element from view, preventing users from seeing or interacting with it within the user interface.


Invoke the hide method.

const splitterbar = document.querySelector('smart-splitter-bar');
splitterbar.hide();

show(): void

Reveals a previously hidden splitter bar, allowing users to resize or adjust the layout between adjacent panels or sections within the user interface.


Invoke the show method.

const splitterbar = document.querySelector('smart-splitter-bar');
splitterbar.show();

lock(): void

Prevents the splitter bar from being moved or adjusted by the user, ensuring it remains fixed in its current position.


Invoke the lock method.

const splitterbar = document.querySelector('smart-splitter-bar');
splitterbar.lock();

unlock(): void

Enables user interaction with the splitter bar, allowing users to drag and resize adjacent panels or sections within the interface.


Invoke the unlock method.

const splitterbar = document.querySelector('smart-splitter-bar');
splitterbar.unlock();

SplitterItem

Splitter Item is a Panel in a Splitter component.

Selector

smart-splitter-item

Properties

DdisabledDetermines whether the element is interactive or not. When enabled, users can interact with the element; when disabled, the element is non-interactive and typically appears visually dimmed or grayed out.
CcollapsedIndicates whether the item is currently collapsed ('true') or expanded ('false'). This property controls the visibility of the item's content in collapsible interfaces or components.
CcollapsibleSpecifies whether the item is collapsible. If set to true, the item can be expanded or collapsed by the user. If set to false, the item remains permanently expanded and cannot be collapsed.
CcontentSpecifies the elements or components that are displayed within each section (item) of the splitter layout. This property defines what content will appear in each resizable panel managed by the splitter.
LlockedSpecifies whether the item can be resized by the user. If set to true, resizing is enabled; if set to false, the item's size remains fixed.
MmaxSpecifies the maximum allowable size for the item. Values exceeding this limit will not be accepted or processed.
MminSpecifies the minimum allowed size (in the relevant unit) for the item, preventing it from shrinking below this value during layout or resizing.
SsizeSpecifies the dimensions or overall measurements of the item, such as its width, height, or depth. This property allows you to control how large or small the item appears within its container or layout.

Methods

CcollapseCollapses the item, hiding its content or child elements from view. This action reduces the item's visible footprint, typically as part of an expandable/collapsible user interface component such as an accordion or dropdown.
EexpandExpands the item to display its hidden content or details when it is currently in a collapsed (hidden) state.
LlockPrevents the item from being resized, ensuring its dimensions remain fixed and cannot be altered by the user or through code.
UunlockUnlocks access to an item that was previously restricted or unavailable, allowing full interaction or use of its features.

Properties

disabledboolean

Determines whether the element is interactive or not. When enabled, users can interact with the element; when disabled, the element is non-interactive and typically appears visually dimmed or grayed out.

Default value

false

Example

Set the disabled property.

 <smart-splitter-item disabled></smart-splitter-item>

Set the disabled property by using the HTML Element's instance.

 const splitteritem = document.querySelector('smart-splitter-item');
 splitteritem.disabled = false;

Get the disabled property.

 const splitteritem = document.querySelector('smart-splitter-item');
 let disabled = splitteritem.disabled;

collapsedboolean

Indicates whether the item is currently collapsed ('true') or expanded ('false'). This property controls the visibility of the item's content in collapsible interfaces or components.

Default value

false

Example

Set the collapsed property.

 <smart-splitter-item collapsed></smart-splitter-item>

Set the collapsed property by using the HTML Element's instance.

 const splitteritem = document.querySelector('smart-splitter-item');
 splitteritem.collapsed = false;

Get the collapsed property.

 const splitteritem = document.querySelector('smart-splitter-item');
 let collapsed = splitteritem.collapsed;

collapsibleboolean

Specifies whether the item is collapsible. If set to true, the item can be expanded or collapsed by the user. If set to false, the item remains permanently expanded and cannot be collapsed.

Default value

false

Example

Set the collapsible property.

 <smart-splitter-item collapsible></smart-splitter-item>

Set the collapsible property by using the HTML Element's instance.

 const splitteritem = document.querySelector('smart-splitter-item');
 splitteritem.collapsible = false;

Get the collapsible property.

 const splitteritem = document.querySelector('smart-splitter-item');
 let collapsible = splitteritem.collapsible;

contentany

Specifies the elements or components that are displayed within each section (item) of the splitter layout. This property defines what content will appear in each resizable panel managed by the splitter.

Default value

""

Example

Set the content property.

 <smart-splitter-item content=''></smart-splitter-item>

Set the content property by using the HTML Element's instance.

 const splitteritem = document.querySelector('smart-splitter-item');
 splitteritem.content = Panel;

Get the content property.

 const splitteritem = document.querySelector('smart-splitter-item');
 let content = splitteritem.content;

lockedboolean

Specifies whether the item can be resized by the user. If set to true, resizing is enabled; if set to false, the item's size remains fixed.

Default value

false

Example

Set the locked property.

 <smart-splitter-item locked></smart-splitter-item>

Set the locked property by using the HTML Element's instance.

 const splitteritem = document.querySelector('smart-splitter-item');
 splitteritem.locked = false;

Get the locked property.

 const splitteritem = document.querySelector('smart-splitter-item');
 let locked = splitteritem.locked;

maxstring

Specifies the maximum allowable size for the item. Values exceeding this limit will not be accepted or processed.

Default value

""

Example

Set the max property.

 <smart-splitter-item max='250'></smart-splitter-item>

Set the max property by using the HTML Element's instance.

 const splitteritem = document.querySelector('smart-splitter-item');
 splitteritem.max = '100';

Get the max property.

 const splitteritem = document.querySelector('smart-splitter-item');
 let max = splitteritem.max;

minstring

Specifies the minimum allowed size (in the relevant unit) for the item, preventing it from shrinking below this value during layout or resizing.

Default value

""

Example

Set the min property.

 <smart-splitter-item min='50'></smart-splitter-item>

Set the min property by using the HTML Element's instance.

 const splitteritem = document.querySelector('smart-splitter-item');
 splitteritem.min = '100';

Get the min property.

 const splitteritem = document.querySelector('smart-splitter-item');
 let min = splitteritem.min;

sizestring

Specifies the dimensions or overall measurements of the item, such as its width, height, or depth. This property allows you to control how large or small the item appears within its container or layout.

Default value

""

Example

Set the size property.

 <smart-splitter-item size='250'></smart-splitter-item>

Set the size property by using the HTML Element's instance.

 const splitteritem = document.querySelector('smart-splitter-item');
 splitteritem.size = '100';

Get the size property.

 const splitteritem = document.querySelector('smart-splitter-item');
 let size = splitteritem.size;

Methods

collapse( far: string): void

Collapses the item, hiding its content or child elements from view. This action reduces the item's visible footprint, typically as part of an expandable/collapsible user interface component such as an accordion or dropdown.

Arguments

farstring

If set to true the item will collapse to it's far side ( to the right for vertical splitter and down for horizontal)


Invoke the collapse method.

const splitteritem = document.querySelector('smart-splitter-item');
splitteritem.collapse();

expand(): void

Expands the item to display its hidden content or details when it is currently in a collapsed (hidden) state.


Invoke the expand method.

const splitteritem = document.querySelector('smart-splitter-item');
splitteritem.expand();

lock(): void

Prevents the item from being resized, ensuring its dimensions remain fixed and cannot be altered by the user or through code.


Invoke the lock method.

const splitteritem = document.querySelector('smart-splitter-item');
splitteritem.lock();

unlock(): void

Unlocks access to an item that was previously restricted or unavailable, allowing full interaction or use of its features.


Invoke the unlock method.

const splitteritem = document.querySelector('smart-splitter-item');
splitteritem.unlock();