You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
The default badges are square and come in the basic set of colors.
11
11
12
12
{% capture html -%}
13
-
<spanclass="badge bg-blue-lt">Blue</span>
14
-
<spanclass="badge bg-azure-lt">Azure</span>
15
-
<spanclass="badge bg-indigo-lt">Indigo</span>
16
-
<spanclass="badge bg-purple-lt">Purple</span>
17
-
<spanclass="badge bg-pink-lt">Pink</span>
18
-
<spanclass="badge bg-red-lt">Red</span>
19
-
<spanclass="badge bg-orange-lt">Orange</span>
20
-
<spanclass="badge bg-yellow-lt">Yellow</span>
21
-
<spanclass="badge bg-lime-lt">Lime</span>
22
-
<spanclass="badge bg-green-lt">Green</span>
23
-
<spanclass="badge bg-teal-lt">Teal</span>
24
-
<spanclass="badge bg-cyan-lt">Cyan</span>
13
+
<divclass="badges-list">
14
+
{% for color in site.colors -%}
15
+
{% include "ui/badge.html" color=color[0] text=color[1].title %}
16
+
{%- endfor -%}
17
+
</div>
25
18
{%- endcapture %}
26
19
{% include "docs/example.html" html=html centered %}
27
20
28
21
##Headings
29
22
23
+
Badges can be used in headings to draw attention to new or important information. You can use them in any heading level, from`<h1>` to`<h6>`. The example below shows how to use badges in headings.
{% include "ui/badge.html" color=color[0] text=color[1].title class="badge-pill" %}
73
+
{%- endfor -%}
74
+
{%- endcapture %}
75
+
{% include "docs/example.html" html=html centered %}
76
+
77
+
You can use it to create a pill with numbers, for example, to show the number of unread messages. The badge will adjust its width to the number of digits.
78
+
79
+
{% capture html -%}
80
+
{%- for color in site.colors -%}
81
+
{% include "ui/badge.html" color=color[0] text=forloop.index class="badge-pill" %}
82
+
{%- endfor -%}
83
+
{%- endcapture %}
84
+
{% include "docs/example.html" html=html centered %}
85
+
86
+
##Badges with icons
87
+
88
+
You can use icons in badges to make them more visually appealing. The example below demonstrates how to use icons in badges.
89
+
90
+
{% capture html -%}
91
+
{% include "ui/badge.html" text="Star" icon="star" -%}
92
+
{% include "ui/badge.html" text="Heart" icon="heart" -%}
93
+
{% include "ui/badge.html" text="Check" icon="check" -%}
94
+
{% include "ui/badge.html" text="X" icon="x" -%}
95
+
{% include "ui/badge.html" text="Plus" icon="plus" -%}
96
+
{% include "ui/badge.html" text="Minus" icon="minus" -%}
97
+
{%- endcapture %}
98
+
{% include "docs/example.html" html=html centered %}
99
+
100
+
You can also use an icon on the right side of the badge. The example below demonstrates how to use icons on the right side of badges.
101
+
102
+
{% capture html -%}
103
+
{% include "ui/badge.html" text="Star" icon-right="arrow-right" -%}
104
+
{% include "ui/badge.html" text="Heart" icon-right="arrow-right" -%}
105
+
{% include "ui/badge.html" text="Check" icon-right="arrow-right" -%}
106
+
{% include "ui/badge.html" text="X" icon-right="arrow-right" -%}
107
+
{% include "ui/badge.html" text="Plus" icon-right="arrow-right" -%}
108
+
{% include "ui/badge.html" text="Minus" icon-right="arrow-right" -%}
77
109
{%- endcapture %}
78
110
{% include "docs/example.html" html=html centered %}
79
111
@@ -99,14 +131,55 @@ Place the badge within an `<a>` element if you want it to perform the function o
99
131
100
132
##Button with badge
101
133
102
-
Badges can be used as part of links or buttons to provide, for example, a counter.
134
+
Badges can be used as parts of links or buttons to provide, for example, a counter. Use the`.badge-notification` class to create a notification badge. This class will position the badge in the top right corner of the button.
135
+
136
+
If you don't provide text for the badge, you end up with a small dot. This is useful for creating a simple notification button.
Inbox {% include "ui/badge.html" text="4" color="red" class="badge-notification" -%}
144
+
</button>
145
+
<buttontype="button"class="btn">
146
+
Profile {% include "ui/badge.html" text="" color="red" class="badge-notification" -%}
110
147
</button>
111
148
{%- endcapture %}
112
149
{% include "docs/example.html" html=html centered %}
150
+
151
+
##Animated badges
152
+
153
+
You can use the`.badge-blink` class to create a blinking effect. This class will add a CSS animation to the badge, so it will blink to draw attention.
154
+
155
+
{% capture html -%}
156
+
<buttontype="button"class="btn">
157
+
Profile {% include "ui/badge.html" text="" color="red" class="badge-notification badge-blink" -%}
158
+
</button>
159
+
{% endcapture %}
160
+
{% include "docs/example.html" html=html centered %}
161
+
162
+
##Size Options
163
+
164
+
Use`.badge-sm` or`.badge-lg` to change badge size according to your needs. The default size is`.badge` and it is used in the examples above.
165
+
166
+
{% capture html -%}
167
+
<div>
168
+
{% include "ui/badge.html" color="primary" scale="sm" text="New" class="badge-sm" -%}
169
+
{% include "ui/badge.html" color="primary" scale="sm" text="1" class="badge-pill" -%}
170
+
</div>
171
+
<div>
172
+
{% include "ui/badge.html" color="primary" text="New" class="badge-sm" -%}
173
+
{% include "ui/badge.html" color="primary" text="1" class="badge-pill" -%}
174
+
</div>
175
+
<div>
176
+
{% include "ui/badge.html" color="primary" scale="lg" text="New" class="badge-sm" -%}
177
+
{% include "ui/badge.html" color="primary" scale="lg" text="1" class="badge-pill" -%}
178
+
</div>
179
+
{%- endcapture %}
180
+
{% include "docs/example.html" html=html centered vertical %}
181
+
182
+
183
+
##More examples
184
+
185
+
If you want to see more examples of badges, you can check out the[Bootstrap documentation](https://getbootstrap.com/docs/5.3/components/badge/) for badges. You can also find more examples in the Tabler[Badges](https://preview.tabler.io/badges.html) preview.
Copy file name to clipboardExpand all lines: docs/content/ui/components/breadcrumb.md
+11-90Lines changed: 11 additions & 90 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,19 +12,9 @@ Use the `breadcrumb` class to add a breadcrumb to your interface design for bett
12
12
Look at the example below to see how breadcrumbs work in practice.
13
13
14
14
{% capture html -%}
15
-
<olclass="breadcrumb">
16
-
<liclass="breadcrumb-item">
17
-
<a href="#">Home</a>
18
-
</li>
19
-
<liclass="breadcrumb-item">
20
-
<a href="#">Library</a>
21
-
</li>
22
-
<liclass="breadcrumb-item active">
23
-
<a href="#">Data</a>
24
-
</li>
25
-
</ol>
15
+
{% include "ui/breadcrumb.html" pages="Home,Library,Data" %}
26
16
{%- endcapture %}
27
-
{% include "docs/example.html" html=htmlvertical separated %}
17
+
{% include "docs/example.html" html=htmlcentered %}
28
18
29
19
##Different separators
30
20
@@ -33,60 +23,18 @@ You can use different breadcrumb styles to match your website or app design. Cho
33
23
This example shows how to use different breadcrumb styles.
34
24
35
25
{% capture html -%}
36
-
<olclass="breadcrumb breadcrumb-dots">
37
-
<liclass="breadcrumb-item">
38
-
<a href="#">Home</a>
39
-
</li>
40
-
<liclass="breadcrumb-item">
41
-
<a href="#">Library</a>
42
-
</li>
43
-
<liclass="breadcrumb-item active">
44
-
<a href="#">Data</a>
45
-
</li>
46
-
</ol>
47
-
<olclass="breadcrumb breadcrumb-arrows">
48
-
<liclass="breadcrumb-item">
49
-
<a href="#">Home</a>
50
-
</li>
51
-
<liclass="breadcrumb-item">
52
-
<a href="#">Library</a>
53
-
</li>
54
-
<liclass="breadcrumb-item active">
55
-
<a href="#">Data</a>
56
-
</li>
57
-
</ol>
58
-
<olclass="breadcrumb breadcrumb-bullets">
59
-
<liclass="breadcrumb-item">
60
-
<a href="#">Home</a>
61
-
</li>
62
-
<liclass="breadcrumb-item">
63
-
<a href="#">Library</a>
64
-
</li>
65
-
<liclass="breadcrumb-item active">
66
-
<a href="#">Data</a>
67
-
</li>
68
-
</ol>
26
+
{% include "ui/breadcrumb.html" pages="Home,Library,Data" separator="dots" %}
27
+
{% include "ui/breadcrumb.html" pages="Home,Library,Data" separator="arrows" %}
28
+
{% include "ui/breadcrumb.html" pages="Home,Library,Data" separator="bullets" %}
69
29
{%- endcapture %}
70
-
{% include "docs/example.html" html=html vertical separated %}
30
+
{% include "docs/example.html" html=html vertical separatedcentered%}
71
31
72
32
##With icon
73
33
74
34
You can use icons in breadcrumbs to make them more visually appealing. The example below demonstrates how to use icons in breadcrumbs.
75
35
76
36
{% capture html -%}
77
-
<olclass="breadcrumb">
78
-
<liclass="breadcrumb-item">
79
-
<a href="#">
80
-
{% include "ui/icon.html" icon="home" %}
81
-
</a>
82
-
</li>
83
-
<liclass="breadcrumb-item">
84
-
<a href="#">Library</a>
85
-
</li>
86
-
<liclass="breadcrumb-item active">
87
-
<a href="#">Data</a>
88
-
</li>
89
-
</ol>
37
+
{% include "ui/breadcrumb.html" pages="Home,Library,Data" home-icon %}
90
38
{%- endcapture %}
91
39
{% include "docs/example.html" html=html vertical separated %}
92
40
@@ -95,19 +43,7 @@ You can use icons in breadcrumbs to make them more visually appealing. The examp
95
43
You can use the`breadcrumb-muted` class to create a muted breadcrumb style. This style is perfect for breadcrumbs that are not the main focus of your website or app.
96
44
97
45
{% capture html -%}
98
-
<navaria-label="breadcrumb">
99
-
<olclass="breadcrumb breadcrumb-muted">
100
-
<li class="breadcrumb-item">
101
-
<a href="#">Home</a>
102
-
</li>
103
-
<li class="breadcrumb-item">
104
-
<a href="#">Library</a>
105
-
</li>
106
-
<li class="breadcrumb-item active">
107
-
<a href="#">Data</a>
108
-
</li>
109
-
</ol>
110
-
</nav>
46
+
{% include "ui/breadcrumb.html" pages="Home,Library,Data" class="breadcrumb-muted" %}
111
47
{%- endcapture %}
112
48
{% include "docs/example.html" html=html %}
113
49
@@ -119,24 +55,9 @@ You can use breadcrumbs in headers to show the current page location and provide
119
55
<divclass="page-header">
120
56
<divclass="row align-items-center mw-100">
121
57
<div class="col">
122
-
<div class="mb-1">
123
-
<ol class="breadcrumb">
124
-
<li class="breadcrumb-item">
125
-
<a href="#">Home</a>
126
-
</li>
127
-
<li class="breadcrumb-item">
128
-
<a href="#">Library</a>
129
-
</li>
130
-
<li class="breadcrumb-item active">
131
-
<a href="#">Articles</a>
132
-
</li>
133
-
</ol>
134
-
</div>
58
+
{% include "ui/breadcrumb.html" pages="Home,Library,Articles" -%}
135
59
<h2 class="page-title">
136
-
<span class="text-truncate"
137
-
>Knights of Ni, we are but simple travelers who seek the enchanter who lives beyond these
138
-
woods.</span
139
-
>
60
+
<span class="text-truncate">How to Build a Modern Dashboard with Tabler</span>
140
61
</h2>
141
62
</div>
142
63
<div class="col-auto">
@@ -151,5 +72,5 @@ You can use breadcrumbs in headers to show the current page location and provide
151
72
</div>
152
73
</div>
153
74
{%- endcapture %}
154
-
{% include "docs/example.html" html=html %}
75
+
{% include "docs/example.html" html=htmlcentered vertical%}