|
@@ -9,41 +9,43 @@ bootstrapLink: components/badge/
|
|
|
|
|
|
The default badges are square and come in the basic set of colors.
|
|
|
|
|
|
-```html example vertical centered separated scrollable height="15rem"
|
|
|
-<span class="badge bg-blue">Blue</span>
|
|
|
-<span class="badge bg-azure">Azure</span>
|
|
|
-<span class="badge bg-indigo">Indigo</span>
|
|
|
-<span class="badge bg-purple">Purple</span>
|
|
|
-<span class="badge bg-pink">Pink</span>
|
|
|
-<span class="badge bg-red">Red</span>
|
|
|
-<span class="badge bg-orange">Orange</span>
|
|
|
-<span class="badge bg-yellow">Yellow</span>
|
|
|
-<span class="badge bg-lime">Lime</span>
|
|
|
-<span class="badge bg-green">Green</span>
|
|
|
-<span class="badge bg-teal">Teal</span>
|
|
|
-<span class="badge bg-cyan">Cyan</span>
|
|
|
+```html example centered separated
|
|
|
+<span class="badge bg-blue-lt">Blue</span>
|
|
|
+<span class="badge bg-azure-lt">Azure</span>
|
|
|
+<span class="badge bg-indigo-lt">Indigo</span>
|
|
|
+<span class="badge bg-purple-lt">Purple</span>
|
|
|
+<span class="badge bg-pink-lt">Pink</span>
|
|
|
+<span class="badge bg-red-lt">Red</span>
|
|
|
+<span class="badge bg-orange-lt">Orange</span>
|
|
|
+<span class="badge bg-yellow-lt">Yellow</span>
|
|
|
+<span class="badge bg-lime-lt">Lime</span>
|
|
|
+<span class="badge bg-green-lt">Green</span>
|
|
|
+<span class="badge bg-teal-lt">Teal</span>
|
|
|
+<span class="badge bg-cyan-lt">Cyan</span>
|
|
|
```
|
|
|
|
|
|
## Headings
|
|
|
|
|
|
-```html example height="240px"
|
|
|
-<h1>Example heading <span class="badge bg-secondary">New</span>
|
|
|
+```html example columns={1} height="20rem" centered
|
|
|
+<h1>Example heading <span class="badge">New</span>
|
|
|
</h1>
|
|
|
-<h2>Example heading <span class="badge bg-secondary">New</span>
|
|
|
+<h2>Example heading <span class="badge">New</span>
|
|
|
</h2>
|
|
|
-<h3>Example heading <span class="badge bg-secondary">New</span>
|
|
|
+<h3>Example heading <span class="badge">New</span>
|
|
|
</h3>
|
|
|
-<h4>Example heading <span class="badge bg-secondary">New</span>
|
|
|
+<h4>Example heading <span class="badge">New</span>
|
|
|
</h4>
|
|
|
-<h5>Example heading <span class="badge bg-secondary">New</span>
|
|
|
+<h5>Example heading <span class="badge">New</span>
|
|
|
</h5>
|
|
|
-<h6>Example heading <span class="badge bg-secondary">New</span>
|
|
|
+<h6>Example heading <span class="badge">New</span>
|
|
|
</h6>
|
|
|
```
|
|
|
|
|
|
## Outline badges
|
|
|
|
|
|
-```html example vertical centered separated scrollable height="15rem"
|
|
|
+
|
|
|
+
|
|
|
+```html example centered separated
|
|
|
<span class="badge badge-outline text-blue">blue</span>
|
|
|
<span class="badge badge-outline text-azure">azure</span>
|
|
|
<span class="badge badge-outline text-indigo">indigo</span>
|
|
@@ -62,75 +64,55 @@ The default badges are square and come in the basic set of colors.
|
|
|
|
|
|
Use the `.badge-pill` class if you want to create a badge with rounded corners. Its width will adjust to the label text.
|
|
|
|
|
|
-```html example centered separated height="7rem"
|
|
|
-<span class="badge badge-pill bg-blue">1</span>
|
|
|
-<span class="badge badge-pill bg-azure">2</span>
|
|
|
-<span class="badge badge-pill bg-indigo">3</span>
|
|
|
-<span class="badge badge-pill bg-purple">4</span>
|
|
|
-<span class="badge badge-pill bg-pink">5</span>
|
|
|
-<span class="badge badge-pill bg-red">6</span>
|
|
|
-<span class="badge badge-pill bg-orange">7</span>
|
|
|
-<span class="badge badge-pill bg-yellow">8</span>
|
|
|
-<span class="badge badge-pill bg-lime">9</span>
|
|
|
-<span class="badge badge-pill bg-green">10</span>
|
|
|
-<span class="badge badge-pill bg-teal">11</span>
|
|
|
-<span class="badge badge-pill bg-cyan">12</span>
|
|
|
-```
|
|
|
-
|
|
|
-## Soft color badges
|
|
|
-
|
|
|
-You can create a soft colour variant of a corresponding contextual badge variation, to make it look more subtle. Click [here](/docs/ui/base/colors) to see the list of available colors and choose ones that best suit your design.
|
|
|
-
|
|
|
-```html example vertical centered separated scrollable height="15rem"
|
|
|
-<span class="badge bg-blue-lt">Blue</span>
|
|
|
-<span class="badge bg-azure-lt">Azure</span>
|
|
|
-<span class="badge bg-indigo-lt">Indigo</span>
|
|
|
-<span class="badge bg-purple-lt">Purple</span>
|
|
|
-<span class="badge bg-pink-lt">Pink</span>
|
|
|
-<span class="badge bg-red-lt">Red</span>
|
|
|
-<span class="badge bg-orange-lt">Orange</span>
|
|
|
-<span class="badge bg-yellow-lt">Yellow</span>
|
|
|
-<span class="badge bg-lime-lt">Lime</span>
|
|
|
-<span class="badge bg-green-lt">Green</span>
|
|
|
-<span class="badge bg-teal-lt">Teal</span>
|
|
|
-<span class="badge bg-cyan-lt">Cyan</span>
|
|
|
+```html example centered separated
|
|
|
+<span class="badge badge-pill bg-blue-lt">1</span>
|
|
|
+<span class="badge badge-pill bg-azure-lt">2</span>
|
|
|
+<span class="badge badge-pill bg-indigo-lt">3</span>
|
|
|
+<span class="badge badge-pill bg-purple-lt">4</span>
|
|
|
+<span class="badge badge-pill bg-pink-lt">5</span>
|
|
|
+<span class="badge badge-pill bg-red-lt">6</span>
|
|
|
+<span class="badge badge-pill bg-orange-lt">7</span>
|
|
|
+<span class="badge badge-pill bg-yellow-lt">8</span>
|
|
|
+<span class="badge badge-pill bg-lime-lt">9</span>
|
|
|
+<span class="badge badge-pill bg-green-lt">10</span>
|
|
|
+<span class="badge badge-pill bg-teal-lt">11</span>
|
|
|
+<span class="badge badge-pill bg-cyan-lt">12</span>
|
|
|
```
|
|
|
|
|
|
## Links
|
|
|
|
|
|
Place the badge within an `<a>` element if you want it to perform the function of a link and make it clickable.
|
|
|
|
|
|
-```html example vertical centered separated scrollable height="15rem"
|
|
|
-<a href="#" class="badge bg-blue">Blue</a>
|
|
|
-<a href="#" class="badge bg-azure">Azure</a>
|
|
|
-<a href="#" class="badge bg-indigo">Indigo</a>
|
|
|
-<a href="#" class="badge bg-purple">Purple</a>
|
|
|
-<a href="#" class="badge bg-pink">Pink</a>
|
|
|
-<a href="#" class="badge bg-red">Red</a>
|
|
|
-<a href="#" class="badge bg-orange">Orange</a>
|
|
|
-<a href="#" class="badge bg-yellow">Yellow</a>
|
|
|
-<a href="#" class="badge bg-lime">Lime</a>
|
|
|
-<a href="#" class="badge bg-green">Green</a>
|
|
|
-<a href="#" class="badge bg-teal">Teal</a>
|
|
|
-<a href="#" class="badge bg-cyan">Cyan</a>
|
|
|
+```html example centered separated
|
|
|
+<a href="#" class="badge bg-blue-lt">Blue</a>
|
|
|
+<a href="#" class="badge bg-azure-lt">Azure</a>
|
|
|
+<a href="#" class="badge bg-indigo-lt">Indigo</a>
|
|
|
+<a href="#" class="badge bg-purple-lt">Purple</a>
|
|
|
+<a href="#" class="badge bg-pink-lt">Pink</a>
|
|
|
+<a href="#" class="badge bg-red-lt">Red</a>
|
|
|
+<a href="#" class="badge bg-orange-lt">Orange</a>
|
|
|
+<a href="#" class="badge bg-yellow-lt">Yellow</a>
|
|
|
+<a href="#" class="badge bg-lime-lt">Lime</a>
|
|
|
+<a href="#" class="badge bg-green-lt">Green</a>
|
|
|
+<a href="#" class="badge bg-teal-lt">Teal</a>
|
|
|
+<a href="#" class="badge bg-cyan-lt">Cyan</a>
|
|
|
```
|
|
|
|
|
|
## Button with badge
|
|
|
|
|
|
Badges can be used as part of links or buttons to provide a counter.
|
|
|
|
|
|
-```html example centered separated height="7rem"
|
|
|
-<button type="button" class="btn">Notifications <span class="badge bg-red ms-2">4</span>
|
|
|
-</button>
|
|
|
-<button type="button" class="btn">Notifications <span class="badge bg-green ms-2">4</span>
|
|
|
+```
|
|
|
+<button type="button" class="btn">
|
|
|
+ Notifications <span class="badge bg-red-lt ms-2">4</span>
|
|
|
</button>
|
|
|
```
|
|
|
|
|
|
-```html
|
|
|
-<button type="button" class="btn">
|
|
|
- Notifications <span class="badge bg-red ms-2">4</span>
|
|
|
+The results can be seen in the example below.
|
|
|
+
|
|
|
+```html example centered separated background="surface"
|
|
|
+<button type="button" class="btn">Notifications <span class="badge bg-red-lt ms-2">4</span>
|
|
|
</button>
|
|
|
-<button type="button" class="btn">
|
|
|
- Notifications <span class="badge bg-green ms-2">4</span>
|
|
|
+<button type="button" class="btn">Notifications <span class="badge bg-green-lt ms-2">4</span>
|
|
|
</button>
|
|
|
```
|