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,40 +1,25 @@
|
|
|
1
|
-
---
|
|
2
|
-
layout: docs
|
|
3
|
-
title: Tailwind CSS Tooltip - Flowbite
|
|
4
|
-
description: Use the following Tailwind CSS powered tooltips to show extra content when hovering or focusing on an element
|
|
5
|
-
group: components
|
|
6
|
-
toc: true
|
|
7
|
-
requires_js: true
|
|
8
|
-
|
|
9
|
-
previous: Toast
|
|
10
|
-
previousLink: components/toast/
|
|
11
|
-
|
|
12
|
-
next: Typography
|
|
13
|
-
nextLink: components/typography/
|
|
14
|
-
---
|
|
15
|
-
|
|
16
1
|
Flowbite allows you to use the Tailwind CSS tooltip component to show extra information when hovering or focusing over an element in multiple positions, styles, and animations.
|
|
17
2
|
|
|
18
|
-
Before continuing, make sure that you have the
|
|
3
|
+
Before continuing, make sure that you have the Flowbite JavaScript file included in your project in order to make the tooltip component work.
|
|
19
4
|
|
|
20
5
|
## Default tooltip example
|
|
21
6
|
|
|
22
7
|
To get started with using tooltips all you need to do is add the `data-tooltip-target="{elementId}"` data attribute to an element where `elementId` is the id of the tooltip component. In the following example you can see the button that will trigger the `tooltip-default` element to be shown when hovered or focused.
|
|
23
8
|
|
|
24
|
-
|
|
9
|
+
```html
|
|
25
10
|
<button data-tooltip-target="tooltip-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 tooltip</button>
|
|
26
11
|
|
|
27
12
|
<div id="tooltip-default" role="tooltip" class="absolute z-10 invisible inline-block px-3 py-2 text-sm font-medium text-white transition-opacity duration-300 bg-dark rounded-base shadow-xs opacity-0 tooltip">
|
|
28
13
|
Tooltip content
|
|
29
14
|
<div class="tooltip-arrow" data-popper-arrow></div>
|
|
30
15
|
</div>
|
|
31
|
-
|
|
16
|
+
```
|
|
32
17
|
|
|
33
18
|
## Tooltip styles
|
|
34
19
|
|
|
35
20
|
You can use choose between dark and light version styles for the tooltip component by changing the utility classes from Tailwind CSS and by applying the `data-tooltip-style="{light|dark}"` data attribute.
|
|
36
21
|
|
|
37
|
-
|
|
22
|
+
```html
|
|
38
23
|
|
|
39
24
|
<!-- Light style tooltip -->
|
|
40
25
|
|
|
@@ -53,13 +38,13 @@ You can use choose between dark and light version styles for the tooltip compone
|
|
|
53
38
|
Tooltip content
|
|
54
39
|
<div class="tooltip-arrow" data-popper-arrow></div>
|
|
55
40
|
</div>
|
|
56
|
-
|
|
41
|
+
```
|
|
57
42
|
|
|
58
43
|
## Placement
|
|
59
44
|
|
|
60
45
|
The positioning of the tooltip element relative to the triggering element (eg. button, link) can be set using the `data-tooltip-placement="{top|right|bottom|left}"` data attribute.
|
|
61
46
|
|
|
62
|
-
|
|
47
|
+
```html
|
|
63
48
|
|
|
64
49
|
<!-- Show tooltip on top -->
|
|
65
50
|
|
|
@@ -96,13 +81,13 @@ The positioning of the tooltip element relative to the triggering element (eg. b
|
|
|
96
81
|
Tooltip on left
|
|
97
82
|
<div class="tooltip-arrow" data-popper-arrow></div>
|
|
98
83
|
</div>
|
|
99
|
-
|
|
84
|
+
```
|
|
100
85
|
|
|
101
86
|
## Triggering
|
|
102
87
|
|
|
103
88
|
You can choose the triggering event by using the `data-tooltip-trigger="{hover|click}"` data attributes to choose whether you want to show the tooltip when hovering or clicking on the element. By default this option is set to `hover`.
|
|
104
89
|
|
|
105
|
-
|
|
90
|
+
```html
|
|
106
91
|
|
|
107
92
|
<!-- Show tooltip on hover -->
|
|
108
93
|
|
|
@@ -121,32 +106,32 @@ You can choose the triggering event by using the `data-tooltip-trigger="{hover|c
|
|
|
121
106
|
Tooltip content
|
|
122
107
|
<div class="tooltip-arrow" data-popper-arrow></div>
|
|
123
108
|
</div>
|
|
124
|
-
|
|
109
|
+
```
|
|
125
110
|
|
|
126
111
|
## Animation
|
|
127
112
|
|
|
128
113
|
You can set tooltip animation styles by using the transition utility classes from Tailwind CSS. Make sure that you add `transition-opacity` and `duration-{x}` to set the animation duration.
|
|
129
114
|
|
|
130
|
-
|
|
115
|
+
```html
|
|
131
116
|
<button data-tooltip-target="tooltip-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 tooltip</button>
|
|
132
117
|
|
|
133
118
|
<div id="tooltip-animation" role="tooltip" class="absolute z-10 invisible inline-block px-3 py-2 text-sm font-medium text-white transition-opacity duration-300 bg-dark rounded-base shadow-xs opacity-0 tooltip">
|
|
134
119
|
Tooltip content
|
|
135
120
|
<div class="tooltip-arrow" data-popper-arrow></div>
|
|
136
121
|
</div>
|
|
137
|
-
|
|
122
|
+
```
|
|
138
123
|
|
|
139
124
|
## Disable arrow
|
|
140
125
|
|
|
141
126
|
You can also disable the tooltip arrow by not including the `data-popper-arrow` element.
|
|
142
127
|
|
|
143
|
-
|
|
128
|
+
```html
|
|
144
129
|
<button data-tooltip-target="tooltip-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 tooltip</button>
|
|
145
130
|
|
|
146
131
|
<div id="tooltip-no-arrow" role="tooltip" class="absolute z-10 invisible inline-block px-3 py-2 text-sm font-medium text-white bg-dark rounded-base shadow-xs opacity-0 tooltip">
|
|
147
132
|
Tooltip content
|
|
148
133
|
</div>
|
|
149
|
-
|
|
134
|
+
```
|
|
150
135
|
|
|
151
136
|
## JavaScript behaviour
|
|
152
137
|
|
|
@@ -391,7 +376,7 @@ First of all, set the target element as the tooltip itself and the trigger eleme
|
|
|
391
376
|
|
|
392
377
|
After that you can also set the options object to change the placement and trigger type of the tooltip, alongside with the callback functions.
|
|
393
378
|
|
|
394
|
-
|
|
379
|
+
```javascript
|
|
395
380
|
// set the tooltip content element
|
|
396
381
|
const $targetEl = document.getElementById('tooltipContent');
|
|
397
382
|
|
|
@@ -419,11 +404,11 @@ const instanceOptions = {
|
|
|
419
404
|
id: 'tooltipContent',
|
|
420
405
|
override: true
|
|
421
406
|
};
|
|
422
|
-
|
|
407
|
+
```
|
|
423
408
|
|
|
424
409
|
Create a new Tooltip object based on the options above.
|
|
425
410
|
|
|
426
|
-
|
|
411
|
+
```javascript
|
|
427
412
|
import { Tooltip } from 'flowbite';
|
|
428
413
|
|
|
429
414
|
/*
|
|
@@ -432,11 +417,11 @@ import { Tooltip } from 'flowbite';
|
|
|
432
417
|
* options: optional
|
|
433
418
|
*/
|
|
434
419
|
const tooltip = new Tooltip($targetEl, $triggerEl, options, instanceOptions);
|
|
435
|
-
|
|
420
|
+
```
|
|
436
421
|
|
|
437
422
|
Use the `show` and `hide` methods on the Tooltip object to programmatically show and hide the tooltip element using JavaScript.
|
|
438
423
|
|
|
439
|
-
|
|
424
|
+
```javascript
|
|
440
425
|
// show the tooltip
|
|
441
426
|
tooltip.show();
|
|
442
427
|
|
|
@@ -451,13 +436,13 @@ tooltip.destroy();
|
|
|
451
436
|
|
|
452
437
|
// re-initialize tooltip object
|
|
453
438
|
tooltip.init();
|
|
454
|
-
|
|
439
|
+
```
|
|
455
440
|
|
|
456
441
|
### HTML Markup
|
|
457
442
|
|
|
458
443
|
Use the following HTML code for the JavaScript example above.
|
|
459
444
|
|
|
460
|
-
|
|
445
|
+
```html
|
|
461
446
|
<button
|
|
462
447
|
id="tooltipButton"
|
|
463
448
|
type="button"
|
|
@@ -472,15 +457,15 @@ Use the following HTML code for the JavaScript example above.
|
|
|
472
457
|
Tooltip content
|
|
473
458
|
<div class="tooltip-arrow" data-popper-arrow></div>
|
|
474
459
|
</div>
|
|
475
|
-
|
|
460
|
+
```
|
|
476
461
|
|
|
477
462
|
### TypeScript
|
|
478
463
|
|
|
479
|
-
If you're using the
|
|
464
|
+
If you're using the TypeScript configuration from Flowbite then you can import the types for the Tooltip class, parameters and its options.
|
|
480
465
|
|
|
481
466
|
Here's an example that applies the types from Flowbite to the code above:
|
|
482
467
|
|
|
483
|
-
|
|
468
|
+
```typescript
|
|
484
469
|
import { Tooltip } from 'flowbite';
|
|
485
470
|
import type { TooltipOptions, TooltipInterface } from 'flowbite';
|
|
486
471
|
import type { InstanceOptions } from 'flowbite';
|
|
@@ -521,4 +506,4 @@ const tooltip: TooltipInterface = new Tooltip($targetEl, $triggerEl, options, in
|
|
|
521
506
|
|
|
522
507
|
// show the tooltip
|
|
523
508
|
tooltip.show();
|
|
524
|
-
|
|
509
|
+
```
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
---
|
|
2
|
-
layout: docs
|
|
3
|
-
title: Tailwind CSS Typography - Flowbite
|
|
4
|
-
description: Use the typography plugin from Flowbite to apply styles to all inline elements like headings, paragraphs, lists, and images using a single format class
|
|
5
|
-
group: components
|
|
6
|
-
toc: true
|
|
7
|
-
|
|
8
|
-
previous: Tooltips
|
|
9
|
-
previousLink: components/tooltips/
|
|
10
|
-
next: QR Code
|
|
11
|
-
nextLink: components/qr-code/
|
|
12
|
-
---
|
|
13
|
-
|
|
14
1
|
Get started with the [Flowbite Typography](https://github.com/themesberg/flowbite-typography) plugin forked from the official [Tailwind CSS Typography](https://tailwindcss.com/docs/typography-plugin) plugin to set a custom `format` class to a wrapper element to apply styles to all inline child elements such as headings, paragraphs, images, lists, and more and apply font sizes, font weights, colors, and spacings.
|
|
15
2
|
|
|
16
3
|
You can check out this [live demo](https://flowbite.com/plugins/typography/) to see how content inside an article will render like.
|
|
@@ -21,19 +8,19 @@ Make sure that you have both [Node.js](https://nodejs.org/) and [Tailwind CSS](h
|
|
|
21
8
|
|
|
22
9
|
1. Install the Flowbite Typography plugin via NPM:
|
|
23
10
|
|
|
24
|
-
|
|
11
|
+
```bash
|
|
25
12
|
npm i -D flowbite-typography
|
|
26
|
-
|
|
13
|
+
```
|
|
27
14
|
|
|
28
15
|
2. Import the `flowbite-typography` plugin inside your main Tailwind CSS file:
|
|
29
16
|
|
|
30
|
-
|
|
17
|
+
```javascript
|
|
31
18
|
@plugin "flowbite-typography";
|
|
32
|
-
|
|
19
|
+
```
|
|
33
20
|
|
|
34
21
|
Alternatively you can do the same but in your `tailwind.config.js` file:
|
|
35
22
|
|
|
36
|
-
|
|
23
|
+
```javascript
|
|
37
24
|
// import the tailwind.config.js file in your main CSS file if using Tailwind CSS v4
|
|
38
25
|
module.exports = {
|
|
39
26
|
theme: {
|
|
@@ -44,7 +31,7 @@ module.exports = {
|
|
|
44
31
|
// ...
|
|
45
32
|
],
|
|
46
33
|
}
|
|
47
|
-
|
|
34
|
+
```
|
|
48
35
|
|
|
49
36
|
Now you can go ahead and use the new formatting classes from the Flowbite Typography plugin.
|
|
50
37
|
|
|
@@ -54,7 +41,7 @@ Once you have installed the plugin inside your project you can add the `format`
|
|
|
54
41
|
|
|
55
42
|
All of these elements will be automatically styled with proper spacing, font sizing, font weight, colors, and more based on recommended UI/UX readability and accessibility standards.
|
|
56
43
|
|
|
57
|
-
|
|
44
|
+
```html
|
|
58
45
|
<article class="format lg:format-lg">
|
|
59
46
|
<h1>Prototyping from A to Z: best practices for successful prototypes</h1>
|
|
60
47
|
<p class="lead">Flowbite is an open-source library of UI components built with the utility-first classes from Tailwind CSS. It also includes interactive elements such as dropdowns, modals, datepickers.</p>
|
|
@@ -72,7 +59,7 @@ All of these elements will be automatically styled with proper spacing, font siz
|
|
|
72
59
|
<li><strong>Communicating your vision</strong>. By using an interactive medium to preview and test design elements, designers and developers can understand each other — and the project — better.</li>
|
|
73
60
|
</ol>
|
|
74
61
|
</article>
|
|
75
|
-
|
|
62
|
+
```
|
|
76
63
|
|
|
77
64
|
You can also set the `lg:format-lg` class to set increase font sizes and spacings for larger viewport devices.
|
|
78
65
|
|
|
@@ -80,19 +67,19 @@ You can also set the `lg:format-lg` class to set increase font sizes and spacing
|
|
|
80
67
|
|
|
81
68
|
You can update the default blue link color to anything you'd like by setting the `format-{color}` class:
|
|
82
69
|
|
|
83
|
-
|
|
70
|
+
```html
|
|
84
71
|
<article class="format lg:format-lg format-red">
|
|
85
72
|
<h1>Prototyping from A to Z: best practices for successful prototypes</h1>
|
|
86
73
|
<p class="lead">Flowbite is an open-source library of UI components built with the utility-first classes from Tailwind CSS. It also includes interactive elements such as dropdowns, modals, datepickers.</p>
|
|
87
74
|
<p>Before going digital, you might benefit from scribbling down some ideas in a sketchbook. This way, you can think things through before committing to an actual design project.</p>
|
|
88
75
|
<p>But then I found a <a href="#">component library based on Tailwind CSS called Flowbite</a>. It comes with the most commonly used UI components, such as buttons, navigation bars, cards, form elements, and more which are conveniently built with the utility classes from Tailwind CSS.</p>
|
|
89
76
|
</article>
|
|
90
|
-
|
|
77
|
+
```
|
|
91
78
|
## Dark mode
|
|
92
79
|
|
|
93
80
|
Enable dark mode for the typography by using the `dark:format-invert` class on the article wrapper element:
|
|
94
81
|
|
|
95
|
-
|
|
82
|
+
```html
|
|
96
83
|
<article class="format lg:format-lg dark:format-invert">
|
|
97
84
|
<h1>The content inside this article will invert when switching to dark mode</h1>
|
|
98
85
|
<p class="lead">Flowbite is an open-source library of UI components built with the utility-first classes from Tailwind CSS. It also includes interactive elements such as dropdowns, modals, datepickers.</p>
|
|
@@ -110,26 +97,26 @@ Enable dark mode for the typography by using the `dark:format-invert` class on t
|
|
|
110
97
|
<li><strong>Communicating your vision</strong>. By using an interactive medium to preview and test design elements, designers and developers can understand each other — and the project — better.</li>
|
|
111
98
|
</ol>
|
|
112
99
|
</article>
|
|
113
|
-
|
|
100
|
+
```
|
|
114
101
|
|
|
115
102
|
## Max width
|
|
116
103
|
|
|
117
104
|
Override the default maximum width by setting a custom `max-w-{size}` class next to the `format` class:
|
|
118
105
|
|
|
119
|
-
|
|
106
|
+
```html
|
|
120
107
|
<article class="max-w-none format lg:format-lg format-red">
|
|
121
108
|
<h1>Prototyping from A to Z: best practices for successful prototypes</h1>
|
|
122
109
|
<p class="lead">Flowbite is an open-source library of UI components built with the utility-first classes from Tailwind CSS. It also includes interactive elements such as dropdowns, modals, datepickers.</p>
|
|
123
110
|
<p>Before going digital, you might benefit from scribbling down some ideas in a sketchbook. This way, you can think things through before committing to an actual design project.</p>
|
|
124
111
|
<p>But then I found a <a href="#">component library based on Tailwind CSS called Flowbite</a>. It comes with the most commonly used UI components, such as buttons, navigation bars, cards, form elements, and more which are conveniently built with the utility classes from Tailwind CSS.</p>
|
|
125
112
|
</article>
|
|
126
|
-
|
|
113
|
+
```
|
|
127
114
|
|
|
128
115
|
## Disable format
|
|
129
116
|
|
|
130
117
|
If you want to disable formatting inside the typography content you can use the `not-format` class:
|
|
131
118
|
|
|
132
|
-
|
|
119
|
+
```html
|
|
133
120
|
<article class="format lg:format-lg dark:format-invert">
|
|
134
121
|
<h1>The content inside this article will invert when switching to dark mode</h1>
|
|
135
122
|
<p class="lead">Flowbite is an open-source library of UI components built with the utility-first classes from Tailwind CSS. It also includes interactive elements such as dropdowns, modals, datepickers.</p>
|
|
@@ -150,7 +137,7 @@ If you want to disable formatting inside the typography content you can use the
|
|
|
150
137
|
</ol>
|
|
151
138
|
</div>
|
|
152
139
|
</article>
|
|
153
|
-
|
|
140
|
+
```
|
|
154
141
|
|
|
155
142
|
## Options
|
|
156
143
|
|
|
@@ -160,7 +147,7 @@ Extend the plugin's options inside the Tailwind configuration file to set your o
|
|
|
160
147
|
|
|
161
148
|
You can set your own colors by extending the typography plugin inside the `tailwind.config.js` file:
|
|
162
149
|
|
|
163
|
-
|
|
150
|
+
```javascript
|
|
164
151
|
module.exports = {
|
|
165
152
|
theme: {
|
|
166
153
|
extend: {
|
|
@@ -212,7 +199,7 @@ module.exports = {
|
|
|
212
199
|
// ...
|
|
213
200
|
],
|
|
214
201
|
}
|
|
215
|
-
|
|
202
|
+
```
|
|
216
203
|
|
|
217
204
|
Now you can use the `format-red` class and apply these styles.
|
|
218
205
|
|
|
@@ -220,7 +207,7 @@ Now you can use the `format-red` class and apply these styles.
|
|
|
220
207
|
|
|
221
208
|
Change the default `format` class to your own choosing by updating the `tailwind.config.js` file:
|
|
222
209
|
|
|
223
|
-
|
|
210
|
+
```javascript
|
|
224
211
|
module.exports = {
|
|
225
212
|
theme: {
|
|
226
213
|
// ...
|
|
@@ -232,13 +219,13 @@ module.exports = {
|
|
|
232
219
|
]
|
|
233
220
|
...
|
|
234
221
|
}
|
|
235
|
-
|
|
222
|
+
```
|
|
236
223
|
|
|
237
224
|
### Custom CSS
|
|
238
225
|
|
|
239
226
|
You can also customize the default CSS by extending the `css` key value pair from the Tailwind configuration file:
|
|
240
227
|
|
|
241
|
-
|
|
228
|
+
```javascript
|
|
242
229
|
module.exports = {
|
|
243
230
|
theme: {
|
|
244
231
|
extend: {
|
|
@@ -262,7 +249,7 @@ module.exports = {
|
|
|
262
249
|
// ...
|
|
263
250
|
],
|
|
264
251
|
}
|
|
265
|
-
|
|
252
|
+
```
|
|
266
253
|
|
|
267
254
|
## Blog templates
|
|
268
255
|
|
package/data/components/video.md
CHANGED
|
@@ -1,50 +1,37 @@
|
|
|
1
|
-
---
|
|
2
|
-
layout: docs
|
|
3
|
-
title: Tailwind CSS Video - Flowbite
|
|
4
|
-
description: Use the video component to configure an embedded video player using native HTML 5 functionality based on the utility classes from Tailwind CSS
|
|
5
|
-
group: components
|
|
6
|
-
toc: true
|
|
7
|
-
|
|
8
|
-
previous: QR Code
|
|
9
|
-
previousLink: components/qr-code/
|
|
10
|
-
next: Input field
|
|
11
|
-
nextLink: forms/input-field/
|
|
12
|
-
---
|
|
13
|
-
|
|
14
1
|
Get started with the video component to embed internal video source into a native HTML 5 video player and set custom options such as autoplay or muted to enhance the user experience.
|
|
15
2
|
|
|
16
3
|
## Video player
|
|
17
4
|
|
|
18
5
|
Use this example to create a native browser video player and apply the `w-full` utility class from Tailwind CSS to span the full width of the parent container.
|
|
19
6
|
|
|
20
|
-
|
|
7
|
+
```html
|
|
21
8
|
<video class="w-full rounded-base" controls>
|
|
22
9
|
<source src="/docs/videos/flowbite.mp4" type="video/mp4">
|
|
23
10
|
Your browser does not support the video tag.
|
|
24
11
|
</video>
|
|
25
|
-
|
|
12
|
+
```
|
|
26
13
|
|
|
27
14
|
## Autoplay
|
|
28
15
|
|
|
29
16
|
Use the `autoplay` attribute on the video component to automatically start the video when the page has been loaded.
|
|
30
17
|
|
|
31
|
-
|
|
18
|
+
```html
|
|
32
19
|
<video class="w-full rounded-base" controls>
|
|
33
20
|
<source src="/docs/videos/flowbite.mp4" type="video/mp4">
|
|
34
21
|
Your browser does not support the video tag.
|
|
35
22
|
</video>
|
|
36
|
-
|
|
23
|
+
```
|
|
37
24
|
|
|
38
25
|
## Muted
|
|
39
26
|
|
|
40
27
|
Use the `muted` attribute together with the `autoplay` option to start the video while the sound is muted.
|
|
41
28
|
|
|
42
|
-
|
|
29
|
+
```html
|
|
43
30
|
<video class="w-full rounded-base" autoplay muted controls>
|
|
44
31
|
<source src="/docs/videos/flowbite.mp4" type="video/mp4">
|
|
45
32
|
Your browser does not support the video tag.
|
|
46
33
|
</video>
|
|
47
|
-
|
|
34
|
+
```
|
|
48
35
|
|
|
49
36
|
## Sizes
|
|
50
37
|
|
|
@@ -54,42 +41,42 @@ Set the width and height of the video component using the `w-{size}` and `h-{siz
|
|
|
54
41
|
|
|
55
42
|
Use the `w-{size}` class to set the width of the video component.
|
|
56
43
|
|
|
57
|
-
|
|
44
|
+
```html
|
|
58
45
|
<video class="w-96 rounded-base" controls>
|
|
59
46
|
<source src="/docs/videos/flowbite.mp4" type="video/mp4">
|
|
60
47
|
Your browser does not support the video tag.
|
|
61
48
|
</video>
|
|
62
|
-
|
|
49
|
+
```
|
|
63
50
|
|
|
64
51
|
### Height
|
|
65
52
|
|
|
66
53
|
Use the `h-{size}` class to set the height of the video player.
|
|
67
54
|
|
|
68
|
-
|
|
55
|
+
```html
|
|
69
56
|
<video class="h-80 rounded-base" controls>
|
|
70
57
|
<source src="/docs/videos/flowbite.mp4" type="video/mp4">
|
|
71
58
|
Your browser does not support the video tag.
|
|
72
59
|
</video>
|
|
73
|
-
|
|
60
|
+
```
|
|
74
61
|
|
|
75
62
|
### Responsive
|
|
76
63
|
|
|
77
64
|
Use the following example to make the video responsive across all devices and viewports.
|
|
78
65
|
|
|
79
|
-
|
|
66
|
+
```html
|
|
80
67
|
<video class="w-full h-auto max-w-full rounded-base" controls>
|
|
81
68
|
<source src="/docs/videos/flowbite.mp4" type="video/mp4">
|
|
82
69
|
Your browser does not support the video tag.
|
|
83
70
|
</video>
|
|
84
|
-
|
|
71
|
+
```
|
|
85
72
|
|
|
86
73
|
## Custom styles
|
|
87
74
|
|
|
88
75
|
Customize the video player appearance using the utility classes from Tailwind CSS such as `rounded-{size}` or `border` to set rounded-sm corners and border.
|
|
89
76
|
|
|
90
|
-
|
|
77
|
+
```html
|
|
91
78
|
<video class="w-full h-auto max-w-full border border-default rounded-base" controls>
|
|
92
79
|
<source src="/docs/videos/flowbite.mp4" type="video/mp4">
|
|
93
80
|
Your browser does not support the video tag.
|
|
94
81
|
</video>
|
|
95
|
-
|
|
82
|
+
```
|