Tabs
Tabs organize related content into sections within a single page view. Syhrezz uses three tab variants: underline (page-level), pill (filter/card-level), and vertical (settings pages).
Overview
Use tabs to switch between views of the same context — not to navigate to different pages. Tab content switches without page reload. The active tab is always clearly indicated by color and/or underline. Never use tabs with more than 6 items per row.
Underline Tabs
Used at the page level for major content sections (e.g., customer detail page: Overview / Activities / Transactions / Contacts).
Pill Tabs
Used inside cards for filtering or switching between sub-views. The pill container has a light grey background, and the active tab gets a white card-like elevated appearance.
Vertical Tabs
Used on settings pages where left-nav style navigation is appropriate.
Token Reference
| Variant | Container | Active State | Use For |
|---|---|---|---|
| Underline | .tabs-ul | color:#6366F1, border-bottom:2px solid #6366F1 | Page-level section switching |
| Pill | .tabs-pill | bg:#fff, box-shadow:0 1px 4px rgba(0,0,0,.08), color:#6366F1 | Card-level filter tabs |
| Vertical | .tabs-vert-nav | bg:#EEF2FF, border-left:3px solid #6366F1, color:#6366F1 | Settings page navigation |
AI Implementation Notes
.active on both the tab button and its corresponding panel. Tab panels use display:none by default and display:block when active. Use .tabs-ul for customer/prospect detail pages. Use .tabs-pill for filter controls inside cards. Use .tabs-vert for settings pages. Active color is always #6366F1 across all variants.
When to Use
- Switching between related views of the same entity (Overview, Activities, Transactions)
- Filtering data into categories within a card
- Settings page section navigation (vertical tabs)
- Navigating between different pages — use sidebar links
- More than 6 tabs in a row — consider a select or menu
- Comparing content side by side — show both panels
Properties
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
| variant | string | required | — | Tab style. 'underline' | 'pill' | 'vertical' |
| activeTab | string | required | — | ID of currently active tab panel. |
| tabs | array | required | — | Array of tab objects: {id, label}. Max 6 for underline/pill variants. |
Behavior
| Trigger | Behavior |
|---|---|
| Tab click | Remove .active from all tabs + panels. Add .active to clicked tab + matching panel. No page reload. |
| Keyboard | Arrow keys cycle through tabs. Enter/Space activates focused tab. Tab key moves to panel content. |
Design Decisions
Changelog
- 3 variants: underline, pill, vertical
- Active state via .active class on tab + panel
- Keyboard navigation support
States
Accessibility
| Requirement | Implementation |
|---|---|
| role="tablist" | Add to tab container element. |
| role="tab" | Add to each tab button. |
| role="tabpanel" | Add to each panel div. |
| aria-selected | true on active tab, false on others. |
| aria-controls | Points to panel ID from tab button. |
| Arrow keys | Left/Right navigate between tabs. Enter/Space activates. |