mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-30 08:39:56 +02:00
Add switch custom form control (#23004)
This commit is contained in:
@@ -1185,6 +1185,22 @@ Custom checkboxes and radios can also be disabled. Add the `disabled` boolean at
|
||||
{% endcapture %}
|
||||
{% include example.html content=example %}
|
||||
|
||||
### Switches
|
||||
|
||||
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.
|
||||
|
||||
{% capture example %}
|
||||
<div class="custom-control custom-switch">
|
||||
<input type="checkbox" class="custom-control-input" id="customSwitch1">
|
||||
<label class="custom-control-label" for="customSwitch1">Toggle this switch element</label>
|
||||
</div>
|
||||
<div class="custom-control custom-switch">
|
||||
<input type="checkbox" class="custom-control-input" disabled id="customSwitch2">
|
||||
<label class="custom-control-label" for="customSwitch2">Disabled switch element</label>
|
||||
</div>
|
||||
{% endcapture %}
|
||||
{% include example.html content=example %}
|
||||
|
||||
### Select menu
|
||||
|
||||
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.
|
||||
|
Reference in New Issue
Block a user