Tabs & accordion
TabControl · TabStripControl · AccordionControlShow one section at a time with tabs, document tabs or an accordion.
Overview
TabControl is a Blazor tab control: users switch between sections of a page, and only the selected pane renders. Use TabStripControl for document tabs users close, with the content kept elsewhere, and AccordionControl for stacked sections that expand in place, as on a narrow settings page. Both tab controls come in five themes and let users change orientation from a right-click menu.
Examples
#Tab control
Switch between the Summary, Lines and Notes of a leave request; only the selected pane renders. Review the lines sets the bound SelectedIndex from the page, and the Notes pane holds a button of its own. Pick a theme and a layout with the buttons (One row and Wrapping rows differ only when the tabs overflow), or right-click the tabs: every tab control carries that menu, and @bind-Theme and @bind-Orientation keep the page in step.
- Request
- LR-0112 December leave
- Employee
- Albus Door, Tour Operations
- Status
- Awaiting approval, 3 lines
- Total
- 8 days
Tab 1 of 3 selected · 2 notes · FolderTabs, Horizontal
#Document tabs
Open leave requests with the buttons above the tabs: each opens as a closable tab, and one that is already open is selected instead of opened twice. Close a tab with its ×, reopen the last one, and right-click the strip to change its theme or orientation; when the tabs no longer fit, EnableOverflowNavigation adds Previous and Next buttons. Payroll is a Disabled tab.
#Accordion
Work down the onboarding checklist: checking a step changes the badge in its header, written with HeaderContent, and Sign-off stays Disabled until the three steps are done. Without Multiple, opening one section closes the rest; the switch rebuilds the accordion with it on, so Contract opens again. Unchecking a step while Sign-off is open closes it, because @key rebuilds that item.
1 of 3 steps done