Select
Select
Section titled “Select”Native select styling for @bnotk/dsx, using modern Chrome-only picker features.
Live Preview
Import
Section titled “Import”<link rel="stylesheet" href="@bnotk/dsx/css/select.css">Or use the full bundle:
<link rel="stylesheet" href="@bnotk/dsx/css/index.css">Browser target
Section titled “Browser target”This module is intentionally written for Chrome 138 / Electron 37.6 and relies on appearance: base-select, ::picker-icon, and ::picker(select).
Classes
Section titled “Classes”| Class | Purpose |
|---|---|
.dsx-select | Base styled native <select> |
.dsx-select--error | Error border modifier for invalid selects |
Use the modifier together with the base class: class="dsx-select dsx-select--error".
States and behavior
Section titled “States and behavior”- Default inset border uses
var(--ds2-color-grey-4). :hoverchanges the inset border tovar(--ds2-color-main).:focususes a 2px inset focus ring withvar(--ds2-color-focus).:disabledusesvar(--ds2-color-grey-2)/var(--ds2-color-grey-3)andcursor: not-allowed.::picker-iconis colored withvar(--ds2-color-main).::picker(select)adds the dropdown panel border, radius, padding, white background, andvar(--ds2-shadow-md).- Checked options use
var(--ds2-color-highlight-light). optgrouplabels are semibold andvar(--ds2-color-main).
Example
Section titled “Example”<select class="dsx-select"> <option>Choose a team</option> <option>Planning</option> <option>Procurement</option></select>Accessibility notes
Section titled “Accessibility notes”- Keep the native
<select>element for keyboard and screen-reader support. - Always connect a visible
<label>. - Add
aria-invalid="true"when using the error modifier. - Use a disabled placeholder option when the field requires an explicit choice.