aboutsummaryrefslogtreecommitdiff
path: root/site/content/docs/forms/select.md
diff options
context:
space:
mode:
authorXhmikosR <[email protected]>2019-08-01 18:07:17 +0300
committerXhmikosR <[email protected]>2021-01-18 22:52:38 +0200
commit72d7e4612bc97230e2c1da0d5e2229ec21793e51 (patch)
tree49e1aa85f43a1641973ac5dd614d066bb0c871af /site/content/docs/forms/select.md
parent4167c107f81aeb2b05e3fe3e2e511b50ea9be640 (diff)
downloadbootstrap-main-xmr-hugo-reorg-files.tar.xz
bootstrap-main-xmr-hugo-reorg-files.zip
Trying to get rid of the version number from folders.main-xmr-hugo-reorg-files
Diffstat (limited to 'site/content/docs/forms/select.md')
-rw-r--r--site/content/docs/forms/select.md75
1 files changed, 75 insertions, 0 deletions
diff --git a/site/content/docs/forms/select.md b/site/content/docs/forms/select.md
new file mode 100644
index 000000000..e2b0bd6a8
--- /dev/null
+++ b/site/content/docs/forms/select.md
@@ -0,0 +1,75 @@
+---
+layout: docs
+title: Select
+description: Customize the native `<select>`s with custom CSS that changes the element's initial appearance.
+group: forms
+toc: true
+---
+
+## Default
+
+Custom `<select>` menus need only a custom class, `.form-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.
+
+{{< example >}}
+<select class="form-select" aria-label="Default select example">
+ <option selected>Open this select menu</option>
+ <option value="1">One</option>
+ <option value="2">Two</option>
+ <option value="3">Three</option>
+</select>
+{{< /example >}}
+
+## Sizing
+
+You may also choose from small and large custom selects to match our similarly sized text inputs.
+
+{{< example >}}
+<select class="form-select form-select-lg mb-3" aria-label=".form-select-lg example">
+ <option selected>Open this select menu</option>
+ <option value="1">One</option>
+ <option value="2">Two</option>
+ <option value="3">Three</option>
+</select>
+
+<select class="form-select form-select-sm" aria-label=".form-select-sm example">
+ <option selected>Open this select menu</option>
+ <option value="1">One</option>
+ <option value="2">Two</option>
+ <option value="3">Three</option>
+</select>
+{{< /example >}}
+
+The `multiple` attribute is also supported:
+
+{{< example >}}
+<select class="form-select" multiple aria-label="multiple select example">
+ <option selected>Open this select menu</option>
+ <option value="1">One</option>
+ <option value="2">Two</option>
+ <option value="3">Three</option>
+</select>
+{{< /example >}}
+
+As is the `size` attribute:
+
+{{< example >}}
+<select class="form-select" size="3" aria-label="size 3 select example">
+ <option selected>Open this select menu</option>
+ <option value="1">One</option>
+ <option value="2">Two</option>
+ <option value="3">Three</option>
+</select>
+{{< /example >}}
+
+## Disabled
+
+Add the `disabled` boolean attribute on a select to give it a grayed out appearance and remove pointer events.
+
+{{< example >}}
+<select class="form-select" aria-label="Disabled select example" disabled>
+ <option selected>Open this select menu</option>
+ <option value="1">One</option>
+ <option value="2">Two</option>
+ <option value="3">Three</option>
+</select>
+{{< /example >}}