No project linked, as I’ve not begun yet. I have noticed there’s no simple way to style form select dropdown lists. I need a form that has several categories within it, so I’d like to bold some items, and if possible make those items non-selectable. See the attached screenshot for my figma mockup. I’d also like to be able to style the dropdown itself so I can match the mockup.
To achieve a styled dropdown with bold, non-selectable category headings, use the built-in <optgroup> feature in form dropdowns. This allows you to group related options under bold labels that users cannot select. Most browsers automatically style these headings in bold. However, if you want further customization, such as changing colors or spacing, you may need to apply CSS styles. If standard styling options are too limited, consider using a custom dropdown solution with JavaScript libraries like Select2 or Choices.js, which offer greater flexibility in appearance and functionality.