Custom <select>
menus need only a custom class, .custom-select
to trigger the custom styles. Custom styles are limited to the <select>
’s initial appearance and cannot modify the <option>
s due to browser limitations.
You may also choose from small and large custom selects to match our similarly sized text inputs.
Put <input>
and <label>
into .float-label
class. The label element will float above the placeholder and when the cursor focuses on input, the label will be floating to the top of input element.
To change input element size, you can add .float-label-{lg|sm}
classes.
The file input is the most gnarly of the bunch and requires additional JavaScript if you’d like to hook them up with functional Choose file… and selected file name text.
Each checkbox and radio <input>
and <label>
pairing is wrapped in a <div>
to create our custom control. Structurally, this is the same approach as our default .form-check
.
Custom checkboxes and radios can also be disabled. Add the disabled
boolean attribute to the <input>
and the custom indicator and label description will be automatically styled.
Change custom checkboxes and radios size by adding .custom-control-{sm|lg}
to the default elements.
A switch has the markup of a custom checkbox but uses the .custom-switch
class to render a toggle switch. Switches also support the disabled
attribute.
Create custom <input type="range">
controls with .custom-range
. The track (the background) and thumb (the value) are both styled to appear the same across browsers. As only IE and Firefox support “filling” their track from the left or right of the thumb as a means to visually indicate progress, we do not currently support it.