Numbered tabs
Steps through the few numbered sections of one page.
Sizes
defaultdefault
sm
States
rest
hover
focus-visible
Usage
Rules
6 rules
- Must
- Use numbered tabs only when the sections run in an order; the index says so. Because a number promises a sequence, and numbered siblings read as steps that are not there.
- Must
- Keep one row of numbered tabs per page, at its head. Because the yellow bar is the brand, spent once, and two rows of it compete with the page's one action.
- Never
- Type the number or the brackets into the label. Because the list numbers the tabs in written order and draws the brackets, so a typed one doubles or drifts when a tab moves.
- Never
- Make the yellow bar the only sign of the selected tab, or paint the index yellow in light. Because sodium yellow on white is 1.4:1, so the gold index and the text-1 label carry the selection and the bar sits beside them.
- Should
- Keep the row to two to five tabs. Because past five the numbers stop helping and the row scrolls.
- Should
- Pass index to the first trigger only when the row continues an order shown elsewhere. Because the list counts from 01 in written order on its own.
State order
5 states, highest first
- 1
- disabled
- 2
- selected
- 3
- focus-visible
- 4
- hover
- 5
- rest
Accessibility
4 checks
- Tabs semantics from Base UI: tablist, tab with aria-selected, tabpanel.
- The index is read as part of the tab's name ("01 Ingest"); the brackets are drawn and not read.
- Selected: the index in --accent-text (6.2:1 in light, yellow at 12.9:1 in dark) and the label in text-1; the 2px bar is decoration in light.
- Focus is the 2px ring drawn inside the tab.
Keyboard
2 keys
- Left, Right
- Moves between tabs and selects, mirrored in right to left.
- Home, End
- First and last tab.
Edge cases
4 edge cases
- Phone, 390 wide
- The row scrolls sideways along its rule; the selected tab scrolls into view.
- Dark theme
- The index and the bar are both sodium yellow on the near-black page.
- Forced colors
- The bar takes the Highlight colour.
- Ten or more
- The index grows to two digits from the start, so 01 and 10 line up.
API
5 props
NumberedTabs value, defaultValue, onValueChangeBase UINumberedTabsList size'default' | 'sm'default'default'NumberedTabsTrigger indexnumberdefaultwritten orderNumberedTabsPanelspartNumberedTabsContent keepMountedbooleandefaulttrue
Tokens
11 tokens
--accent- #ffd400
--accent-text- #7a5d00
--line- #e2dfd5
--row- 40px
--control- 32px
--type-label- 400 13px/16px var(--font-mono)
--type-label-sm- 400 12px/16px var(--font-mono)
--text-1- #161512
--text-2- #55524a
--text-3- #6b675e
--focus- #7a5d00