Skip to content

Settings Drawer with Tabs

Dark Bootstrap 6 Drawer with tabbed settings panels (General, Alerts, Privacy), switches, a Range slider, select menus and a save bar that tracks unsaved changes.

Also known as: settings panel with tabs, side settings drawer, preferences slide out panel, dark settings sidebar

Bootstrap 6 Drawers Responsive Dark #dark #drawer #settings #switch #tabs

Settings Drawer with Tabs live demo

Open in new tab

Bootstrap 6 code (HTML, CSS, JS)

A dark settings panel built on the Bootstrap 6 Drawer. It slides in from the right, and tabs split the preferences into General, Alerts and Privacy. Each tab uses Bootstrap 6 form controls: a segmented appearance picker, select menus, a Range slider with a value bubble, and switches with descriptions. A save bar at the bottom shows whether there are unsaved changes. Use it in dashboards, SaaS apps and admin tools.

How it works

The gear button in the app bar opens <dialog class="drawer drawer-end sdt-drawer"> through data-bs-toggle="drawer". In the demo the dialog has the open attribute, so it is visible on first load. Inside, a nav nav-underline nav-fill tab list switches the .tab-pane panels with data-bs-toggle="tab", with no extra JavaScript. The panes and the footer sit in one form.sdt-form, so a single form holds every setting.

Each switch row is a form-field.sdt-row with a form-field-content block (label plus form-text) and a .switch wrapper. The appearance picker is a btn-group of label.btn-check radios. The language and digest menus are <select class="form-control">.

script.js takes a snapshot of every named field on load. On each input or change it compares the current values with that snapshot. If they differ, the root gets .sdt-dirty, the status reads "Unsaved changes", and Discard and Save become active. Save shows a spinner and simulates a request. Then commitDefaults() copies the current values into defaultChecked, defaultSelected and defaultValue. Because of that, the reset-type Discard button always returns to the last saved state, not to the original markup. The Range instance is created with a formatter, so the bubble reads "15 px".

Customization

  • --sdt-accent on .sdt-root: the cyan accent. It drives --bs-primary-bg and --bs-control-checked-bg, so it changes the tabs underline, switches, slider and Save button.
  • --sdt-page, --sdt-surface and --sdt-line: the navy background, card surfaces and border color.
  • --bs-drawer-width on .sdt-drawer: the width of the panel (400px).
  • Add a tab by adding a nav-item button and a matching .tab-pane with the same id in data-bs-target.
  • formatter in script.js: change the unit shown in the slider bubble.
  • theme-success on the two-factor .switch: any theme-* class colors that switch differently.
  • Remove open from the <dialog> to start closed.

Use cases

  • SaaS dashboards: General, Alerts and Privacy tabs split preferences inside a right-side panel
  • Admin tools: switches, select menus and a range slider cover common settings
  • Web apps: a save bar at the bottom shows whether there are unsaved changes
  • User preferences: a segmented appearance picker lets people choose how the app looks

Accessibility

The tabs follow the ARIA tabs pattern: role="tablist", role="tab" with aria-selected and aria-controls, and role="tabpanel" with aria-labelledby. Every control has a visible label, and switches carry role="switch". The save status is a role="status" live region. After the first open the drawer is a modal <dialog>, with a focus trap and Escape to close. The script keeps aria-expanded on the gear button in sync. The root is pinned to data-bs-theme="dark", so it always renders dark.

Bootstrap 6 notes

  • <dialog class="drawer"> replaces offcanvas.
  • .switch replaces form-switch.
  • form-control on <select> replaces form-select.
  • form-field replaces mb-3 wrappers.
  • The slider is the new Range component.
  • Tabs still use data-bs-toggle="tab", and the panes fade without .fade.
  • This is Bootstrap 6.0.0-alpha.1, so details may change.

Settings Drawer with 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, dark design
Category
Drawers
License
Free for personal and commercial use

Questions about this template

Can I use the Settings Drawer with 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.

Settings Drawer with Tabs – Bootstrap 6 drawers component screenshot
Settings Drawer with Tabs · Bootstrap 6 Drawers

More Drawers

Bottom Drawer Action Sheet – Bootstrap 6 drawers preview

Bottom Drawer Action Sheet

Bootstrap 6 bottom Drawer styled as a mobile action sheet with a share row, edit actions in a list group, pin toggle, delete action and confirmation toasts.

Filter Drawer for Product Lists – Bootstrap 6 drawers preview

Filter Drawer for Product Lists

Bootstrap 6 Drawer from the left with category checks, a Range price slider, feature toggles, rating, in-stock switch, live result count and apply/reset buttons.

Drawer Shopping Cart – Bootstrap 6 drawers preview

Drawer Shopping Cart

Bootstrap 6 Drawer shopping cart that slides in from the right with product rows, quantity steppers, a free-shipping progress bar, subtotal and checkout.

Notification Drawer Panel – Bootstrap 5 drawers preview

Notification Drawer Panel

Bootstrap 5 offcanvas notification drawer with notifications grouped by day, unread filter, mark all as read and dismiss buttons.

Offcanvas Shopping Cart – Bootstrap 5 drawers preview

Offcanvas Shopping Cart

Bootstrap 5 offcanvas cart drawer with quantity steppers, remove buttons, free-shipping progress, live totals and an empty state.

Slide-Over Panel – Tailwind CSS drawers preview

Slide-Over Panel

Tailwind CSS slide-over drawer from the right with header, scrollable form content, sticky footer actions, focus trap and Escape to close.