TabItem

in namespace DotVVM.Bootstrap5.Controls

Renders a Bootstrap tab item.

Usage & Scenarios

Represents the tab item inside the Bootstrap TabControl.

https://getbootstrap.com/docs/5.2/components/navs-tabs

Sample 1: TabItem Control

Use the <bs:TabItem> controls inside the TabControl control.

The header and content of each TabItem is defined using the HeaderTemplate and ContentTemplate properties.

The IsActive property specifies whether the tab is currently selected or not.

The Enabled property specifies whether the tab can be selected.

<bs:TabControl>
  <bs:TabItem>
    <HeaderTemplate>Tab 1</HeaderTemplate>
      <p>First tab</p>
  </bs:TabItem>

  <bs:TabItem IsActive="true">
    <HeaderTemplate>Tab 2</HeaderTemplate>
      <p>Second tab</p>
  </bs:TabItem>

  <bs:TabItem Enabled="false">
    <HeaderTemplate>Tab 3</HeaderTemplate>
      <p>Third tab</p>
  </bs:TabItem>
</bs:TabControl>

Properties

Name Type Description Notes Default Value
property icon ContentTemplate ITemplate Gets or sets a custom template for the tab content.
attribute
inner element
static value
bindable
default
null
property icon ContentText String Gets or sets a plain text for the tab content.
attribute
inner element
static value
bindable
default
null
property icon Enabled Boolean Gets or sets whether the tab header is enabled or disabled.
attribute
inner element
static value
bindable
default
True
property icon HeaderTemplate ITemplate Gets or sets a custom template for the tab header.
attribute
inner element
static value
bindable
default
null
property icon HeaderText String Gets or sets a plain text for the tab header.
attribute
inner element
static value
bindable
default
null
property icon Selected Boolean Gets or sets wether the tab is selected and its content is displayed.
attribute
inner element
static value
bindable
default
null
property icon Visible Boolean Gets or sets whether the control is visible. When set to false, `style="display: none"` will be added to this control.
attribute
inner element
static value
bindable
default
True

HTML produced by the control