Navigations
Tabs make it easy to switch between different views.
Note that this component requires the use of our Tabs plugin, else you can skip this message if you are already using Preline UI as a package.
Use the tab JavaScript plugin - to extend our navigational tabs and pills to create tabbable panes of local content.
Dynamic tabbed interfaces, as described in the WAI ARIA Authoring Practices, require role="tablist"
, role="tab"
, role="tabpanel"
, and additional aria-
attributes in order to convey their structure, functionality and current state to users of assistive technologies (such as screen readers). As a best practice, we recommend using <button>
elements for the tabs, as these are controls that trigger a dynamic change, rather than links that navigate to a new page or location.
A basic form of tabs with underline.
This is the first item's tab body.
This is the second item's tab body.
This is the third item's tab body.
Contained tabs with icons.
This is the first item's tab body.
This is the second item's tab body.
This is the third item's tab body.
Contained tabs with badges.
This is the first item's tab body.
This is the second item's tab body.
This is the third item's tab body.
Centered with .justify-center
:
This is the first item's tab body.
This is the second item's tab body.
This is the third item's tab body.
Right-aligned with .justify-end
:
This is the first item's tab body.
This is the second item's tab body.
This is the third item's tab body.
Vertically stacked navigation.
This is the first item's tab body.
This is the second item's tab body.
This is the third item's tab body.
Another type of Tabs.
This is the first item's tab body.
This is the second item's tab body.
This is the third item's tab body.
Where long content doesn't fit on the screen, horizontal scrollbar keeps the tab bar inline.
Resize the example to see it in action.
Where long content doesn't fit on the screen, change the tab bar to <select>
on mobile.
Resize the example to see it in action.
This is the first item's tab body.
This is the second item's tab body.
This is the third item's tab body.
This is the first item's tab body.
This is the second item's tab body.
This is the third item's tab body.
Another type of Tabs with segment.
This is the first item's tab body.
This is the second item's tab body.
This is the third item's tab body.
Another type of Tabs with underlined bar.
This is the first item's tab body.
This is the second item's tab body.
This is the third item's tab body.
Another type of Tabs with pills on gray color.
This is the first item's tab body.
This is the second item's tab body.
This is the third item's tab body.
Another type of Tabs with pills.
This is the first item's tab body.
This is the second item's tab body.
This is the third item's tab body.
Force your nav's contents to extend the full available width one of two modifier classes. Notice that all horizontal space is occupied, but not every nav item has the same width.
This is the first item's tab body.
This is the second item's tab body.
This is the third item's tab body.
All horizontal space will be occupied by nav links, but unlike the example above, every nav item will be the same width.
This is the first item's tab body.
This is the second item's tab body.
This is the third item's tab body.