All Components

Tabstrip Overview

The Tabstrip displays a collection of tabs with associated content.

The tabs enable the user to switch between different views inside a single component.

Basic Usage

The following example demonstrates the Tabstrip in action.

@Component({
  selector: 'my-app',
  template: `
      <kendo-tabstrip>
        <kendo-tabstrip-tab [title]="'Paris'" [selected]="true">
          <template kendoTabContent>
            <p>
            Paris is the capital and most populous city of France. It has an area of 105 square kilometres (41 square miles) and a population in 2013 of 2,229,621 within its administrative limits. The city is both a commune and department, and forms the centre and headquarters of the Île-de-France, or Paris Region, which has an area of 12,012 square kilometres (4,638 square miles) and a population in 2014 of 12,005,077, comprising 18.2 percent of the population of France.
            </p>
          </template>
        </kendo-tabstrip-tab>
        <kendo-tabstrip-tab [title]="'New York City'">
          <template kendoTabContent>
            <p>
              The City of New York, often called New York City or simply New York, is the most populous city in the United States. With an estimated 2015 population of 8,550,405 distributed over a land area of just 305 square miles (790 km2), New York City is also the most densely populated major city in the United States. Located at the southern tip of the state of New York, the city is the center of the New York metropolitan area, one of the most populous urban agglomerations in the world.
            </p>
            <p>
              A global power city, New York City exerts a significant impact upon commerce, finance, media, art, fashion, research, technology, education, and entertainment, its fast pace defining the term New York minute. Home to the headquarters of the United Nations, New York is an important center for international diplomacy and has been described as the cultural and financial capital of the world.
            </p>
          </template>
        </kendo-tabstrip-tab>
        <kendo-tabstrip-tab [title]="'Tallinn'">
          <template kendoTabContent>
            <p>
              Tallinn is the capital and largest city of Estonia. It is situated on the northern coast of the country, on the shore of the Gulf of Finland, 80 km (50 mi) south of Helsinki, east of Stockholm and west of Saint Petersburg. From the 13th century until 1918 (and briefly during the Nazi occupation of Estonia from 1941 to 1944), the city was known as Reval. Tallinn occupies an area of 159.2 km2 (61.5 sq mi) and has a population of 443,894. Approximately 32% of Estonia's total population lives in Tallinn.
            </p>
            <p>
              Tallinn was founded in 1248, but the earliest human settlements are over 5,000 years old, making it one of the oldest capital cities of Northern Europe. Due to its strategic location, the city became a major trade hub, especially from the 14th to the 16th century, when it grew in importance as part of the Hanseatic League.
            </p>
          </template>
        </kendo-tabstrip-tab>
        <kendo-tabstrip-tab [title]="'Sydney'" [disabled]="true"></kendo-tabstrip-tab>
      </kendo-tabstrip>
    `,
    styles: [`
        kendo-tabstrip p {
            margin: 0;
            padding: 8px;
        }
    `]
})
class AppComponent {}

Configuration

The tabs of the Tabstrip have to be initialized as KendoTabstripTab components with the corresponding properties.

They provide configuration options for:

Set the Tabs Titles

Each tab displays a title that prompts the tab content. Apart from plain text, a tab title can also accommodate any Angular component. To handle the tab title, set the title attribute of the tab.

@Component({
  selector: 'my-app',
  template: `
      <kendo-tabstrip>
        <kendo-tabstrip-tab [title]="'Tab 1 Title'">
          <template kendoTabContent>
            <p>Tab 1 Content</p>
          </template>
        </kendo-tabstrip-tab>
        <kendo-tabstrip-tab [title]="'Tab 2 Title'">
          <template kendoTabContent>
            <p>Tab 2 Content</p>
          </template>
        </kendo-tabstrip-tab>
        <kendo-tabstrip-tab [title]="'Tab 3 Title'">
          <template kendoTabContent>
            <p>Tab 3 Content</p>
          </template>
        </kendo-tabstrip-tab>
      </kendo-tabstrip>
    `,
    styles: [`
        kendo-tabstrip p {
            margin: 0;
            padding: 8px;
        }
    `]
})

