aboutsummaryrefslogtreecommitdiff
path: root/site/content/docs/5.3/forms
diff options
context:
space:
mode:
authorZhangChengLin <[email protected]>2023-06-05 23:02:46 +0800
committerMark Otto <[email protected]>2023-07-05 22:28:57 -0700
commit2c7f888c1ec667119c6a811ed247aaa3cd539fed (patch)
tree92e4356713913d39f4070271861afb48d37b0a1a /site/content/docs/5.3/forms
parent6301ca1ee070b1614ff1fd9fc23b0f1bf869475e (diff)
downloadbootstrap-2c7f888c1ec667119c6a811ed247aaa3cd539fed.tar.xz
bootstrap-2c7f888c1ec667119c6a811ed247aaa3cd539fed.zip
add a base class style display for toggle buttons
Diffstat (limited to 'site/content/docs/5.3/forms')
-rw-r--r--site/content/docs/5.3/forms/checks-radios.md29
1 files changed, 25 insertions, 4 deletions
diff --git a/site/content/docs/5.3/forms/checks-radios.md b/site/content/docs/5.3/forms/checks-radios.md
index 13a5091ad..a18ab38c2 100644
--- a/site/content/docs/5.3/forms/checks-radios.md
+++ b/site/content/docs/5.3/forms/checks-radios.md
@@ -250,18 +250,25 @@ Create button-like checkboxes and radio buttons by using `.btn` styles rather th
{{< example >}}
<input type="checkbox" class="btn-check" id="btn-check" autocomplete="off">
<label class="btn btn-primary" for="btn-check">Single toggle</label>
-{{< /example >}}
-{{< example >}}
<input type="checkbox" class="btn-check" id="btn-check-2" checked autocomplete="off">
<label class="btn btn-primary" for="btn-check-2">Checked</label>
-{{< /example >}}
-{{< example >}}
<input type="checkbox" class="btn-check" id="btn-check-3" autocomplete="off" disabled>
<label class="btn btn-primary" for="btn-check-3">Disabled</label>
{{< /example >}}
+{{< example >}}
+<input type="checkbox" class="btn-check" id="btn-check-4" autocomplete="off">
+<label class="btn" for="btn-check-4">Single toggle</label>
+
+<input type="checkbox" class="btn-check" id="btn-check-5" checked autocomplete="off">
+<label class="btn" for="btn-check-5">Checked</label>
+
+<input type="checkbox" class="btn-check" id="btn-check-6" autocomplete="off" disabled>
+<label class="btn" for="btn-check-6">Disabled</label>
+{{< /example >}}
+
{{< callout info >}}
Visually, these checkbox toggle buttons are identical to the [button plugin toggle buttons]({{< docsref "/components/buttons#button-plugin" >}}). However, they are conveyed differently by assistive technologies: the checkbox toggles will be announced by screen readers as "checked"/"not checked" (since, despite their appearance, they are fundamentally still checkboxes), whereas the button plugin toggle buttons will be announced as "button"/"button pressed". The choice between these two approaches will depend on the type of toggle you are creating, and whether or not the toggle will make sense to users when announced as a checkbox or as an actual button.
{{< /callout >}}
@@ -282,6 +289,20 @@ Visually, these checkbox toggle buttons are identical to the [button plugin togg
<label class="btn btn-secondary" for="option4">Radio</label>
{{< /example >}}
+{{< example >}}
+<input type="radio" class="btn-check" name="options-base" id="option5" autocomplete="off" checked>
+<label class="btn" for="option5">Checked</label>
+
+<input type="radio" class="btn-check" name="options-base" id="option6" autocomplete="off">
+<label class="btn" for="option6">Radio</label>
+
+<input type="radio" class="btn-check" name="options-base" id="option7" autocomplete="off" disabled>
+<label class="btn" for="option7">Disabled</label>
+
+<input type="radio" class="btn-check" name="options-base" id="option8" autocomplete="off">
+<label class="btn" for="option8">Radio</label>
+{{< /example >}}
+
### Outlined styles
Different variants of `.btn`, such at the various outlined styles, are supported.