Container

The Container Widget category consist of the following widgets:

  • Basic
  • Dialog
  • Flex
  • Repeating
  • Split horizontally
  • Split vertically
  • Tabbed

The following tables offer usage details about the properties available to Container widgets. Several examples follow the tables.

Properties

AttributeDescriptionTypeRequiredChanged By
flexSpecifies whether the container should automatically align and distribute space among child widgets.booleanYesDirect Edit
flexOptionsThe options to configure how child widgets should be aligned.booleanNoDirect Edit
lazyRenderingEnabledSpecifies whether only visible child widgets should be rendered.booleanYesDirect Edit
selectedTabIndexThe index of the currently shown tab.numberYesDirect Edit
tabContentsAn internal array storing the widgets in each tab.{children: IWidgetModel[]}[]YesUser Interaction
tabTitlesThe titles for each tab.ITabTitle[]YesDirect Edit
titlesEnabledSpecifies whether to show the clickable tab titles at the top of the container.booleanYesDirect Edit
scrollingEnabledSpecifies whether overflowing content may be scrolled.booleanYesDirect Edit
splitDirectionSpecifies direction in which container is split.numberYesDirect Edit
splitMovableInConsumerModeSpecifies whether split container is resizable in consumer modebooleanYesDirect Edit
splitPanelAn internal value that says whether a container is a panel in a split container.booleanYesUser Interaction
repeatSpecifies number of times to repeat contentnumberNoDirect Edit
repeatingSpecifies whether container is a repeating container or not.booleanYesDirect Edit
previewRepeatingSpecifies whether to preview repeating container or not.booleanNoDirect Edit

ITabTitle

AttributeDescriptionTypeRequiredChanged By
titleThe title of this tab.stringYesDirect Edit

IFlexOptions

AttributeDescriptionTypeRequiredChanged By
justifyContentSpecifies how child widgets should be laid out on the main-axis. Default value is Left for horizontally flexed containers and Top for vertically-flexed containers.stringYesDirect Edit
flexDirectionSpecifies the main-axis on which child widgets are aligned. Default value is Horizontally.stringYesDirect Edit
flexWrapSpecifies whether child widgets can overflow onto multiple lines. Default value is unchecked.stringYesDirect Edit

Usage

Drag widgets into and out of containers to add and remove them from the currently selected tab. The tabContents property is unsupposed in the raw tab and should not be edited manually, nor will it respond to changes from user interaction.

Examples

Simple Container

Copied!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 { "selectedTabIndex": 0, "tabContents": [ { "children": [] } ], "tabTitles": [ { "title": "Title" } ], "titlesEnabled": false }

Tabbed Container

Copied!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 { "selectedTabIndex": 1, "tabContents": [ { "children": [] }, { "children": [] }, { "children": [] } ], "tabTitles": [ { "title": "Title 1" }, { "title": "Title 2" }, { "title": "Title 3" } ], "titlesEnabled": true }

Driving the selected tab from another widget

Copied!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 { "selectedTabIndex": "{{w8.selectedValue}}", "tabContents": [ { "children": [] }, { "children": [] }, { "children": [] } ], "tabTitles": [ { "title": "Title 1" }, { "title": "Title 2" }, { "title": "Title 3" } ], "titlesEnabled": false }

Defaults

Copied!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 { "selectedTabIndex": 0, "tabContents": [ { "children": [] } ], "tabTitles": [ { "title": "Title" } ], "titlesEnabled": false }

Dialog widget

The following tables offer usage details about the properties available to dialog widgets. Several examples follow the tables.

Properties

AttributeDescriptionTypeRequiredChanged By
titleThe title of the dialog.stringNoDirect Edit
canEscapeKeyCloseCloses the dialog when the Escape key is used.booleanYesDirect Edit
canOutsideClickCloseCloses the dialog when the user clicks on the overlay backdrop.booleanYesDirect Edit

Actions

Action NameDescription
closeTriggering this action causes the dialog to close.
openTriggering this action causes the dialog to open.

Events

Event NameDescription
closedThis event is fired when dialog has fully closed.
openedThis event is fired when dialog has fully opened.

Common CSS

You can use the below CSS to set the background color and borders of a container:

Copied!
1 2 3 4 5 sl-app-container { background: lightgrey; border-left:none; border-right:none; }

container-css

Though the sl-app-container selector and background property will correctly set the background color and borders of a container widget, use the div.canvas-body selector and background-color property in your local stylesheet to adjust the colors and borders of the Slate application canvas. In the example below, we customized the Slate canvas, container widget, and bar chart colors using the Styles editor:

The Styles editor in Slate with customized color settings. The Slate canvas is light blue, the widget container is light cyan, and the bar chart is light gray.

Tabbed containers

Tabs styling:

Copied!
1 2 3 4 5 6 sl-app-container table.container-titles tbody tr td.tab-title { color: #2786c1; text-transform:uppercase; border-left:none; border-right:none; }

Hover styling:

Copied!
1 sl-app-container table.container-titles tbody tr td.tab-title:hover {text-decoration:none;}

Selection styling:

Copied!
1 2 3 4 sl-app-container table.container-titles tbody tr td.tab-title.selected { color: #394B59; border-bottom:4px solid #2786C1; }

Individual tab styling:

Copied!
1 2 3 4 sl-app-container table.container-titles tbody tr td.tab-title:last-child { border-left:none; border-right:none; }

tabbed-css