From f1a269d43c9652ab1a9c2e2e7bbc7c6067caf0df Mon Sep 17 00:00:00 2001 From: ZhangChengLin <469946668@qq.com> Date: Mon, 5 Jun 2023 23:02:46 +0800 Subject: [PATCH] add a base class style display for toggle buttons --- site/content/docs/5.3/components/buttons.md | 26 ++++++++++++++---- site/content/docs/5.3/forms/checks-radios.md | 29 +++++++++++++++++--- 2 files changed, 45 insertions(+), 10 deletions(-) diff --git a/site/content/docs/5.3/components/buttons.md b/site/content/docs/5.3/components/buttons.md index ae58fca9a365..d3f41248d279 100644 --- a/site/content/docs/5.3/components/buttons.md +++ b/site/content/docs/5.3/components/buttons.md @@ -178,15 +178,29 @@ Visually, these toggle buttons are identical to the [checkbox toggle buttons]({{ Add `data-bs-toggle="button"` to toggle a button's `active` state. If you're pre-toggling a button, you must manually add the `.active` class **and** `aria-pressed="true"` to ensure that it is conveyed appropriately to assistive technologies. {{< example >}} - - - +
+ + + +
++ + + +
{{< /example >}} {{< example >}} -Toggle link -Active toggle link -Disabled toggle link + + {{< /example >}} ### Methods diff --git a/site/content/docs/5.3/forms/checks-radios.md b/site/content/docs/5.3/forms/checks-radios.md index 13a5091ad604..a18ab38c2b64 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 >}} -{{< /example >}} -{{< example >}} -{{< /example >}} -{{< example >}} {{< /example >}} +{{< example >}} + + + + + + + + +{{< /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 {{< /example >}} +{{< example >}} + + + + + + + + + + + +{{< /example >}} + ### Outlined styles Different variants of `.btn`, such at the various outlined styles, are supported.