Skip to content

Vertical Pills Tabs

Bootstrap 6 settings panel with vertical icon pills that switch between five content panes, turning into a scrollable pill strip on phones.

Also known as: vertical tabs, vertical pills navigation, settings tabs, side tabs, settings page navigation

Bootstrap 6 Tabs Responsive #pills #responsive #settings #tabs #vertical

Vertical Pills Tabs live demo

Open in new tab

Bootstrap 6 code (HTML, CSS, JS)

A settings panel built with Bootstrap 6 vertical pills: a sidebar of icon pills with short descriptions switches between five content panes (Profile, Notifications, Billing, Security and Integrations). It suits account pages, admin consoles and any screen with several related sections.

How it works

The sidebar is a ul.nav.nav-pills.nav-pills-vertical with role="tablist" and aria-orientation="vertical". Each .vpt-link button carries data-bs-toggle="tab" and data-bs-target pointing to a .tab-pane inside .tab-content. Bootstrap 6's Tab data API does the switching with no init code: it moves .active, updates aria-selected and tabindex, and fades the panes on its own.

Each pill holds an icon tile (.vpt-icon) and a .vpt-label with a <small> subtitle. The active pill turns into a white raised card and its icon tile fills with the accent color.

Below 768 px the same list becomes a horizontal, scrollable strip and the subtitles are hidden. A shown.bs.tab listener in script.js scrolls the active pill into view. From 768 px, .vpt-shell turns into a two-column grid with a fixed 16.5rem sidebar.

The panes use Bootstrap 6 parts: form-field wrappers, form-control on inputs and <select>, .switch toggles, progress bars, an alert theme-success, badges and avatar. The profile form has a submit handler that calls preventDefault() and simulates saving with a short timeout.

Customization

  • --vpt-accent and --vpt-accent-soft on .vpt-root: change the active icon tile, primary buttons, switches, progress bars and focus outline.
  • --vpt-bg, --vpt-side and --vpt-line on .vpt-root: change the page background, sidebar tint and divider lines.
  • grid-template-columns: 16.5rem minmax(0, 1fr) on .vpt-shell (768 px media query): makes the sidebar wider or narrower.
  • Add a pane: copy one nav-item and one .tab-pane, then give them a matching data-bs-target, id, aria-controls and aria-labelledby.
  • Remove .vpt-label small text to get compact, single-line pills.
  • Replace the setTimeout in the .vpt-form submit handler with a fetch() call to your API.

Use cases

  • Account settings pages: vertical icon pills switch between five content panes
  • Admin and profile screens: the pills sit beside the content so every section stays reachable
  • Mobile layouts: the pills turn into a scrollable strip on phones
  • Preference centers: each pane groups related options under one clear label

Accessibility

The nav is a real tablist with aria-orientation="vertical". Arrow keys, Home and End move between tabs, and only the active tab is in the tab order. Each pane is a tabpanel labelled by its tab and focusable with tabindex="0". Icons are aria-hidden, form controls have visible labels, and the save message uses role="status". Pills and panes show a clear outline on keyboard focus. Bootstrap's pane fade turns off under prefers-reduced-motion.

Bootstrap 6 notes

The vertical layout used to need flex-column on a BS5 .nav-pills. In Bootstrap 6 it is the new nav-pills-vertical class. form-select is gone, so the selects use form-control. Switches are .switch with a native switch attribute, buttons are btn-solid theme-primary and btn-outline theme-secondary, and mb-3 wrappers became form-field. The root sets data-bs-theme="light". Built on Bootstrap 6.0.0-alpha.1, so APIs may still change. Icons come from Bootstrap Icons.

Vertical Pills Tabs at a glance

Framework
Bootstrap 6
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
Bootstrap 6, Bootstrap Icons
Layout
Responsive, works on mobile
Category
Tabs
License
Free for personal and commercial use

Questions about this template

Can I use the Vertical Pills Tabs code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load Bootstrap 6 and Bootstrap Icons from a CDN (the links are under Requirements). Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

Add these to your page (already included in the download):

  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha.1/dist/css/bootstrap.min.css">
  • <script type="module" src="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha.1/dist/js/bootstrap.bundle.min.js"></script>
  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">

Built for Bootstrap 6.0.0-alpha.1. Bootstrap 6 ships as an ES module, so its script and this component's JavaScript load with type="module". Alpha releases can still change before the stable version.

Vertical Pills Tabs – free Bootstrap 6 tabs template
Vertical Pills Tabs · free Bootstrap 6 tabs template

More Tabs

Scrollable Tabs with Overflow – free Bootstrap 6 tabs template

Scrollable Tabs with Overflow

Dark Bootstrap 6 underline tabs using NavOverflow: tabs that do not fit move into a More menu that still selects the right pane.

Tabs with Icons – free Bootstrap 6 tabs template

Tabs with Icons

Bootstrap 6 nav tabs with outline icons that turn filled when active, count badges, fading panels and arrow-key navigation, in a project card.

Radio Button Tabs Without JavaScript – free Pure CSS tabs template

Radio Button Tabs Without JavaScript

Accessible CSS-only tabs built from radio inputs and the :checked selector, with a sliding pill indicator and fading panels. No JavaScript.

Scrollable Tabs for Mobile – free Bootstrap 5 tabs template

Scrollable Tabs for Mobile

Bootstrap 5 tabs that scroll horizontally on small screens, with fade edges, arrow buttons, scroll snapping and the active tab centered automatically.

Tabs with Photo Preview Panels – free Tailwind CSS tabs template

Tabs with Photo Preview Panels

Tailwind CSS feature tabs that swap a large photo preview with a caption for each selected tab, with full keyboard support.

Animated Pill Tabs – free Pure CSS tabs template

Animated Pill Tabs

Segmented pill tabs with a sliding, springy background, ARIA tabs keyboard support and fading panels, shown on an analytics card. Pure CSS and vanilla JS.