class AppComponent {}

Display Tabs on Initial Loading

The Tabstrip does not display a tab upon its initial loading. To change this behavior, set the selected property of the tab.

@Component({
  selector: 'my-app',
  template: `
      <kendo-tabstrip>
        <kendo-tabstrip-tab [title]="'Tab 1'">
          <template kendoTabContent>
            <p>Tab 1 Content</p>
          </template>
        </kendo-tabstrip-tab>
        <kendo-tabstrip-tab [title]="'Tab 2'" [selected]="true">
          <template kendoTabContent>
            <p>Tab 2 Content</p>
          </template>
        </kendo-tabstrip-tab>
        <kendo-tabstrip-tab [title]="'Tab 3'">
          <template kendoTabContent>
            <p>Tab 3 Content</p>
          </template>
        </kendo-tabstrip-tab>
      </kendo-tabstrip>
    `,
    styles: [`
        kendo-tabstrip p {
            margin: 0;
            padding: 8px;
        }
    `]
})
class AppComponent {}

Enable and Disable Tabs

The Tabstrip lets you disable specific tabs. To disable a tab, add the disabled attribute.

@Component({
  selector: 'my-app',
  template: `
    <kendo-tabstrip>
        <kendo-tabstrip-tab [title]="'Tab 1'">
          <template kendoTabContent>
            <p>Tab 1 Content</p>
          </template>
        </kendo-tabstrip-tab>
        <kendo-tabstrip-tab [title]="'Tab 2 (disabled)'" [disabled]="true">
          <template kendoTabContent>
            <p>Tab 2 Content</p>
          </template>
        </kendo-tabstrip-tab>
        <kendo-tabstrip-tab [title]="'Tab 3'">
          <template kendoTabContent>
            <p>Tab 3 Content</p>
          </template>
        </kendo-tabstrip-tab>
      </kendo-tabstrip>
    `,
    styles: [`
        kendo-tabstrip p {
            margin: 0;
            padding: 8px;
        }
    `]
})
class AppComponent {}

Use Structural Directives

You can build configuration components by using Angular structural directives.

The following example uses the ngFor directive.

@Component({
  selector: 'my-app',
  template: `
     <kendo-tabstrip [ngStyle]="{'width': '400px'}">
        <kendo-tabstrip-tab
          *ngFor="let item of items let i=index"
          [title]="item.city"
          [selected]="i == selected"
          [disabled]="item.disabled"
        >
            <template kendoTabContent>
              <div class="weather">
                <h4>{{item.temp}}<span>&ordm;C</span></h4>
                <p>Weather in {{item.city}} is {{item.weather}}.</p>
              </div>
            </template>
        </kendo-tabstrip-tab>
      </kendo-tabstrip>
    `,
    styles: [`
        .weather {
            margin: 30px;
            text-align: center;
        }
    `]
})

export class AppComponent {
  public selected: number = 1;
  public items: any = [{
            disabled: true,
            city: "Paris",
            temp: 17,
            weather: "rainy"
      }, {
            disabled: false,
            city: "New York",
            temp: 29,
            weather: "sunny"
      }, {
            disabled: false,
            city: "Sofia",
            temp: 23,
            weather: "cloudy"
      }, {
            disabled: false,
            city: "London",
            temp: 19,
            weather: "cloudy"
      }]
}

Keyboard Navigation

For more information on the keyboard shortcuts the Tabstrip supports, refer to the article on keyboard navigation.

Accessibility

For more information on the accessibility features of the Tabstrip, refer to the article on accessibility.

Right-to-Left Support

For more information on the ability of the Tabstrip to support the handling of right-to-left (RTL) languages, refer to the article on RTL support.

In this article