A set of Bootstrap 6 input groups in a store settings card. It covers the patterns you need most: icon prefixes, text prefixes and suffixes, inline buttons, a currency menu, a number stepper, a copy-to-clipboard field and a validated coupon code. Each group works, so you can copy one field or the whole card into an admin panel or checkout.
How it works
The root .igb-root holds an .igb-card with a responsive .igb-grid form. Every field is a .form-field.igb-field with a form-label, an .input-group and optional help or feedback text after the group. Add-ons are .input-group-text spans: Bootstrap Icons for icons, plain text for https://, .com, .00 or @northwind.com. Buttons inside a group use a variant plus input-group-btn, for example btn-solid theme-primary input-group-btn.
script.js adds the behavior:
- Search filters a small
CATALOGarray on click or Enter and writes the result into a polite live region. - Verify checks the domain against
DOMAIN_PATTERN, simulates a DNS lookup and toggles.is-valid/.is-invalid. - Currency is a Bootstrap 6 Menu (
data-bs-toggle="menu"). Clicking an item withdata-igb-currencyanddata-igb-symbolupdates.igb-symboland the button label. - Stepper buttons with
data-igb-stepadd or subtract and clamp to the input'sminandmax. - Copy uses the Clipboard API with a timeout and a
select()fallback for sandboxed frames. - Coupon creates a random code with the shuffle button and validates with
COUPON_PATTERNon submit.
Customization
--igb-orangeon.igb-root: changes the accent. The root maps Bootstrap's--bs-primary-*and--bs-focus-ring-colorto it, so solid buttons and focus rings follow.--igb-addon-bgon.igb-root: sets the background of every.input-group-textadd-on.data-igb-currencyanddata-igb-symbolon the.menu-itembuttons: add currencies such as JPY / ¥.data-igb-stepon the stepper buttons: use5and-5for bigger steps. Changeminandmaxon.igb-stockfor the limits.COUPON_PATTERNandDOMAIN_PATTERNinscript.js: adjust what counts as a valid coupon or domain.- Add
input-group-smorinput-group-lgto any.input-groupto resize all its parts.
Use cases
- Admin panels and store settings: icon prefixes, text suffixes and inline buttons fit settings fields
- Checkout and pricing forms: a currency menu and number stepper handle amounts and quantities
- Developer dashboards: a copy field lets users grab an API key or link in one click
- Promotions and discounts: a coupon field with a shuffle button and validated code format
Accessibility
Every input has a visible <label>. Decorative icon add-ons are aria-hidden, and icon-only buttons have an aria-label. Help and feedback text is linked with aria-describedby, and invalid fields get aria-invalid. The currency button's aria-label reflects the chosen currency, and the menu supports arrow keys and Escape. Buttons inside groups get a visible focus outline that sits above neighbouring add-ons.
Bootstrap 6 notes
Buttons in input groups need the new input-group-btn class, and btn-outline-secondary becomes btn-outline theme-secondary. Bootstrap 5's dropdown-menu becomes a flat .menu with .menu-item buttons and a .menu-header. Feedback goes after the .input-group, inside .form-field. Built on Bootstrap 6.0.0-alpha.1, so APIs may still change.