Skip to content

TabPanel

TabPanel

Wrap over the tab elements.

jsx
import TabPanel from '@semcore/ui/tab-panel';
<TabPanel />;

NSTabPanel.Props

& {...}
NameTypeDescription
onChange((value: , e: ) => void) | Is invoked when changing the selection
value Value of the selected tab
defaultValue Default value of the selected tab
behavior"auto" | "manual" Behavior of tabs. In `auto`, changes the tab immediately when press arrow. In `manual`, needs to press `space` or `enter` for select a choice.

TabPanel.Item

The tab element may contain Addon and Text, its structure is similar to Button. It takes some properties from TabLine (for example, size, disabled) and may override them.

TIP

It's recommended to use links in tabs, so that user can open them in a new browser tab or window, or copy their URL.

jsx
import TabPanel from '@semcore/ui/tab-panel';
<TabPanel.Item />;

NSTabPanel.Item.Props

& {...}
NameTypeDescription
selectedboolean Makes a tab selected. This property is determined automatically depending on the value.
disabledboolean Disabled state
value Tab value
addonLeft Left addon tag
addonRight Right addon tag

TabPanel.Item.Addon

The addon inside the tab (most commonly an icon) sets the correct indents depending on the size.

It takes all the properties of the Box.

jsx
import TabPanel from '@semcore/ui/tab-panel';
<TabPanel.Item.Addon />;

TabPanel.Item.Text

An instance of Text with the appropriate styles depending on the TabPanel size.

Plain text without addons placed directly in TabPanel.Item is wrapped in TabPanel.Item.Text automatically.

jsx
import TabPanel from '@semcore/ui/tab-panel';
<TabPanel.Item.Text />;

NSTabPanel.Item.Text.Props

Released under the MIT License.

Released under the MIT License.