flowbite-mcp 1.1.3 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -74
- package/build/index.js +20 -36
- package/data/components/accordion.md +39 -53
- package/data/components/alerts.md +27 -44
- package/data/components/avatar.md +20 -33
- package/data/components/badge.md +34 -47
- package/data/components/banner.md +10 -29
- package/data/components/bottom-navigation.md +16 -29
- package/data/components/breadcrumb.md +12 -25
- package/data/components/button-group.md +26 -39
- package/data/components/buttons.md +41 -67
- package/data/components/card.md +34 -47
- package/data/components/carousel.md +25 -39
- package/data/components/chat-bubble.md +36 -50
- package/data/components/clipboard.md +256 -252
- package/data/components/datepicker.md +56 -70
- package/data/components/device-mockups.md +16 -29
- package/data/components/drawer.md +42 -56
- package/data/components/dropdowns.md +66 -80
- package/data/components/footer.md +16 -29
- package/data/components/forms.md +32 -50
- package/data/components/gallery.md +16 -33
- package/data/components/indicators.md +18 -31
- package/data/components/jumbotron.md +12 -25
- package/data/components/kbd.md +14 -27
- package/data/components/list-group.md +14 -27
- package/data/components/mega-menu.md +10 -24
- package/data/components/modal.md +37 -51
- package/data/components/navbar.md +41 -55
- package/data/components/pagination.md +22 -35
- package/data/components/popover.md +36 -51
- package/data/components/progress.md +10 -23
- package/data/components/qr-code.md +41 -133
- package/data/components/rating.md +16 -29
- package/data/components/sidebar.md +15 -30
- package/data/components/skeleton.md +16 -29
- package/data/components/speed-dial.md +40 -55
- package/data/components/spinner.md +14 -27
- package/data/components/stepper.md +14 -27
- package/data/components/tables.md +45 -64
- package/data/components/tabs.md +30 -45
- package/data/components/timeline.md +10 -23
- package/data/components/toast.md +25 -39
- package/data/components/tooltips.md +24 -39
- package/data/components/typography.md +22 -35
- package/data/components/video.md +14 -27
- package/data/forms/checkbox.md +27 -43
- package/data/forms/file-input.md +12 -26
- package/data/forms/floating-label.md +12 -25
- package/data/forms/input-field.md +17 -32
- package/data/forms/number-input.md +83 -93
- package/data/forms/phone-input.md +42 -54
- package/data/forms/radio.md +23 -39
- package/data/forms/range.md +12 -26
- package/data/forms/search-input.md +14 -31
- package/data/forms/select.md +15 -30
- package/data/forms/textarea.md +8 -21
- package/data/forms/timepicker.md +30 -42
- package/data/forms/toggle.md +18 -31
- package/data/plugins/charts.md +542 -526
- package/data/plugins/datatables.md +285 -286
- package/data/plugins/wysiwyg.md +658 -650
- package/data/quickstart.md +24 -24
- package/data/typography/blockquote.md +24 -37
- package/data/typography/headings.md +30 -43
- package/data/typography/hr.md +10 -23
- package/data/typography/images.md +32 -45
- package/data/typography/links.md +16 -29
- package/data/typography/lists.md +22 -35
- package/data/typography/paragraphs.md +30 -43
- package/data/typography/text.md +42 -55
- package/package.json +1 -1
|
@@ -1,23 +1,10 @@
|
|
|
1
|
-
---
|
|
2
|
-
layout: docs
|
|
3
|
-
title: Tailwind CSS Pagination - Flowbite
|
|
4
|
-
description: Use the Tailwind CSS pagination element to indicate a series of content across various pages based on multiple styles and sizes
|
|
5
|
-
group: components
|
|
6
|
-
toc: true
|
|
7
|
-
|
|
8
|
-
previous: Navbar
|
|
9
|
-
previousLink: components/navbar/
|
|
10
|
-
next: Popover
|
|
11
|
-
nextLink: components/popover/
|
|
12
|
-
---
|
|
13
|
-
|
|
14
1
|
The pagination component can be used to navigate across a series of content and data sets for various pages such as blog posts, products, and more. You can use multiple variants of this component with or without icons and even for paginating table data entries.
|
|
15
2
|
|
|
16
3
|
## Default pagination
|
|
17
4
|
|
|
18
5
|
Use the following list of pagination items based on two sizes powered by Tailwind CSS utility classes to indicate a series of content for your website.
|
|
19
6
|
|
|
20
|
-
|
|
7
|
+
```html
|
|
21
8
|
|
|
22
9
|
<nav aria-label="Page navigation example">
|
|
23
10
|
<ul class="flex -space-x-px text-sm">
|
|
@@ -71,13 +58,13 @@ Use the following list of pagination items based on two sizes powered by Tailwin
|
|
|
71
58
|
</ul>
|
|
72
59
|
</nav>
|
|
73
60
|
|
|
74
|
-
|
|
61
|
+
```
|
|
75
62
|
|
|
76
63
|
## Pagination with icons
|
|
77
64
|
|
|
78
65
|
The following pagination component example shows how you can use [SVG icons](https://flowbite.com/icons/) instead of text to show the previous and next pages.
|
|
79
66
|
|
|
80
|
-
|
|
67
|
+
```html
|
|
81
68
|
|
|
82
69
|
<nav aria-label="Page navigation example">
|
|
83
70
|
<ul class="flex -space-x-px text-sm">
|
|
@@ -142,13 +129,13 @@ The following pagination component example shows how you can use [SVG icons](htt
|
|
|
142
129
|
</li>
|
|
143
130
|
</ul>
|
|
144
131
|
</nav>
|
|
145
|
-
|
|
132
|
+
```
|
|
146
133
|
|
|
147
134
|
## Previous and next
|
|
148
135
|
|
|
149
136
|
Use the following markup to show simple previous and next elements.
|
|
150
137
|
|
|
151
|
-
|
|
138
|
+
```html
|
|
152
139
|
|
|
153
140
|
<div class="flex space-x-2">
|
|
154
141
|
<!-- Previous Button -->
|
|
@@ -173,13 +160,13 @@ Use the following markup to show simple previous and next elements.
|
|
|
173
160
|
Next
|
|
174
161
|
</a>
|
|
175
162
|
</div>
|
|
176
|
-
|
|
163
|
+
```
|
|
177
164
|
|
|
178
165
|
## Previous and next with icons
|
|
179
166
|
|
|
180
167
|
Use the following code to show simple previous and next elements with icons.
|
|
181
168
|
|
|
182
|
-
|
|
169
|
+
```html
|
|
183
170
|
<div class="flex space-x-2">
|
|
184
171
|
<!-- Previous Button -->
|
|
185
172
|
<a href="#" class="inline-flex items-center text-body bg-neutral-secondary-medium border border-default-medium hover:bg-neutral-tertiary-medium hover:text-heading shadow-xs font-medium leading-5 rounded-base text-sm px-3 py-2 focus:outline-none">
|
|
@@ -207,13 +194,13 @@ Use the following code to show simple previous and next elements with icons.
|
|
|
207
194
|
<svg class="w-4 h-4 ms-1.5 -me-0.5 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 12H5m14 0-4 4m4-4-4-4"/></svg>
|
|
208
195
|
</a>
|
|
209
196
|
</div>
|
|
210
|
-
|
|
197
|
+
```
|
|
211
198
|
|
|
212
199
|
## Table data pagination
|
|
213
200
|
|
|
214
201
|
You can use the following markup to show the number of data shown inside a table element and also the previous and next action buttons.
|
|
215
202
|
|
|
216
|
-
|
|
203
|
+
```html
|
|
217
204
|
|
|
218
205
|
<div class="flex flex-col items-center">
|
|
219
206
|
<!-- Help text -->
|
|
@@ -249,13 +236,13 @@ You can use the following markup to show the number of data shown inside a table
|
|
|
249
236
|
</button>
|
|
250
237
|
</div>
|
|
251
238
|
</div>
|
|
252
|
-
|
|
239
|
+
```
|
|
253
240
|
|
|
254
241
|
## Table pagination with icons
|
|
255
242
|
|
|
256
243
|
You can use the following code to show the number of data shown inside a table element and also the previous and next action buttons coupled with icons.
|
|
257
244
|
|
|
258
|
-
|
|
245
|
+
```html
|
|
259
246
|
|
|
260
247
|
<div class="flex flex-col items-center">
|
|
261
248
|
<!-- Help text -->
|
|
@@ -295,13 +282,13 @@ You can use the following code to show the number of data shown inside a table e
|
|
|
295
282
|
</button>
|
|
296
283
|
</div>
|
|
297
284
|
</div>
|
|
298
|
-
|
|
285
|
+
```
|
|
299
286
|
|
|
300
287
|
## Pagination with dropdown
|
|
301
288
|
|
|
302
289
|
Use this example of a pagination component with a dropdown to select the number of items per page.
|
|
303
290
|
|
|
304
|
-
|
|
291
|
+
```html
|
|
305
292
|
|
|
306
293
|
<nav aria-label="Page navigation example" class="flex items-center space-x-4">
|
|
307
294
|
<ul class="flex -space-x-px text-sm">
|
|
@@ -338,13 +325,13 @@ Use this example of a pagination component with a dropdown to select the number
|
|
|
338
325
|
</form>
|
|
339
326
|
</nav>
|
|
340
327
|
|
|
341
|
-
|
|
328
|
+
```
|
|
342
329
|
|
|
343
330
|
## Pagination with input
|
|
344
331
|
|
|
345
332
|
Use this pagination component with an input field to navigate through pages directly.
|
|
346
333
|
|
|
347
|
-
|
|
334
|
+
```html
|
|
348
335
|
|
|
349
336
|
<nav aria-label="Page navigation example" class="flex items-center space-x-4">
|
|
350
337
|
<ul class="flex -space-x-px text-sm">
|
|
@@ -379,13 +366,13 @@ Use this pagination component with an input field to navigate through pages dire
|
|
|
379
366
|
</form>
|
|
380
367
|
</nav>
|
|
381
368
|
|
|
382
|
-
|
|
369
|
+
```
|
|
383
370
|
|
|
384
371
|
## Input field and button
|
|
385
372
|
|
|
386
373
|
This example can be used to introduce the page number inside the input field and navigate by clicking on a button.
|
|
387
374
|
|
|
388
|
-
|
|
375
|
+
```html
|
|
389
376
|
|
|
390
377
|
<nav aria-label="Page navigation example">
|
|
391
378
|
<form class="mx-auto flex items-center space-x-3">
|
|
@@ -398,13 +385,13 @@ This example can be used to introduce the page number inside the input field and
|
|
|
398
385
|
</form>
|
|
399
386
|
</nav>
|
|
400
387
|
|
|
401
|
-
|
|
388
|
+
```
|
|
402
389
|
|
|
403
390
|
## Select input and buttons
|
|
404
391
|
|
|
405
392
|
This example can be used to select the number of pages and navigate using the left and right arrows.
|
|
406
393
|
|
|
407
|
-
|
|
394
|
+
```html
|
|
408
395
|
|
|
409
396
|
<nav aria-label="Page navigation example">
|
|
410
397
|
<form class="mx-auto flex items-center space-x-3">
|
|
@@ -439,13 +426,13 @@ This example can be used to select the number of pages and navigate using the le
|
|
|
439
426
|
</form>
|
|
440
427
|
</nav>
|
|
441
428
|
|
|
442
|
-
|
|
429
|
+
```
|
|
443
430
|
|
|
444
431
|
## Single pagination
|
|
445
432
|
|
|
446
433
|
This example can be used to show an interval of items per page and navigate using the left and right arrows.
|
|
447
434
|
|
|
448
|
-
|
|
435
|
+
```html
|
|
449
436
|
|
|
450
437
|
<nav aria-label="Page navigation example">
|
|
451
438
|
<div class="inline-flex rounded-base shadow-xs -space-x-px" role="group">
|
|
@@ -469,4 +456,4 @@ This example can be used to show an interval of items per page and navigate usin
|
|
|
469
456
|
</div>
|
|
470
457
|
</nav>
|
|
471
458
|
|
|
472
|
-
|
|
459
|
+
```
|
|
@@ -1,27 +1,12 @@
|
|
|
1
|
-
---
|
|
2
|
-
layout: docs
|
|
3
|
-
title: Tailwind CSS Popover - Flowbite
|
|
4
|
-
description: Use the popover component to show detailed information inside a pop-up box relative to the element that is being clicked or hovered based on multiple styles
|
|
5
|
-
group: components
|
|
6
|
-
toc: true
|
|
7
|
-
requires_js: true
|
|
8
|
-
|
|
9
|
-
previous: Pagination
|
|
10
|
-
previousLink: components/pagination/
|
|
11
|
-
|
|
12
|
-
next: Progress bar
|
|
13
|
-
nextLink: components/progress/
|
|
14
|
-
---
|
|
15
|
-
|
|
16
1
|
Get started with the popover component to show any type of content inside a pop-up box when hovering or clicking over a trigger element. There are multiple examples that you can choose from, such as showing more information about a user profile, company profile, password strength, and more.
|
|
17
2
|
|
|
18
|
-
Make sure that you have the Flowbite JavaScript included in your project to enable the popover interactivity by following the
|
|
3
|
+
Make sure that you have the Flowbite JavaScript included in your project to enable the popover interactivity by following the quickstart guide.
|
|
19
4
|
|
|
20
5
|
## Default popover
|
|
21
6
|
|
|
22
7
|
Initialize a new popover by adding the `data-popover-target="{elementId}"` data attribute to the trigger element where `elementId` is the id of the popover component.
|
|
23
8
|
|
|
24
|
-
|
|
9
|
+
```html
|
|
25
10
|
<button data-popover-target="popover-default" type="button" class="text-white bg-brand box-border border border-transparent hover:bg-brand-strong focus:ring-4 focus:ring-brand-medium shadow-xs font-medium leading-5 rounded-base text-sm px-4 py-2.5 focus:outline-none">Default popover</button>
|
|
26
11
|
|
|
27
12
|
<div data-popover id="popover-default" role="tooltip" class="absolute z-10 invisible inline-block w-64 text-sm text-body transition-opacity duration-300 bg-neutral-primary-soft border border-default rounded-base shadow-xs opacity-0">
|
|
@@ -33,13 +18,13 @@ Initialize a new popover by adding the `data-popover-target="{elementId}"` data
|
|
|
33
18
|
</div>
|
|
34
19
|
<div data-popper-arrow></div>
|
|
35
20
|
</div>
|
|
36
|
-
|
|
21
|
+
```
|
|
37
22
|
|
|
38
23
|
## User profile
|
|
39
24
|
|
|
40
25
|
Use this example to show more information about a user profile when hovering over the trigger component.
|
|
41
26
|
|
|
42
|
-
|
|
27
|
+
```html
|
|
43
28
|
<button data-popover-target="popover-user-profile" type="button" class="text-white bg-brand box-border border border-transparent hover:bg-brand-strong focus:ring-4 focus:ring-brand-medium shadow-xs font-medium leading-5 rounded-base text-sm px-4 py-2.5 focus:outline-none">User profile</button>
|
|
44
29
|
|
|
45
30
|
<div data-popover id="popover-user-profile" role="tooltip" class="absolute z-10 invisible inline-block w-64 text-sm text-body transition-opacity duration-300 bg-neutral-primary-soft border border-default rounded-base shadow-xs opacity-0">
|
|
@@ -76,13 +61,13 @@ Use this example to show more information about a user profile when hovering ove
|
|
|
76
61
|
</div>
|
|
77
62
|
<div data-popper-arrow></div>
|
|
78
63
|
</div>
|
|
79
|
-
|
|
64
|
+
```
|
|
80
65
|
|
|
81
66
|
## Company profile
|
|
82
67
|
|
|
83
68
|
This example can be used to show more information about a company profile.
|
|
84
69
|
|
|
85
|
-
|
|
70
|
+
```html
|
|
86
71
|
<button data-popover-target="popover-company-profile" type="button" class="text-white bg-brand box-border border border-transparent hover:bg-brand-strong focus:ring-4 focus:ring-brand-medium shadow-xs font-medium leading-5 rounded-base text-sm px-4 py-2.5 focus:outline-none">Company profile</button>
|
|
87
72
|
|
|
88
73
|
<div data-popover id="popover-company-profile" role="tooltip" class="absolute z-10 invisible inline-block w-80 text-sm text-body transition-opacity duration-300 bg-neutral-primary-soft border border-default rounded-base shadow-xs opacity-0">
|
|
@@ -151,13 +136,13 @@ This example can be used to show more information about a company profile.
|
|
|
151
136
|
</div>
|
|
152
137
|
<div data-popper-arrow></div>
|
|
153
138
|
</div>
|
|
154
|
-
|
|
139
|
+
```
|
|
155
140
|
|
|
156
141
|
## Image popover
|
|
157
142
|
|
|
158
143
|
Use this example to trigger a popover component with detailed information and an image when hovering over a portion of highlighted text inspired by Wikipedia and other large news outlets.
|
|
159
144
|
|
|
160
|
-
|
|
145
|
+
```html
|
|
161
146
|
|
|
162
147
|
<p class="text-body">Due to its central geographic location in Southern Europe, <a href="#" class="text-fg-brand font-medium underline hover:no-underline" data-popover-target="popover-image">Italy</a> has historically been home to myriad peoples and cultures. In addition to the various ancient peoples dispersed throughout what is now modern-day Italy, the most predominant being the Indo-European Italic peoples who gave the peninsula its name, beginning from the classical era, Phoenicians and Carthaginians founded colonies mostly in insular Italy</p>
|
|
163
148
|
<div data-popover id="popover-image" role="tooltip" class="absolute z-10 p-3 invisible inline-block text-sm text-body transition-opacity duration-300 bg-neutral-primary-soft border border-default rounded-lg shadow-xs opacity-0 w-96">
|
|
@@ -177,13 +162,13 @@ Use this example to trigger a popover component with detailed information and an
|
|
|
177
162
|
</div>
|
|
178
163
|
<div data-popper-arrow></div>
|
|
179
164
|
</div>
|
|
180
|
-
|
|
165
|
+
```
|
|
181
166
|
|
|
182
167
|
## Description popover
|
|
183
168
|
|
|
184
169
|
Show helpful information inside a popover when hovering over a question mark button.
|
|
185
170
|
|
|
186
|
-
|
|
171
|
+
```html
|
|
187
172
|
|
|
188
173
|
<p class="flex items-center text-sm text-body">This is just some informational text <button data-popover-target="popover-description" data-popover-placement="bottom-end" type="button"><svg class="w-4 h-4 text-body hover:text-heading ms-2" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.529 9.988a2.502 2.502 0 1 1 5 .191A2.441 2.441 0 0 1 12 12.582V14m-.01 3.008H12M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg><span class="sr-only">Show information</span></button></p>
|
|
189
174
|
<div data-popover id="popover-description" role="tooltip" class="absolute z-10 p-3 invisible inline-block text-sm text-body transition-opacity duration-300 bg-neutral-primary-soft border border-default rounded-base shadow-xs opacity-0 w-72">
|
|
@@ -199,13 +184,13 @@ Show helpful information inside a popover when hovering over a question mark but
|
|
|
199
184
|
</div>
|
|
200
185
|
<div data-popper-arrow></div>
|
|
201
186
|
</div>
|
|
202
|
-
|
|
187
|
+
```
|
|
203
188
|
|
|
204
189
|
## Progress popover
|
|
205
190
|
|
|
206
191
|
Show a progress bar with details inside a popover when hovering over a settings button.
|
|
207
192
|
|
|
208
|
-
|
|
193
|
+
```html
|
|
209
194
|
<button data-popover-target="popover-description" type="button" class="inline-flex items-center text-white bg-brand hover:bg-brand-strong box-border border border-transparent focus:ring-4 focus:ring-brand-medium shadow-xs font-medium leading-5 rounded-base text-sm px-4 py-2.5 focus:outline-none">
|
|
210
195
|
<svg class="w-4 h-4 me-1.5 -ms-0.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 6c0 1.657-3.134 3-7 3S5 7.657 5 6m14 0c0-1.657-3.134-3-7-3S5 4.343 5 6m14 0v6M5 6v6m0 0c0 1.657 3.134 3 7 3s7-1.343 7-3M5 12v6c0 1.657 3.134 3 7 3s7-1.343 7-3v-6"/></svg>
|
|
211
196
|
Storage status
|
|
@@ -225,13 +210,13 @@ Show a progress bar with details inside a popover when hovering over a settings
|
|
|
225
210
|
</a>
|
|
226
211
|
<div data-popper-arrow></div>
|
|
227
212
|
</div>
|
|
228
|
-
|
|
213
|
+
```
|
|
229
214
|
|
|
230
215
|
## Password strength
|
|
231
216
|
|
|
232
217
|
Dynamically show the password strength progress when creating a new password positioned relative to the input element.
|
|
233
218
|
|
|
234
|
-
|
|
219
|
+
```html
|
|
235
220
|
|
|
236
221
|
<form>
|
|
237
222
|
<div class="mb-6">
|
|
@@ -277,13 +262,13 @@ Dynamically show the password strength progress when creating a new password pos
|
|
|
277
262
|
</div>
|
|
278
263
|
<button type="submit" class="text-white bg-brand box-border border border-transparent hover:bg-brand-strong focus:ring-4 focus:ring-brand-medium shadow-xs font-medium leading-5 rounded-base text-sm px-4 py-2.5 focus:outline-none">Submit</button>
|
|
279
264
|
</form>
|
|
280
|
-
|
|
265
|
+
```
|
|
281
266
|
|
|
282
267
|
## Placement
|
|
283
268
|
|
|
284
269
|
Set the position of the popover component relative to the trigger element by using the `data-popover-placement="{top|right|bottom|left}"` data attribute and its values.
|
|
285
270
|
|
|
286
|
-
|
|
271
|
+
```html
|
|
287
272
|
<button data-popover-target="popover-top" data-popover-placement="top" type="button" class="text-white bg-brand box-border border border-transparent hover:bg-brand-strong focus:ring-4 focus:ring-brand-medium shadow-xs font-medium leading-5 rounded-base text-sm px-4 py-2.5 focus:outline-none">Top popover</button>
|
|
288
273
|
|
|
289
274
|
<div data-popover id="popover-top" role="tooltip" class="absolute z-10 invisible inline-block w-64 text-sm text-body transition-opacity duration-300 bg-neutral-primary-soft border border-default rounded-base shadow-xs opacity-0">
|
|
@@ -325,13 +310,13 @@ Set the position of the popover component relative to the trigger element by usi
|
|
|
325
310
|
</div>
|
|
326
311
|
<div data-popper-arrow></div>
|
|
327
312
|
</div>
|
|
328
|
-
|
|
313
|
+
```
|
|
329
314
|
|
|
330
315
|
## Triggering
|
|
331
316
|
|
|
332
317
|
Manually set the trigger event by adding the `data-popover-trigger="{hover|click}"` data attribute to the trigger element choosing between a hover or click event. By default it is set to `hover`.
|
|
333
318
|
|
|
334
|
-
|
|
319
|
+
```html
|
|
335
320
|
<button data-popover-target="popover-hover" data-popover-trigger="hover" type="button" class="text-white bg-brand box-border border border-transparent hover:bg-brand-strong focus:ring-4 focus:ring-brand-medium shadow-xs font-medium leading-5 rounded-base text-sm px-4 py-2.5 focus:outline-none">Hover popover</button>
|
|
336
321
|
|
|
337
322
|
<div data-popover id="popover-hover" role="tooltip" class="absolute z-10 invisible inline-block w-64 text-sm text-body transition-opacity duration-300 bg-neutral-primary-soft border border-default rounded-base shadow-xs opacity-0">
|
|
@@ -355,13 +340,13 @@ Manually set the trigger event by adding the `data-popover-trigger="{hover|click
|
|
|
355
340
|
</div>
|
|
356
341
|
<div data-popper-arrow></div>
|
|
357
342
|
</div>
|
|
358
|
-
|
|
343
|
+
```
|
|
359
344
|
|
|
360
345
|
## Offset
|
|
361
346
|
|
|
362
347
|
Increase or decrease the default offset by adding the `data-popover-offset="{offset}"` data attribute where the value is an integer.
|
|
363
348
|
|
|
364
|
-
|
|
349
|
+
```html
|
|
365
350
|
<button data-popover-target="popover-offset" data-popover-offset="30" type="button" class="text-white bg-brand box-border border border-transparent hover:bg-brand-strong focus:ring-4 focus:ring-brand-medium shadow-xs font-medium leading-5 rounded-base text-sm px-4 py-2.5 focus:outline-none">Offset popover</button>
|
|
366
351
|
|
|
367
352
|
<div data-popover id="popover-offset" role="tooltip" class="absolute z-10 invisible inline-block w-64 text-sm text-body transition-opacity duration-300 bg-neutral-primary-soft border border-default rounded-base shadow-xs opacity-0">
|
|
@@ -373,13 +358,13 @@ Increase or decrease the default offset by adding the `data-popover-offset="{off
|
|
|
373
358
|
</div>
|
|
374
359
|
<div data-popper-arrow></div>
|
|
375
360
|
</div>
|
|
376
|
-
|
|
361
|
+
```
|
|
377
362
|
|
|
378
363
|
## Animation
|
|
379
364
|
|
|
380
365
|
Customize the animation of the popover component by using the utility classes from Tailwind CSS such as `transition-opacity` and `duration-{x}`.
|
|
381
366
|
|
|
382
|
-
|
|
367
|
+
```html
|
|
383
368
|
<button data-popover-target="popover-animation" type="button" class="text-white bg-brand box-border border border-transparent hover:bg-brand-strong focus:ring-4 focus:ring-brand-medium shadow-xs font-medium leading-5 rounded-base text-sm px-4 py-2.5 focus:outline-none">Animated popover</button>
|
|
384
369
|
|
|
385
370
|
<div data-popover id="popover-animation" role="tooltip" class="absolute z-10 invisible inline-block w-64 text-sm text-body transition-opacity duration-300 bg-neutral-primary-soft border border-default rounded-base shadow-xs opacity-0">
|
|
@@ -391,13 +376,13 @@ Customize the animation of the popover component by using the utility classes fr
|
|
|
391
376
|
</div>
|
|
392
377
|
<div data-popper-arrow></div>
|
|
393
378
|
</div>
|
|
394
|
-
|
|
379
|
+
```
|
|
395
380
|
|
|
396
381
|
## Disable arrow
|
|
397
382
|
|
|
398
383
|
You can also disable the popover arrow by not including the `data-popper-arrow` element.
|
|
399
384
|
|
|
400
|
-
|
|
385
|
+
```html
|
|
401
386
|
<button data-popover-target="popover-no-arrow" type="button" class="text-white bg-brand box-border border border-transparent hover:bg-brand-strong focus:ring-4 focus:ring-brand-medium shadow-xs font-medium leading-5 rounded-base text-sm px-4 py-2.5 focus:outline-none">Default popover</button>
|
|
402
387
|
|
|
403
388
|
<div data-popover id="popover-no-arrow" role="tooltip" class="absolute z-10 invisible inline-block w-64 text-sm text-body transition-opacity duration-300 bg-neutral-primary-soft border border-default rounded-base shadow-xs opacity-0">
|
|
@@ -408,7 +393,7 @@ You can also disable the popover arrow by not including the `data-popper-arrow`
|
|
|
408
393
|
<p>And here's some amazing content. It's very engaging. Right?</p>
|
|
409
394
|
</div>
|
|
410
395
|
</div>
|
|
411
|
-
|
|
396
|
+
```
|
|
412
397
|
|
|
413
398
|
## JavaScript behaviour
|
|
414
399
|
|
|
@@ -672,7 +657,7 @@ First of all, set the target element as the popover itself and the trigger eleme
|
|
|
672
657
|
|
|
673
658
|
After that you can also set the options object to change the placement and trigger type of the popover, alongside with the callback functions.
|
|
674
659
|
|
|
675
|
-
|
|
660
|
+
```javascript
|
|
676
661
|
// set the popover content element
|
|
677
662
|
const $targetEl = document.getElementById('popoverContent');
|
|
678
663
|
|
|
@@ -700,11 +685,11 @@ const instanceOptions = {
|
|
|
700
685
|
id: 'popoverContent',
|
|
701
686
|
override: true
|
|
702
687
|
};
|
|
703
|
-
|
|
688
|
+
```
|
|
704
689
|
|
|
705
690
|
Create a new Popover object based on the options above.
|
|
706
691
|
|
|
707
|
-
|
|
692
|
+
```javascript
|
|
708
693
|
import { Popover } from 'flowbite';
|
|
709
694
|
|
|
710
695
|
/*
|
|
@@ -713,11 +698,11 @@ import { Popover } from 'flowbite';
|
|
|
713
698
|
* options: optional
|
|
714
699
|
*/
|
|
715
700
|
const popover = new Popover($targetEl, $triggerEl, options, instanceOptions);
|
|
716
|
-
|
|
701
|
+
```
|
|
717
702
|
|
|
718
703
|
Use the `show` and `hide` methods on the Popover object to programmatically show and hide the popover element using JavaScript.
|
|
719
704
|
|
|
720
|
-
|
|
705
|
+
```javascript
|
|
721
706
|
// show the popover
|
|
722
707
|
popover.show();
|
|
723
708
|
|
|
@@ -735,13 +720,13 @@ tooltip.destroy();
|
|
|
735
720
|
|
|
736
721
|
// re-initialize popover object
|
|
737
722
|
tooltip.init();
|
|
738
|
-
|
|
723
|
+
```
|
|
739
724
|
|
|
740
725
|
### HTML Markup
|
|
741
726
|
|
|
742
727
|
Use the following HTML code for the JavaScript example above.
|
|
743
728
|
|
|
744
|
-
|
|
729
|
+
```html
|
|
745
730
|
<button
|
|
746
731
|
id="popoverButton"
|
|
747
732
|
type="button"
|
|
@@ -766,15 +751,15 @@ Use the following HTML code for the JavaScript example above.
|
|
|
766
751
|
</div>
|
|
767
752
|
<div data-popper-arrow></div>
|
|
768
753
|
</div>
|
|
769
|
-
|
|
754
|
+
```
|
|
770
755
|
|
|
771
756
|
### TypeScript
|
|
772
757
|
|
|
773
|
-
If you're using the
|
|
758
|
+
If you're using the TypeScript configuration from Flowbite then you can import the types for the Popover class, parameters and its options.
|
|
774
759
|
|
|
775
760
|
Here's an example that applies the types from Flowbite to the code above:
|
|
776
761
|
|
|
777
|
-
|
|
762
|
+
```typescript
|
|
778
763
|
import { Popover } from 'flowbite';
|
|
779
764
|
import type { PopoverOptions, PopoverInterface } from 'flowbite';
|
|
780
765
|
import type { InstanceOptions } from 'flowbite';
|
|
@@ -823,4 +808,4 @@ if ($targetEl) {
|
|
|
823
808
|
|
|
824
809
|
popover.show();
|
|
825
810
|
}
|
|
826
|
-
|
|
811
|
+
```
|
|
@@ -1,33 +1,20 @@
|
|
|
1
|
-
---
|
|
2
|
-
layout: docs
|
|
3
|
-
title: Tailwind CSS Progress Bar - Flowbite
|
|
4
|
-
description: Use the progress bar component to show the completion rate of a data indicator or use it as a loader element
|
|
5
|
-
group: components
|
|
6
|
-
toc: true
|
|
7
|
-
|
|
8
|
-
previous: Popover
|
|
9
|
-
previousLink: components/popover/
|
|
10
|
-
next: Rating
|
|
11
|
-
nextLink: components/rating/
|
|
12
|
-
---
|
|
13
|
-
|
|
14
1
|
The progress bar component can be used as an indicator to show the completion rate of data sets or it can be used as an animated loader component. There are multiple sizes, colors, and styles available.
|
|
15
2
|
|
|
16
3
|
## Default progress bar
|
|
17
4
|
|
|
18
5
|
Use the following example of a progress bar element to show a completion rate of 45% by using an inline style and the utility classes from Tailwind CSS.
|
|
19
6
|
|
|
20
|
-
|
|
7
|
+
```html
|
|
21
8
|
<div class="w-full bg-neutral-quaternary rounded-full h-2">
|
|
22
9
|
<div class="bg-brand h-2 rounded-full" style="width: 45%"></div>
|
|
23
10
|
</div>
|
|
24
|
-
|
|
11
|
+
```
|
|
25
12
|
|
|
26
13
|
## Sizes
|
|
27
14
|
|
|
28
15
|
You can also use different sizes by using various sizing utility classes from Flowbite and Tailwind CSS.
|
|
29
16
|
|
|
30
|
-
|
|
17
|
+
```html
|
|
31
18
|
<div class="mb-1 text-sm font-medium text-heading">Small</div>
|
|
32
19
|
<div class="w-full bg-neutral-quaternary rounded-full h-1.5">
|
|
33
20
|
<div class="bg-brand h-1.5 rounded-full" style="width: 45%"></div>
|
|
@@ -40,23 +27,23 @@ You can also use different sizes by using various sizing utility classes from Fl
|
|
|
40
27
|
<div class="w-full bg-neutral-quaternary rounded-full h-2.5">
|
|
41
28
|
<div class="bg-brand h-2.5 rounded-full" style="width: 45%"></div>
|
|
42
29
|
</div>
|
|
43
|
-
|
|
30
|
+
```
|
|
44
31
|
|
|
45
32
|
## With label inside
|
|
46
33
|
|
|
47
34
|
Here is an example of using a progress bar with the label inside the bar.
|
|
48
35
|
|
|
49
|
-
|
|
36
|
+
```html
|
|
50
37
|
<div class="w-full bg-neutral-quaternary rounded-full">
|
|
51
38
|
<div class="bg-brand text-xs font-medium text-white text-center p-0.5 leading-none rounded-full h-4 flex items-center justify-center" style="width: 45%"> 45%</div>
|
|
52
39
|
</div>
|
|
53
|
-
|
|
40
|
+
```
|
|
54
41
|
|
|
55
42
|
## With label outside
|
|
56
43
|
|
|
57
44
|
And this is an example of using a progress bar outside the bar.
|
|
58
45
|
|
|
59
|
-
|
|
46
|
+
```html
|
|
60
47
|
<div class="flex justify-between mb-1">
|
|
61
48
|
<span class="text-sm font-medium text-body">Flowbite</span>
|
|
62
49
|
<span class="text-sm font-medium text-body">45%</span>
|
|
@@ -64,13 +51,13 @@ And this is an example of using a progress bar outside the bar.
|
|
|
64
51
|
<div class="w-full bg-neutral-quaternary rounded-full h-2">
|
|
65
52
|
<div class="bg-brand h-2 rounded-full" style="width: 45%"></div>
|
|
66
53
|
</div>
|
|
67
|
-
|
|
54
|
+
```
|
|
68
55
|
|
|
69
56
|
## Colors
|
|
70
57
|
|
|
71
58
|
You can also apply any color using the `bg-{color}` utility classes from Tailwind CSS and Flowbite.
|
|
72
59
|
|
|
73
|
-
|
|
60
|
+
```html
|
|
74
61
|
<div class="mb-1 text-sm font-medium text-heading">Dark</div>
|
|
75
62
|
<div class="w-full bg-neutral-quaternary rounded-full h-2">
|
|
76
63
|
<div class="bg-dark h-2 rounded-full" style="width: 45%"></div>
|
|
@@ -92,4 +79,4 @@ You can also apply any color using the `bg-{color}` utility classes from Tailwin
|
|
|
92
79
|
<div class="bg-warning h-2 rounded-full" style="width: 45%"></div>
|
|
93
80
|
</div>
|
|
94
81
|
|
|
95
|
-
|
|
82
|
+
```
|