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-accentand--vpt-accent-softon.vpt-root: change the active icon tile, primary buttons, switches, progress bars and focus outline.--vpt-bg,--vpt-sideand--vpt-lineon.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-itemand one.tab-pane, then give them a matchingdata-bs-target,id,aria-controlsandaria-labelledby. - Remove
.vpt-label smalltext to get compact, single-line pills. - Replace the
setTimeoutin the.vpt-formsubmit handler with afetch()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.