shadcn.io is not affiliated with official shadcn/ui
Segmented Tab Split Frame Features Block for React
A features section for a performance budget tool: pill tabs swap both panes of one framed view, a text pane with the counts and a bar chart that a budget slider cuts across.
Installation
Overview
A features section for React with Base UI, where one control changes a whole view. Under a compact header, three pill tabs (Performance, Security and Analytics) switch a framed view split in two by a hairline. The start pane says what the budget is for and how many routes are over it; the end pane draws every route of Perfwell, a performance budget tool, as a bar, with a slider under the bars that sets the budget. A line follows the slider across the bars, a bar past it turns solid, and the counts update as you drag. It's tabs, a slider, a sliding number, a badge and the Guides line kit, with your theme's tokens for every colour and no button. For any product that sets limits and shows who breaks them.
FAQ
How do I change the budgets and the routes?
Edit BUDGETS at the top of the file. Each tab is one object: a label, a title, a sentence, the unit, the slider's range and step, its starting budget and a list of routes with a value each. Add a tab and it appears in the header and the frame. Every count, the worst route, the median and the bar widths are worked out from that list, so they always agree with the bars.
When does a bar count as over budget?
When its value is past the budget: a route that sits exactly on the budget is within it. Over-budget bars turn solid and their values turn bold, and a screen reader hears "over budget" after their value, so the state is not carried by colour alone.
Can I use the slider with a keyboard, and does it announce changes?
Yes. Tab to the thumb and the arrow keys move it one step, with Page Up, Page Down, Home and End for larger jumps. The visible counts update as it moves, but a screen reader is told the new count only when a move ends, so a drag doesn't produce a stream of announcements.
Does each tab remember its budget?
No. Only the open tab is drawn, so switching away and back starts that tab at its own starting budget again. If you want each tab to keep what you set, lift the budget into the parent component's state, one value per tab.
Related
- Pro
Pill-Driven Flagship Card Features
Tabs and accordionsA features section where four pills pick the one metric a flagship card shows: a giant rolling number with a delta badge and three ticks beside a 24-hour area chart.
- Pro
Tab Swap Split Showcase Features
Tabs and accordionsA features section for a release tool: a line tab switch (Plan, Ship, Review) that swaps one split band, with a drawing flush to the start rail and the copy on the end side.
- Pro
Tabbed Hero Feature Split Features
Tabs and accordionsA features section for a contract-signing tool: pill tabs over one framed card whose contract drawing changes with the stage, a signature field that fills when you press Sign, and the copy under it in two columns.
- Pro
Pill Tab Expand Preview Features
Tabs and accordionsA features section for an email-automation product: a pill segment control swaps three accordion steps (draft, send, measure), and each open step shows its own small drawing beside its text.
- Pro
Segmented Accordion Mockup Features
Tabs and accordionsA features section for a block editor: a segmented control picks a job, an accordion lists its four features, and the one editor screen beside it rings and spotlights the part of the page the open row names.
- Pro
Accordion FAQ Features
Tabs and accordionsA features section for an API gateway told as six capability questions in an accordion beside a sticky side header, each answer a sentence and a small drawing of the capability at work.