shadcn.io is not affiliated with official shadcn/ui
Tabs examples · Layout
Full Width Tabs for React
Three tabs that split the full width of the list into equal columns.
A few tabs of equal weight look balanced when they share the whole row. TabsList is a three-column grid at full width, so All, Active and Completed each take a third. Use it for status filters or any short set of views of the same list.
Preview
Installation
FAQ
How do the triggers become equal width?
TabsList has grid w-full grid-cols-3. There are three triggers, so each one fills a column.
Which tab is selected first?
All, the default value on Tabs. The group is w-full max-w-md, and each panel matches its trigger: all, active and completed.
What happens if I add a fourth trigger?
grid-cols-3 is three columns, so a fourth trigger wraps to a second row. Change it to grid-cols-4 along with the new trigger.
What does each panel show?
A bordered bg-card block with a heading and task rows filtered from one tasks array. All shows three, Active the two that are not done and Completed the one that is.
Related
- Vertical TabsSettings tabs stacked in a column beside
- Scrollable TabsTwelve month tabs in a scroll area, so
- Basic TabsFour horizontal tabs that switch between
- Basic Button GroupThree rows of outline buttons joined into
- Default Toggle GroupA toggle group for bold, italic and
- Standard CardA basic card with a title, a description