Standard Tabs
The default text-only tab strip. Reach for this when labels alone are enough to distinguish the panels and you want the broadest layout flexibility across vertical, divider, and card views.
Welcome
Welcome to our platform. Here you'll find the latest updates and important information about our services and offerings.
This is the main dashboard where users can quickly access key features and get an overview of their account status.
Getting Started
Explore the available services, review your recent activity, or configure your account preferences from the tabs above.
- Browse available government services
- Track your application status
- Manage your profile and notifications
With Leading Icons
Icons before each label help users scan and identify tabs quickly
Dashboard
Your main dashboard with key metrics and quick access to important features.
Built-in Features
Activates when .nds-tabs is on the page. Tab switching, keyboard handling, and scroll behavior attach automatically.
Arrow keys move between tabs, Home and End jump to first and last, and Enter or Space activates the focused tab.
Arrow key direction reverses automatically in RTL layouts so navigation always feels natural to the reading direction.
Long tab lists scroll horizontally with gradient fade indicators, drag-to-scroll, mouse wheel support, and a show-more button.
Add nds-vertical for a side-stacked tab list with sticky positioning and vertical indicator bars.
Enhanced borders appear in high-contrast mode, and all transitions are disabled when the user prefers reduced motion.
Every tab switch dispatches an nds:tab:change event with the new and previous tab and panel references.
Switch tabs, query the active panel, or destroy instances through the JS API on NDS.Tabs or each element's .ndsTabs property.
Usage Guidelines
Best Practices
- Use tabs to organize related content that users access one section at a time, such as settings categories, service details, or dashboard views
- Use tabs for content that benefits from quick comparison, where switching between panels helps users evaluate options without leaving the page
- Use vertical tabs when the tab list is long or when labels need more space, such as multi-step configuration panels or category navigation
- Do not use tabs for sequential workflows where the user must complete steps in order. Use a Stepper instead
- Do not use tabs for simple content that fits on one page without segmentation. Unnecessary tabs add interaction cost
- Choose card view when tabs appear inside a content area that already has a background, to visually contain the tab group
- Add the divider modifier when you need a clear visual boundary between the tab list and the panel content
- Keep tab labels short (one to three words). Long labels cause excessive scrolling in horizontal layouts
- Add icons to tabs when they represent distinct categories that benefit from visual differentiation, but avoid icons on text-heavy labels where they add clutter
- Aim for three to seven visible tabs. Beyond that, the overflow scroll mechanism handles the rest, but users may not discover hidden tabs easily
- Structure tab panel content using
nds-blockwithnds-block-titleheadings. Multiple content blocks per panel create clear visual sections within a single tab - Place the most frequently accessed tab first, as it becomes the default active panel on page load
Modifier Classes
| Class | Description |
|---|---|
nds-vertical |
Switches to a side-stacked vertical tab layout with sticky positioning |
nds-divided |
Adds a divider line between the tab list and panel content |
nds-center |
Centers the tab list horizontally within the container |
nds-lg |
Increases tab button height for a larger touch target |
nds-card nds-stroke nds-shadow |
Wraps the tab group in a card container with border and shadow |
CSS Custom Properties
| Property | Default | Description |
|---|---|---|
--scroll-fade |
48px | Width of the gradient fade at the edges of an overflowing tab list (set on the inner .nds-scroll-more) |
--btn-indicator-size |
3px | Thickness of the active tab indicator bar and divider line |
JavaScript API
The NDS.Tabs API provides methods to create, switch, and query tab instances. Each initialized .nds-tabs element stores its instance on the .ndsTabs DOM property.