Tabs Layout¶
Description¶
Organizes content into switchable tabs. Useful for grouping related but distinct views without cluttering the screen.
Configuration¶
tabs: position: left # Tab bar position (top, left) items: - title: "Tab 1" rows: [tab_1_chart] # Content for Tab 1 - title: "Tab 2" cols: [tab_2_chart] # Content for Tab 2
Tab Item Options¶
| Field | Type | Description |
|---|---|---|
title |
string | Required: Label text |
icon |
string | Optional icon name |
Tab content is placed via direct rows:, cols:, grid:, or tabs: keys on the tab item itself; there is no separate layout: field.
With position: left, the tabs stack as a vertical rail along the board's left edge and the content sits to the right of it. Every tab in the rail takes the width of the widest label, and the content gets the board width minus the rail. A label too long for the rail wraps onto a second line, and only text that still does not fit is cut with an ellipsis; hover the tab to read the full label.
Loading¶
A board runs only the queries of the tabs it shows, so opening a board with many tabs costs one tab's queries, not all of them. The board is as wide as its widest tab, so switching tabs never changes its width. That width is worked out without data: a table inside tabs counts at its configured width, not at the width of the rows it returns. Query-based warnings, such as a query returning no rows, appear when their tab is opened.
The other tabs' queries wait until their tab is clicked. To load them in the background once the open tab is on screen, set cache: prefetch: true; see Loading hidden tabs ahead of time. Prefetch runs on dbtcharts.com and in dct serve, not in the Playground.
Category colors are planned from the tab being shown, so a value can take a different color on two tabs. Pin the colors with style.charts.category_colors when they must match across tabs.
Example¶
tabs: items: - title: "Overview" rows: - kpi_row - trend_chart - title: "Regional" cols: - map_view - regional_table