-
Data Grid
- Overview
-
Data Binding
-
Paging and Scrolling
-
Editing
-
Grouping
-
Filtering and Sorting
- Focused Row
-
Row Drag & Drop
-
Selection
-
Columns
- State Persistence
-
Appearance
-
Templates
-
Data Summaries
-
Master-Detail
-
Export to PDF
-
Export to Excel
-
Adaptability
- Keyboard Navigation
-
Pivot Grid
- Overview
-
Data Binding
-
Field Chooser
-
Features
-
Export to Excel
-
Tree List
- Overview
-
Data Binding
- Sorting
- Paging
-
Editing
- Node Drag & Drop
- Focused Row
-
Selection
-
Filtering
-
Column Customization
- State Persistence
- Adaptability
- Keyboard Navigation
-
Scheduler
- Overview
-
Data Binding
-
Views
-
Features
- Virtual Scrolling
-
Grouping
-
Customization
- Adaptability
-
Html Editor
-
Chat
-
Diagram
- Overview
-
Data Binding
-
Featured Shapes
-
Custom Shapes
-
Document Capabilities
-
User Interaction
- UI Customization
- Adaptability
-
Charts
- Overview
-
Data Binding
-
Area Charts
-
Bar Charts
- Bullet Charts
-
Doughnut Charts
-
Financial Charts
-
Line Charts
-
Pie Charts
-
Point Charts
-
Polar and Radar Charts
-
Range Charts
-
Sparkline Charts
-
Tree Map
-
Funnel and Pyramid Charts
- Sankey Chart
-
Combinations
-
More Features
-
Export
-
Selection
-
Tooltips
-
Zooming
-
-
Gantt
- Overview
-
Data
-
UI Customization
- Strip Lines
- Export to PDF
- Sorting
-
Filtering
-
Reporting
- AI-powered Extensions
-
Interaction
-
Report Types
-
Data binding
-
Real-life Reports
-
Layout Features
-
Report Controls
-
Web-specific Features
-
Rich Text Editor
- Overview
- Load/Save
- Document Protection
-
Templates
- Autocorrect
-
Customization
- Simple View
-
Spreadsheet
- Overview
-
Open a Document
- Export And Printing
-
Features
-
UI Customization
-
Gauges
- Overview
-
Data Binding
-
Bar Gauge
-
Circular Gauge
-
Linear Gauge
-
Navigation
- Overview
- Accordion
-
Menu
- Multi View
-
Drawer
-
Tab Panel
-
Tabs
-
Toolbar
- Pagination
-
Tree View
- Right-to-Left Support
-
Layout
-
Tile View
- Splitter
-
Gallery
- Scroll View
- Resizable
-
-
Editors
- Overview
- Autocomplete
-
Calendar
- Check Box
- Color Box
- Date Box
-
Date Range Box
-
Drop Down Box
-
Number Box
-
Select Box
- Switch
-
Tag Box
- Text Area
- Text Box
- Validation
- Custom Text Editor Buttons
- Right-to-Left Support
- Editor Appearance Variants
-
Forms and Multi-Purpose
- Overview
- Button Group
- Field Set
-
Filter Builder
-
Form
- Radio Group
-
Range Selector
- Numeric Scale (Lightweight)
- Numeric Scale
- Date-Time Scale (Lightweight)
- Date-Time Scale
- Logarithmic Scale
- Discrete scale
- Custom Formatting
- Use Range Selection for Calculation
- Use Range Selection for Filtering
- Image on Background
- Chart on Background
- Customized Chart on Background
- Chart on Background with Series Template
- Range Slider
- Slider
-
Sortable
-
File Management
-
File Manager
- Overview
-
File System Types
-
Customization
-
File Uploader
-
-
Actions and Lists
-
Maps
- Overview
-
Map
-
Vector Map
-
Dialogs and Notifications
-
Localization
Tabs - Overview
The Tabs component allows you to create a tabbed UI to navigate between pages or views. You can create tab items in the items array, or populate tab items from a dataSource.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
<div class="tabs-demo">
<div class="widget-container">
<div class="widget-wrapper widget-wrapper-horizontal">
@(Html.DevExtreme().Tabs()
.ID("withText")
.Width("auto")
.SelectedIndex(0)
.DataSource(new JS("tabsText"))
.StylingMode(TabsStyle.Secondary)
.IconPosition(TabsIconPosition.Top)
)
@(Html.DevExtreme().Tabs()
.ID("withIconAndText")
.Width("auto")
.SelectedIndex(0)
.DataSource(new JS("tabsTextAndIcon"))
.StylingMode(TabsStyle.Secondary)
.IconPosition(TabsIconPosition.Top)
)
@(Html.DevExtreme().Tabs()
.ID("withIcon")
.Width("auto")
.SelectedIndex(0)
.DataSource(new JS("tabsIcon"))
.StylingMode(TabsStyle.Secondary)
.IconPosition(TabsIconPosition.Top)
)
</div>
</div>
<div class="options">
<div class="caption">Options</div>
<div class="option">
<div>Orientation</div>
@(Html.DevExtreme().SelectBox()
.DataSource(new[] { "horizontal", "vertical" })
.InputAttr("aria-label", "Orientation")
.Value("horizontal")
.OnValueChanged("orientation_valueChanged")
)
</div>
<div class="option">
<div>Styling Mode</div>
@(Html.DevExtreme().SelectBox()
.DataSource(new[] { "primary", "secondary" })
.InputAttr("aria-label", "Styling Mode")
.Value("secondary")
.OnValueChanged("stylingMode_valueChanged")
)
</div>
<div class="option">
<div>Icon position</div>
@(Html.DevExtreme().SelectBox()
.DataSource(new[] { "top", "start", "end", "bottom" })
.InputAttr("aria-label", "Icon Position")
.Value("top")
.OnValueChanged("iconPosition_valueChanged")
)
</div>
<div class="option">
@(Html.DevExtreme().CheckBox()
.ID("show-navigation-buttons")
.Value(false)
.Text("Show Navigation Buttons")
.OnValueChanged("showNavigation_valueChanged")
)
</div>
<div class="option">
@(Html.DevExtreme().CheckBox()
.ID("scroll-content")
.Value(false)
.Text("Scroll Content")
.OnValueChanged("scrollContent_valueChanged")
)
</div>
<div class="option">
@(Html.DevExtreme().CheckBox()
.Value(false)
.Text("Full width")
.OnValueChanged("fullWidth_valueChanged")
)
</div>
<div class="option">
@(Html.DevExtreme().CheckBox()
.Value(false)
.Text("Right-to-left mode")
.OnValueChanged("rtlEnabled_valueChanged")
)
</div>
</div>
</div>
<script>
function orientation_valueChanged(e) {
const $widgetWrapper = $(".widget-wrapper");
const isVertical = e.value === "vertical";
$widgetWrapper.toggleClass("widget-wrapper-vertical", isVertical);
$widgetWrapper.toggleClass("widget-wrapper-horizontal", !isVertical);
setTabsOption("orientation", e.value);
}
function stylingMode_valueChanged(e) {
setTabsOption("stylingMode", e.value);
}
function iconPosition_valueChanged(e) {
setTabsOption("iconPosition", e.value);
}
function showNavigation_valueChanged(e) {
const scrollContentCheckBox = $("#scroll-content").dxCheckBox("instance");
const shouldRestrictWidth = data.value || scrollContentCheckBox.option("value");
toggleStrictWidthClass(shouldRestrictWidth);
setTabsOption("showNavButtons", e.value);
}
function scrollContent_valueChanged(e) {
const showNavButtonsCheckBox = $("#show-navigation-buttons").dxCheckBox("instance");
const shouldRestrictWidth = data.value || showNavButtonsCheckBox.option("value");
toggleStrictWidthClass(shouldRestrictWidth);
setTabsOption("scrollByContent", e.value);
}
function fullWidth_valueChanged(e) {
setTabsOption("width", e.value ? "100%" : "auto");
}
function rtlEnabled_valueChanged(e) {
setTabsOption("rtlEnabled", e.value);
}
function setTabsOption(option, value) {
$("#withText").dxTabs("instance").option(option, value);
$("#withIconAndText").dxTabs("instance").option(option, value);
$("#withIcon").dxTabs("instance").option(option, value);
}
function toggleStrictWidthClass(shouldRestrictWidth) {
const $widgetWrapper = $(".widget-wrapper");
$widgetWrapper.toggleClass("strict-width", isHorizontal && shouldRestrictWidth);
}
const tabsText = [
{
id: 0,
text: "User",
},
{
id: 1,
text: "Analytics",
},
{
id: 2,
text: "Clients",
},
{
id: 3,
text: "Orders",
},
{
id: 4,
text: "Favorites",
},
{
id: 5,
text: "Search",
},
];
const tabsTextAndIcon = [
{
id: 0,
text: "User",
icon: "user",
},
{
id: 1,
text: "Analytics",
icon: "chart",
},
{
id: 2,
text: "Clients",
icon: "accountbox",
},
{
id: 3,
text: "Orders",
icon: "ordersbox",
},
{
id: 4,
text: "Favorites",
icon: "bookmark",
},
{
id: 5,
text: "Search",
icon: "search",
},
];
const tabsIcon = [
{
id: 0,
icon: "user",
},
{
id: 1,
icon: "chart",
},
{
id: 2,
icon: "accountbox",
},
{
id: 3,
icon: "ordersbox",
},
{
id: 4,
icon: "bookmark",
},
{
id: 5,
icon: "search",
},
];
</script>
xxxxxxxxxx
xxxxxxxxxx
Customize Tab Contents and Appearance
You can initialize a tab’s contents (text, icons and badges) with values from underlying data objects. This example demonstrates this technique.
Use the drop-down editors on the right to change the component's orientation, styling mode, and icon position.
You can also specify an item template (itemTemplate) to customize tabs.
Configure Overflow Behavior
The Tabs component stretches to fit its container if you do not specify the component's width. When the total tab width exceeds the component’s width, navigation buttons appear. A user can click these buttons to scroll through the tabs. Use the showNavButtons and scrollByContent properties to control this behavior.