Forms

Select

Native and fully-themed select controls, styled with the BIMA design system.

Themed select (default)

A browser's native option list can't be styled with CSS, so bima.js enhances every .bima-select into a fully on-brand dropdown automatically — themed list, optgroups, keyboard navigation and type-ahead — while keeping the underlying <select> in the DOM so forms submit and accessibility are preserved. No attribute is required; the page just needs bima.js loaded.

<div class="bima-field">
  <label class="bima-label" for="country">Country</label>
  <select id="country" class="bima-select">
    <option value="">Select a country...</option>
    <optgroup label="Africa">
      <option value="gh">Ghana</option>
      <option value="ke">Kenya</option>
    </optgroup>
  </select>
</div>

<!-- bima.js themes it automatically; no attribute needed -->

Native select (opt-out)

Add data-bima-native to keep the browser's native <select>, still styled with .bima-select inside a .bima-field wrapper.

<div class="bima-field">
  <label class="bima-label" for="country">Country</label>
  <select id="country" class="bima-select" data-bima-native>
    <option value="">Select a country...</option>
    <option value="gh">Ghana</option>
    <option value="ke">Kenya</option>
    <option value="ng">Nigeria</option>
  </select>
</div>

Small select

Use .bima-select--sm for a compact select in toolbars or dense UIs.

<!-- Small -->
<select class="bima-select bima-select--sm" data-bima-select>
  <option>10 per page</option>
  <option>25 per page</option>
</select>

<!-- Default -->
<select class="bima-select" data-bima-select>
  <option>10 per page</option>
  <option>25 per page</option>
</select>

Disabled select

Add the disabled attribute to prevent interaction.

<select class="bima-select" data-bima-select disabled>
  <option>Cannot be changed</option>
</select>

Multiple select

Use the multiple attribute for selecting several values. Use size to control visible rows.

<div class="bima-field">
  <label class="bima-label" for="products">Products</label>
  <select id="products" class="bima-select" multiple size="4">
    <option value="life">Life Insurance</option>
    <option value="health">Health Coverage</option>
    <option value="accident">Accident Protection</option>
    <option value="hospital">Hospital Cash</option>
  </select>
</div>

Option groups

Group related options with <optgroup>.

<select class="bima-select" data-bima-select>
  <option value="">Select region...</option>
  <optgroup label="Africa">
    <option value="gh">Ghana</option>
    <option value="ke">Kenya</option>
  </optgroup>
  <optgroup label="Asia">
    <option value="my">Malaysia</option>
  </optgroup>
</select>