A dark pricing section built with Bootstrap 6 for developer tools, hosting platforms and SaaS landing pages. It shows three glassy plan cards on a near-black background with soft violet, cyan and pink glows. The recommended plan gets a gradient border. A Bootstrap 6 Menu switches the currency, and the "Read the pricing FAQ" link opens a Drawer with an exclusive accordion.
How it works
The root .dkp-root sets data-bs-theme="dark", so every Bootstrap component inside it, including the Menu, buttons and close button, renders in dark mode no matter what the visitor's OS prefers.
The header holds the currency toggle: a button with data-bs-toggle="menu", directly followed by div.menu.dkp-menu with a menu-header and three button.menu-item elements carrying data-dkp-currency. Each .dkp-amount stores its price per currency in data-usd, data-eur and data-gbp. In script.js, a click on a menu item formats those values with Intl.NumberFormat (rules in the CURRENCIES map). It then marks the chosen item .active with aria-current, updates .dkp-currency-label, announces the change in .dkp-live, closes the menu through Menu.getOrCreateInstance(...).hide() and returns focus to the toggle.
The cards sit in .dkp-grid, which has one column on phones and three from 768px. .dkp-card--hot draws its gradient border with a padding-box / border-box background pair and extends past its neighbours. The FAQ trigger uses data-bs-toggle="drawer" to open dialog.drawer.drawer-end.dkp-drawer. Inside, native <details> elements share name="dkp-faq", so only one answer is open at a time. The script syncs the trigger's aria-expanded on shown.bs.drawer and hidden.bs.drawer.
Customization
data-usd,data-euranddata-gbpon each.dkp-amount: set your real prices per currency. Add a key toCURRENCIESplus a matching menu item and data attribute for more currencies.--dkp-glow-1,--dkp-glow-2and--dkp-glow-3on.dkp-root: recolor the background glows and the gradient border of the recommended card.--bs-accent-bg,--bs-accent-fgand--bs-accent-borderon.dkp-root: re-map the accent role used by the "Get Launch" button, the badge and the drawer button.--dkp-bgand--dkp-cardon.dkp-root: change the page black and the translucent card fill.- Move
dkp-card--hotand the.dkp-hotbadge to anotherarticleto recommend a different plan.
Use cases
- Developer tools: three glass plan cards sit on a near-black background with soft glows
- Hosting platforms: the recommended plan has a gradient border to stand out
- SaaS landing pages: a currency menu changes the prices shown
- Pricing support: a Read the pricing FAQ link opens a drawer with an accordion
Accessibility
Each plan is an article labelled by its heading, and all icons are aria-hidden. The Menu supports arrow keys and Escape, and focus returns to its toggle after a choice. The Drawer is a native modal <dialog> labelled by its title, so it traps focus and closes with Escape. The accordion uses real <summary> elements. Text colors keep strong contrast on the dark surfaces, and the price blur-in animation is disabled under prefers-reduced-motion.
Bootstrap 6 notes
The Bootstrap 5 dropdown with dropdown-menu and dropdown-item becomes a flat .menu with .menu-item, opened by data-bs-toggle="menu". Offcanvas is now a <dialog class="drawer">. The accordion is built on <details>, and a shared name replaces data-bs-parent. Buttons use btn-solid btn-styled theme-accent, btn-outline theme-secondary and btn-text. Built on Bootstrap 6.0.0-alpha.1, so APIs may still change. Icons come from Bootstrap Icons.