A warm, card-based showcase of Bootstrap 6 native selects: small, default and large sizes, a grouped list with <optgroup>, a disabled field with help text and a multi-select list. A summary bar in the header shows the current choices in one line. It suits checkout steps, order settings and admin preference pages.
How it works
Bootstrap 6 dropped .form-select, so every <select> here uses .form-control. The left .fss-card stacks three fields: form-control form-control-sm, plain form-control and form-control form-control-lg. A .fss-size-tag next to each label names the class. Each label and select sits in a .form-field wrapper, the Bootstrap 6 grid that replaces the old mb-3 div.
The right card holds:
- a select whose options are grouped by region with
<optgroup>, with one option disabled; - a
disabledselect linked to its.form-texthelp line througharia-describedby; .fss-multi, amultiple size="4"select. Bootstrap removes the caret on it automatically.
The look comes from Bootstrap's own custom properties, set on .fss-root .form-control: --bs-control-bg, --bs-control-border-color, --bs-control-border-radius and --bs-control-select-bg. The last one swaps the caret for a terracotta SVG stored in --fss-caret. Selected options in the multi-select get the accent color through option:checked.
script.js (an ES module) reads every select with a data-fss-key attribute when one of them fires change. It writes a short summary into the <output class="fss-output">. Each .fss-root on the page is handled on its own.
Customization
--fss-accentand--fss-accent-softon.fss-root: change the eyebrow, icons, focus ring and selected options.--fss-careton.fss-root: replace the SVG data URI to change the arrow icon or its stroke color (%23c2553a).--bs-control-border-radiusin the.fss-root .form-controlrule: use0.25remfor sharp fields or999pxfor pill selects.- Swap
form-control-sm/form-control-lgon any select to change its height, padding and font size. - Add or remove
data-fss-keyon a select to include or skip it in the summary.Warehousegets a "from" prefix indescribe(). - Remove the
disabledattribute from#fss-carrierand add real options once the plan allows carrier choice.
Use cases
- Checkout steps: a grouped region select with a disabled option and a disabled carrier field with help text
- Order and preference settings: small, default and large selects match different form densities
- Admin preference pages: a multi-select list and a live summary bar show the current choices
- Design reference pages: all native select variants sit side by side with their class names
Accessibility
Every select has a visible <label for>. The disabled carrier field is described by its help text. The summary is an <output> with aria-live="polite", so screen readers announce the new values. The focus ring comes from --bs-focus-ring, set on the root in the accent color. Native selects keep full keyboard support, including type-ahead and multi-select with Shift/Ctrl.
Bootstrap 6 notes
.form-select from Bootstrap 5 is gone. Use .form-control on <select> with form-control-sm or form-control-lg. The mb-3 wrapper becomes .form-field. Colors are oklch() tokens, and --bs-*-rgb variables no longer exist. This snippet targets Bootstrap 6.0.0-alpha.1, so class names and variables may still change. Icons come from Bootstrap Icons.