kvision / pl.treksoft.kvision.panel / TabPanel

TabPanel

open class TabPanel : SimplePanel

The container rendering it's children as tabs.

It supports activating children by a JavaScript route.

Constructors

<init>

TabPanel(classes: Set<String> = setOf(), init: TabPanel.() -> Unit = null)

Properties

activeIndex

var activeIndex: Int

The index of active (visible) tab.

Functions

add

open fun add(child: Component): TabPanel

Adds given component to the current container.

addAll

open fun addAll(children: List<Component>): TabPanel

Adds a list of components to the current container.

addTab

open fun addTab(title: String, panel: Component, icon: String? = null, image: ResString? = null, route: String? = null): TabPanel

Adds new tab and optionally bounds it's activation to a given route.

remove

open fun remove(child: Component): TabPanel

Removes given component from the current container.

removeAll

open fun removeAll(): TabPanel

Removes all children from the current container.

removeTab

open fun removeTab(index: Int): TabPanel

Removes tab at given index.

Inherited Functions

addInternal

fun addInternal(child: Component): SimplePanel

Protected and final method to add given component to the current container.

childrenVNodes

open fun childrenVNodes(): Array<VNode>

Returns the array of the children Snabbdom vnodes.

getChildren

open fun getChildren(): List<Component>

Returns a list of children of the current container.

render

open fun render(): VNode

Renders current component as a Snabbdom vnode.

Companion Object Functions

tabPanel

fun Container.tabPanel(classes: Set<String> = setOf(), init: TabPanel.() -> Unit = null): Unit

DSL builder extension function