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.
Files changed (72) hide show
  1. package/README.md +49 -74
  2. package/build/index.js +20 -36
  3. package/data/components/accordion.md +39 -53
  4. package/data/components/alerts.md +27 -44
  5. package/data/components/avatar.md +20 -33
  6. package/data/components/badge.md +34 -47
  7. package/data/components/banner.md +10 -29
  8. package/data/components/bottom-navigation.md +16 -29
  9. package/data/components/breadcrumb.md +12 -25
  10. package/data/components/button-group.md +26 -39
  11. package/data/components/buttons.md +41 -67
  12. package/data/components/card.md +34 -47
  13. package/data/components/carousel.md +25 -39
  14. package/data/components/chat-bubble.md +36 -50
  15. package/data/components/clipboard.md +256 -252
  16. package/data/components/datepicker.md +56 -70
  17. package/data/components/device-mockups.md +16 -29
  18. package/data/components/drawer.md +42 -56
  19. package/data/components/dropdowns.md +66 -80
  20. package/data/components/footer.md +16 -29
  21. package/data/components/forms.md +32 -50
  22. package/data/components/gallery.md +16 -33
  23. package/data/components/indicators.md +18 -31
  24. package/data/components/jumbotron.md +12 -25
  25. package/data/components/kbd.md +14 -27
  26. package/data/components/list-group.md +14 -27
  27. package/data/components/mega-menu.md +10 -24
  28. package/data/components/modal.md +37 -51
  29. package/data/components/navbar.md +41 -55
  30. package/data/components/pagination.md +22 -35
  31. package/data/components/popover.md +36 -51
  32. package/data/components/progress.md +10 -23
  33. package/data/components/qr-code.md +41 -133
  34. package/data/components/rating.md +16 -29
  35. package/data/components/sidebar.md +15 -30
  36. package/data/components/skeleton.md +16 -29
  37. package/data/components/speed-dial.md +40 -55
  38. package/data/components/spinner.md +14 -27
  39. package/data/components/stepper.md +14 -27
  40. package/data/components/tables.md +45 -64
  41. package/data/components/tabs.md +30 -45
  42. package/data/components/timeline.md +10 -23
  43. package/data/components/toast.md +25 -39
  44. package/data/components/tooltips.md +24 -39
  45. package/data/components/typography.md +22 -35
  46. package/data/components/video.md +14 -27
  47. package/data/forms/checkbox.md +27 -43
  48. package/data/forms/file-input.md +12 -26
  49. package/data/forms/floating-label.md +12 -25
  50. package/data/forms/input-field.md +17 -32
  51. package/data/forms/number-input.md +83 -93
  52. package/data/forms/phone-input.md +42 -54
  53. package/data/forms/radio.md +23 -39
  54. package/data/forms/range.md +12 -26
  55. package/data/forms/search-input.md +14 -31
  56. package/data/forms/select.md +15 -30
  57. package/data/forms/textarea.md +8 -21
  58. package/data/forms/timepicker.md +30 -42
  59. package/data/forms/toggle.md +18 -31
  60. package/data/plugins/charts.md +542 -526
  61. package/data/plugins/datatables.md +285 -286
  62. package/data/plugins/wysiwyg.md +658 -650
  63. package/data/quickstart.md +24 -24
  64. package/data/typography/blockquote.md +24 -37
  65. package/data/typography/headings.md +30 -43
  66. package/data/typography/hr.md +10 -23
  67. package/data/typography/images.md +32 -45
  68. package/data/typography/links.md +16 -29
  69. package/data/typography/lists.md +22 -35
  70. package/data/typography/paragraphs.md +30 -43
  71. package/data/typography/text.md +42 -55
  72. package/package.json +1 -1
@@ -1,17 +1,3 @@
1
- ---
2
- layout: docs
3
- title: Tailwind CSS Checkbox - Flowbite
4
- description: Get started with the checkbox component to allow the user to select one or more options in the form of a square box available in multiple sizes and colors
5
- group: forms
6
- toc: true
7
- requires_js: true
8
-
9
- previous: Textarea
10
- previousLink: forms/textarea/
11
- next: Radio
12
- nextLink: forms/radio/
13
- ---
14
-
15
1
  The checkbox component can be used to receive one or more selected options from the user in the form of a square box available in multiple styles, sizes, colors, and variants coded with the utility classes from Tailwind CSS and with support for dark mode.
16
2
 
17
3
  Make sure that you have included Flowbite as a plugin inside your Tailwind CSS project to apply all the necessary styles for the checkbox component.
@@ -20,7 +6,7 @@ Make sure that you have included Flowbite as a plugin inside your Tailwind CSS p
20
6
 
21
7
  Use this default example of a checkbox element in a checked and unchecked state.
22
8
 
23
- {{< example github="forms/checkbox.md" show_dark=true >}}
9
+ ```html
24
10
  <div class="flex items-center mb-4">
25
11
  <input id="default-checkbox" type="checkbox" value="" class="w-4 h-4 border border-default-medium rounded-xs bg-neutral-secondary-medium focus:ring-2 focus:ring-brand-soft">
26
12
  <label for="default-checkbox" class="select-none ms-2 text-sm font-medium text-heading">Default checkbox</label>
@@ -29,13 +15,13 @@ Use this default example of a checkbox element in a checked and unchecked state.
29
15
  <input checked id="checked-checkbox" type="checkbox" value="" class="w-4 h-4 border border-default-medium rounded-xs bg-neutral-secondary-medium focus:ring-2 focus:ring-brand-soft">
30
16
  <label for="checked-checkbox" class="select-none ms-2 text-sm font-medium text-heading">Checked state</label>
31
17
  </div>
32
- {{< /example >}}
18
+ ```
33
19
 
34
20
  ## Disabled state
35
21
 
36
22
  This example can be used for the disabled state of the checkbox component by applying the `disabled` attribute to the input element.
37
23
 
38
- {{< example github="forms/checkbox.md" show_dark=true >}}
24
+ ```html
39
25
  <div class="flex items-center mb-4">
40
26
  <input disabled id="disabled-checkbox" type="checkbox" value="" class="w-4 h-4 border border-light rounded-xs bg-neutral-secondary-medium focus:ring-2 focus:ring-brand-soft">
41
27
  <label for="disabled-checkbox" class="select-none ms-2 text-sm font-medium text-fg-disabled">Disabled checkbox</label>
@@ -44,24 +30,24 @@ This example can be used for the disabled state of the checkbox component by app
44
30
  <input disabled checked id="disabled-checked-checkbox" type="checkbox" value="" class="w-4 h-4 border border-light rounded-xs bg-neutral-secondary-medium focus:ring-2 focus:ring-brand-soft">
45
31
  <label for="disabled-checked-checkbox" class="select-none ms-2 text-sm font-medium text-fg-disabled">Disabled checked</label>
46
32
  </div>
47
- {{< /example >}}
33
+ ```
48
34
 
49
35
  ## Checkbox link
50
36
 
51
37
  Use this example if you want to add an anchor link inside the label of the checkbox component.
52
38
 
53
- {{< example github="forms/checkbox.md" show_dark=true >}}
39
+ ```html
54
40
  <div class="flex items-center">
55
41
  <input id="link-checkbox" type="checkbox" value="" class="w-4 h-4 border border-default-medium rounded-xs bg-neutral-secondary-medium focus:ring-2 focus:ring-brand-soft">
56
42
  <label for="link-checkbox" class="select-none ms-2 text-sm font-medium text-heading">I agree with the <a href="#" class="text-fg-brand hover:underline">terms and conditions</a>.</label>
57
43
  </div>
58
- {{< /example >}}
44
+ ```
59
45
 
60
46
  ## Helper text
61
47
 
62
48
  Get started with this example if you want to add a secondary helper text for the checkbox component.
63
49
 
64
- {{< example github="forms/checkbox.md" show_dark=true >}}
50
+ ```html
65
51
  <div class="flex">
66
52
  <div class="flex items-center h-5">
67
53
  <input id="helper-checkbox" aria-describedby="helper-checkbox-text" type="checkbox" value="" class="w-4 h-4 border border-default-medium rounded-xs bg-neutral-secondary-medium focus:ring-2 focus:ring-brand-soft">
@@ -71,13 +57,13 @@ Get started with this example if you want to add a secondary helper text for the
71
57
  <p id="helper-checkbox-text" class="text-xs font-normal text-body">For orders shipped from $25 in books or $29 in other categories</p>
72
58
  </div>
73
59
  </div>
74
- {{< /example >}}
60
+ ```
75
61
 
76
62
  ## Bordered
77
63
 
78
64
  Use this example of a checkbox inside a card element to enable a larger area of clicking activation.
79
65
 
80
- {{< example class="grid gap-6 md:grid-cols-2" github="forms/checkbox.md" show_dark=true >}}
66
+ ```html
81
67
  <div class="flex items-center ps-4 bg-neutral-primary-soft border border-default rounded-base shadow-xs">
82
68
  <input id="bordered-checkbox-1" type="checkbox" value="" name="bordered-checkbox" class="w-4 h-4 border border-default-medium rounded-xs bg-neutral-secondary-medium focus:ring-2 focus:ring-brand-soft">
83
69
  <label for="bordered-checkbox-1" class="select-none w-full py-4 ms-2 text-sm font-medium text-heading">Default checkbox</label>
@@ -86,13 +72,13 @@ Use this example of a checkbox inside a card element to enable a larger area of
86
72
  <input checked id="bordered-checkbox-2" type="checkbox" value="" name="bordered-checkbox" class="w-4 h-4 border border-default-medium rounded-xs bg-neutral-secondary-medium focus:ring-2 focus:ring-brand-soft">
87
73
  <label for="bordered-checkbox-2" class="select-none w-full py-4 ms-2 text-sm font-medium text-heading">Checked state</label>
88
74
  </div>
89
- {{< /example >}}
75
+ ```
90
76
 
91
77
  ## Bordered with description
92
78
 
93
79
  Use this checkbox component with a bordered style and a description text.
94
80
 
95
- {{< example class="grid gap-6 md:grid-cols-2" github="forms/checkbox.md" show_dark=true >}}
81
+ ```html
96
82
  <div class="flex space-x-2.5 bg-neutral-primary-soft border border-default rounded-base shadow-xs">
97
83
  <input id="bordered-checkbox-3" type="checkbox" value="" name="bordered-checkbox" class="w-4 h-4 mt-4 ms-4 border border-default-medium rounded-xs bg-neutral-secondary-medium focus:ring-2 focus:ring-brand-soft">
98
84
  <label for="bordered-checkbox-3" class="py-4 pe-4">
@@ -107,13 +93,13 @@ Use this checkbox component with a bordered style and a description text.
107
93
  <p id="helper-checkbox-bordered-2" class="select-none text-sm text-body">Get ultra-fast storage with 1TB of SSD space</p>
108
94
  </label>
109
95
  </div>
110
- {{< /example >}}
96
+ ```
111
97
 
112
98
  ## Bordered with icon
113
99
 
114
100
  This example can be used to create a checkbox component with a bordered style, a description text and an icon.
115
101
 
116
- {{< example class="grid gap-6 md:grid-cols-2" github="forms/checkbox.md" show_dark=true >}}
102
+ ```html
117
103
  <div class="flex justify-between space-x-2.5 bg-neutral-primary-soft border border-default rounded-base shadow-xs">
118
104
  <label for="bordered-checkbox-5" class="p-4">
119
105
  <svg class="w-7 h-7 text-body mb-1.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="M5 12a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1M5 12h14M5 12a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1m-2 3h.01M14 15h.01M17 9h.01M14 9h.01"/></svg>
@@ -130,14 +116,14 @@ This example can be used to create a checkbox component with a bordered style, a
130
116
  </label>
131
117
  <input id="bordered-checkbox-6" type="checkbox" value="" name="bordered-checkbox" class="w-4 h-4 mt-4 me-4 border border-default-medium rounded-xs bg-neutral-secondary-medium focus:ring-2 focus:ring-brand-soft">
132
118
  </div>
133
- {{< /example >}}
119
+ ```
134
120
 
135
121
 
136
122
  ## Checkbox list group
137
123
 
138
124
  Use this example to show a list of checkbox items grouped inside a card.
139
125
 
140
- {{< example github="components/radio.md" show_dark=true >}}
126
+ ```html
141
127
  <h3 class="mb-4 font-semibold text-heading">Technology</h3>
142
128
  <ul class="w-48 select-none text-sm font-medium text-heading bg-neutral-primary-soft border border-default rounded-base">
143
129
  <li class="w-full border-b border-default rounded-t-lg">
@@ -165,13 +151,13 @@ Use this example to show a list of checkbox items grouped inside a card.
165
151
  </div>
166
152
  </li>
167
153
  </ul>
168
- {{< /example >}}
154
+ ```
169
155
 
170
156
  ## Horizontal list group
171
157
 
172
158
  Use this example to show a list of checkbox items inside a card horizontally.
173
159
 
174
- {{< example github="components/radio.md" show_dark=true >}}
160
+ ```html
175
161
  <h3 class="mb-4 font-semibold text-heading">Identification</h3>
176
162
  <ul class="items-center select-none w-full text-sm font-medium text-heading bg-neutral-primary-soft border border-default rounded-base sm:flex">
177
163
  <li class="w-full border-b border-default sm:border-b-0 sm:border-r">
@@ -199,17 +185,15 @@ Use this example to show a list of checkbox items inside a card horizontally.
199
185
  </div>
200
186
  </li>
201
187
  </ul>
202
- {{< /example >}}
188
+ ```
189
+
203
190
 
204
- <div class="mt-8 -mb-5">
205
- {{< requires_js >}}
206
- </div>
207
191
 
208
192
  ## Checkbox dropdown
209
193
 
210
194
  Use this example to show a list of checkbox items inside a dropdown menu.
211
195
 
212
- {{< example class="flex justify-center" github="components/dropdowns.md" show_dark=true iframeHeight="430" >}}
196
+ ```html
213
197
  <button id="dropdownSearchButton" data-dropdown-toggle="dropdownSearch" type="button" class="inline-flex items-center 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">
214
198
  Dropdown search
215
199
  <svg class="w-4 h-4 ms-1.5 -me-1" 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 9-7 7-7-7"/></svg>
@@ -276,13 +260,13 @@ Use this example to show a list of checkbox items inside a dropdown menu.
276
260
  </button>
277
261
  </div>
278
262
  </div>
279
- {{< /example >}}
263
+ ```
280
264
 
281
265
  ## Inline layout
282
266
 
283
267
  You can align the checkbox elements horizontally by using a wrapper tag and applying the `flex` class.
284
268
 
285
- {{< example github="forms/checkbox.md" show_dark=true >}}
269
+ ```html
286
270
  <div class="flex">
287
271
  <div class="flex items-center me-4">
288
272
  <input id="inline-checkbox" type="checkbox" value="" class="w-4 h-4 border border-default-medium rounded-xs bg-neutral-secondary-medium focus:ring-2 focus:ring-brand-soft">
@@ -301,13 +285,13 @@ You can align the checkbox elements horizontally by using a wrapper tag and appl
301
285
  <label for="inline-disabled-checkbox" class="select-none ms-2 text-sm font-medium text-fg-disabled">Inline disabled</label>
302
286
  </div>
303
287
  </div>
304
- {{< /example >}}
288
+ ```
305
289
 
306
290
  ## Colors
307
291
 
308
292
  Use the `text-{color}-{shade}` classes from Tailwind CSS to change the color of the checkbox component.
309
293
 
310
- {{< example class="flex flex-wrap" github="forms/checkbox.md" show_dark=true >}}
294
+ ```html
311
295
  <div class="flex items-center me-4">
312
296
  <input checked id="red-checkbox" type="checkbox" value="" class="w-4 h-4 text-red-600 bg-neutral-secondary-medium border-default-medium rounded-xs focus:ring-red-500 dark:focus:ring-red-600 ring-offset-neutral-primary focus:ring-2">
313
297
  <label for="red-checkbox" class="select-none ms-2 text-sm font-medium text-heading">Red</label>
@@ -332,13 +316,13 @@ Use the `text-{color}-{shade}` classes from Tailwind CSS to change the color of
332
316
  <input checked id="orange-checkbox" type="checkbox" value="" class="w-4 h-4 text-orange-500 bg-neutral-secondary-medium border-default-medium rounded-xs focus:ring-orange-500 dark:focus:ring-orange-600 ring-offset-neutral-primary focus:ring-2">
333
317
  <label for="orange-checkbox" class="select-none ms-2 text-sm font-medium text-heading">Orange</label>
334
318
  </div>
335
- {{< /example >}}
319
+ ```
336
320
 
337
321
  ## Advanced layout
338
322
 
339
323
  Use this example of an advanced layout of checkbox elements where the label parent element can be styled when the checkbox is checked.
340
324
 
341
- {{< example class="flex flex-wrap" github="forms/checkbox.md" show_dark=true >}}
325
+ ```html
342
326
  <h3 class="mb-4 text-lg font-medium text-heading">Choose technology:</h3>
343
327
  <ul class="select-none grid w-full gap-4 md:grid-cols-3">
344
328
  <li>
@@ -372,4 +356,4 @@ Use this example of an advanced layout of checkbox elements where the label pare
372
356
  </label>
373
357
  </li>
374
358
  </ul>
375
- {{< /example >}}
359
+ ```
@@ -1,17 +1,3 @@
1
- ---
2
- layout: docs
3
- title: Tailwind CSS File Input - Flowbite
4
- description: Get started with the file input component to let the user to upload one or more files from their device storage based on multiple styles and sizes
5
- group: forms
6
- toc: true
7
- requires_js: true
8
-
9
- previous: Input Field
10
- previousLink: forms/input-field/
11
- next: Search Input
12
- nextLink: forms/search-input/
13
- ---
14
-
15
1
  The file input component can be used to upload one or more files from the device storage of the user available in multiple sizes, styles, and variants and built with the utility-first classes from Tailwind CSS including support for dark mode.
16
2
 
17
3
  Make sure that you have included Flowbite as a plugin inside your Tailwind CSS project to apply all the necessary styles for the file input component.
@@ -20,48 +6,48 @@ Make sure that you have included Flowbite as a plugin inside your Tailwind CSS p
20
6
 
21
7
  Get started with a simple file input component to let users upload one single file.
22
8
 
23
- {{< example github="forms/file-input.md" show_dark=true >}}
9
+ ```html
24
10
  <label class="block mb-2.5 text-sm font-medium text-heading" for="file_input">Upload file</label>
25
11
  <input class="cursor-pointer bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base focus:ring-brand focus:border-brand block w-full shadow-xs placeholder:text-body" id="file_input" type="file">
26
- {{< /example >}}
12
+ ```
27
13
 
28
14
  ## Helper text
29
15
 
30
16
  Add a descriptive helper text to inform users the allowed extensions and sizes of the files.
31
17
 
32
- {{< example github="forms/file-input.md" show_dark=true >}}
18
+ ```html
33
19
  <label class="block mb-2.5 text-sm font-medium text-heading" for="file_input">Upload file</label>
34
20
  <input class="cursor-pointer bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base focus:ring-brand focus:border-brand block w-full shadow-xs placeholder:text-body" aria-describedby="file_input_help" id="file_input" type="file">
35
21
  <p class="mt-1 text-sm text-gray-500 dark:text-gray-300" id="file_input_help">SVG, PNG, JPG or GIF (MAX. 800x400px).</p>
36
- {{< /example >}}
22
+ ```
37
23
 
38
24
  ## Multiple files
39
25
 
40
26
  Apply the `multiple` attribute to the file input component to allow more files to be uploaded.
41
27
 
42
- {{< example github="forms/file-input.md" show_dark=true >}}
28
+ ```html
43
29
  <label class="block mb-2.5 text-sm font-medium text-heading" for="multiple_files">Upload multiple files</label>
44
30
  <input class="cursor-pointer bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base focus:ring-brand focus:border-brand block w-full shadow-xs placeholder:text-body" id="multiple_files" type="file" multiple>
45
- {{< /example >}}
31
+ ```
46
32
 
47
33
  ## Sizes
48
34
 
49
35
  Choose from the small, default, and large file input sizing options.
50
36
 
51
- {{< example class="space-y-6" github="forms/file-input.md" show_dark=true >}}
37
+ ```html
52
38
  <label class="block mb-2.5 text-sm font-medium text-heading" for="small_size">Base file input</label>
53
39
  <input class="cursor-pointer bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base focus:ring-brand focus:border-brand block w-full shadow-xs placeholder:text-body" id="small_size" type="file">
54
40
 
55
41
 
56
42
  <label class="block mb-2.5 text-sm font-medium text-heading" for="large_size">Large file input</label>
57
43
  <input class="cursor-pointer bg-neutral-secondary-medium border border-default-medium text-heading text-lg rounded-base focus:ring-brand focus:border-brand block w-full shadow-xs placeholder:text-body" id="large_size" type="file">
58
- {{< /example >}}
44
+ ```
59
45
 
60
46
  ## Dropzone
61
47
 
62
48
  The dropzone file input component can be used to upload one or more files by clicking anywhere in the area.
63
49
 
64
- {{< example class="space-y-6" github="forms/file-input.md" show_dark=true >}}
50
+ ```html
65
51
  <div class="flex items-center justify-center w-full">
66
52
  <label for="dropzone-file" class="flex flex-col items-center justify-center w-full h-64 bg-neutral-secondary-medium border border-dashed border-default-strong rounded-base cursor-pointer hover:bg-neutral-tertiary-medium">
67
53
  <div class="flex flex-col items-center justify-center text-body pt-5 pb-6">
@@ -72,13 +58,13 @@ The dropzone file input component can be used to upload one or more files by cli
72
58
  <input id="dropzone-file" type="file" class="hidden" />
73
59
  </label>
74
60
  </div>
75
- {{< /example >}}
61
+ ```
76
62
 
77
63
  ## Dropzone with button
78
64
 
79
65
  Use this dropzone component to upload files with a button element.
80
66
 
81
- {{< example class="space-y-6" github="forms/file-input.md" show_dark=true >}}
67
+ ```html
82
68
  <div class="flex items-center justify-center w-full">
83
69
  <div class="flex flex-col items-center justify-center w-full h-64 bg-neutral-secondary-medium border border-dashed border-default-strong rounded-base">
84
70
  <div class="flex flex-col items-center justify-center text-body pt-5 pb-6">
@@ -95,4 +81,4 @@ Use this dropzone component to upload files with a button element.
95
81
  <!-- Hidden File Input (Outside Label) -->
96
82
  <input id="dropzone-file-2" type="file" class="hidden" />
97
83
  </div>
98
- {{< /example >}}
84
+ ```
@@ -1,16 +1,3 @@
1
- ---
2
- layout: docs
3
- title: Tailwind CSS Floating Label - Flowbite
4
- description: Use the floating label style for the input field elements to replicate the Material UI design system from Google and choose from multiple styles and sizes
5
- group: forms
6
- toc: true
7
-
8
- previous: Range Slider
9
- previousLink: forms/range/
10
- next: Headings
11
- nextLink: typography/headings/
12
- ---
13
-
14
1
  The floating label style was first pioneered by Google in its infamous Material UI design system and it's basically a label tag which floats just above the input field when it is being focused or already has content inside.
15
2
 
16
3
  On this page you will find a three different input field styles including a standard, outlined, and filled style including validation styles and sizes coded with Tailwind CSS and supported for dark mode.
@@ -19,7 +6,7 @@ On this page you will find a three different input field styles including a stan
19
6
 
20
7
  Get started with the following three styles for the floating label component and use the `label` tag as a visual placeholder using the `peer-placeholder-shown` and `peer-focus` utility classes from Tailwind CSS.
21
8
 
22
- {{< example class="grid items-end w-full gap-6 md:grid-cols-3" github="forms/floating-label.md" show_dark=true >}}
9
+ ```html
23
10
  <div class="relative">
24
11
  <input type="text" id="floating_filled" class="block rounded-t-base px-2.5 pb-2.5 pt-5 w-full text-sm text-heading bg-neutral-secondary-medium border-0 border-b-2 border-default-medium appearance-none focus:outline-none focus:ring-0 focus:border-brand peer" placeholder=" " />
25
12
  <label for="floating_filled" class="absolute text-sm text-body duration-300 transform -translate-y-4 scale-75 top-4 z-10 origin-[0] start-2.5 peer-focus:text-fg-brand peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-4 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto">Floating filled</label>
@@ -32,13 +19,13 @@ Get started with the following three styles for the floating label component and
32
19
  <input type="text" id="floating_standard" class="block py-2.5 px-0 w-full text-sm text-heading bg-transparent border-0 border-b-2 border-default-medium appearance-none focus:outline-none focus:ring-0 focus:border-brand peer" placeholder=" " />
33
20
  <label for="floating_standard" class="absolute text-sm text-body duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:start-0 peer-focus:text-fg-brand peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto">Floating standard</label>
34
21
  </div>
35
- {{< /example >}}
22
+ ```
36
23
 
37
24
  ## Floating label with icons
38
25
 
39
26
  Use these examples of floating label input fields with a descriptive [SVG icon](https://flowbite.com/icons/).
40
27
 
41
- {{< example class="grid items-end w-full gap-6 md:grid-cols-3" github="forms/floating-label.md" show_dark=true >}}
28
+ ```html
42
29
  <div class="relative">
43
30
  <input type="text" id="floating_filled" class="block rounded-t-base px-2.5 pb-2.5 pt-5 w-full text-sm text-heading bg-neutral-secondary-medium border-0 border-b-2 border-default-medium appearance-none focus:outline-none focus:ring-0 focus:border-brand peer" placeholder=" " />
44
31
  <label for="floating_filled" class="inline-flex items-center absolute text-sm text-body duration-300 transform -translate-y-4 scale-75 top-4 z-10 origin-[0] start-2.5 peer-focus:text-fg-brand peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-4 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto">
@@ -60,13 +47,13 @@ Use these examples of floating label input fields with a descriptive [SVG icon](
60
47
  Floating standard
61
48
  </label>
62
49
  </div>
63
- {{< /example >}}
50
+ ```
64
51
 
65
52
  ## Disabled state
66
53
 
67
54
  Apply the `disabled` attribute to the input fields to disallow the user from changing the content.
68
55
 
69
- {{< example class="grid items-end gap-6 md:grid-cols-3" github="forms/floating-label.md" show_dark=true >}}
56
+ ```html
70
57
  <div class="relative">
71
58
  <input type="text" id="disabled_filled" class="block rounded-t-base px-2.5 pb-2.5 pt-5 w-full text-sm text-heading bg-neutral-secondary-medium border-0 border-b-2 border-default-medium appearance-none focus:outline-none focus:ring-0 focus:border-brand peer" placeholder=" " disabled />
72
59
  <label for="disabled_filled" class="absolute text-sm text-fg-disabled duration-300 transform -translate-y-4 scale-75 top-4 z-10 origin-[0] start-2.5 peer-focus:text-fg-brand peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-4 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto">Disabled filled</label>
@@ -79,13 +66,13 @@ Apply the `disabled` attribute to the input fields to disallow the user from cha
79
66
  <input type="text" id="disabled_standard" class="block py-2.5 px-0 w-full text-sm text-heading bg-transparent border-0 border-b-2 border-default-medium appearance-none focus:outline-none focus:ring-0 focus:border-brand peer" placeholder=" " disabled />
80
67
  <label for="disabled_standard" class="absolute text-sm text-fg-disabled duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:start-0 peer-focus:text-fg-brand peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto">Disabled standard</label>
81
68
  </div>
82
- {{< /example >}}
69
+ ```
83
70
 
84
71
  ## Validation
85
72
 
86
73
  Use the following examples of input validation for the success and error messages by applying the validation text below the input field and using the green or red color classes from Tailwind CSS.
87
74
 
88
- {{< example github="forms/floating-label.md" show_dark=true >}}
75
+ ```html
89
76
  <!-- Success messages -->
90
77
  <div class="grid items-end gap-6 mb-6 md:grid-cols-3">
91
78
  <div>
@@ -135,13 +122,13 @@ Use the following examples of input validation for the success and error message
135
122
  <p id="standard_error_help" class="mt-2 text-xs text-fg-danger-strong"><span class="font-medium">Oh, snapp!</span> Some error message.</p>
136
123
  </div>
137
124
  </div>
138
- {{< /example >}}
125
+ ```
139
126
 
140
127
  ## Sizes
141
128
 
142
129
  Use the small and default sizes of the floating label input fields from the following example.
143
130
 
144
- {{< example github="forms/floating-label.md" show_dark=true >}}
131
+ ```html
145
132
  <div class="grid items-end gap-6 mb-6 md:grid-cols-3">
146
133
  <div class="relative">
147
134
  <input type="text" id="small_filled" class="block rounded-t-base px-2.5 pb-1.5 pt-4 w-full text-sm text-heading bg-neutral-secondary-medium border-0 border-b-2 border-default-medium appearance-none focus:outline-none focus:ring-0 focus:border-brand peer" placeholder=" " />
@@ -170,16 +157,16 @@ Use the small and default sizes of the floating label input fields from the foll
170
157
  <label for="default_standard" class="absolute text-sm text-body duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:start-0 peer-focus:text-fg-brand peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto">Default standard</label>
171
158
  </div>
172
159
  </div>
173
- {{< /example >}}
160
+ ```
174
161
 
175
162
  ## Helper text
176
163
 
177
164
  Add a helper text in addition to the label if you want to show more information below the input field.
178
165
 
179
- {{< example github="forms/floating-label.md" show_dark=true >}}
166
+ ```html
180
167
  <div class="relative">
181
168
  <input type="text" id="floating_helper" aria-describedby="floating_helper_text" class="block rounded-t-base px-2.5 pb-2.5 pt-5 w-full text-sm text-heading bg-neutral-secondary-medium border-0 border-b-2 border-default-medium appearance-none focus:outline-none focus:ring-0 focus:border-brand peer" placeholder=" " />
182
169
  <label for="floating_helper" class="absolute text-sm text-body duration-300 transform -translate-y-4 scale-75 top-4 z-10 origin-[0] start-2.5 peer-focus:text-fg-brand peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-4 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto">Floating helper</label>
183
170
  </div>
184
171
  <p id="floating_helper_text" class="mt-2.5 text-xs text-body">Remember, contributions to this topic should follow our <a href="#" class="text-fg-brand hover:underline">Community Guidelines</a>.</p>
185
- {{< /example >}}
172
+ ```
@@ -1,16 +1,3 @@
1
- ---
2
- layout: docs
3
- title: Tailwind CSS Input Field - Flowbite
4
- description: Get started with a collection of input fields built with Tailwind CSS to start accepting data from the user based on multiple sizes, variants, and input types
5
- group: forms
6
- toc: true
7
-
8
- previous: Video
9
- previousLink: components/video/
10
- next: File Input
11
- nextLink: forms/file-input/
12
- ---
13
-
14
1
  The input field is an important part of the form element that can be used to create interactive controls to accept data from the user based on multiple input types, such as text, email, number, password, URL, phone number, and more.
15
2
 
16
3
  On this page you will find all of the input types based on multiple variants, styles, colors, and sizes built with the utility classes from Tailwind CSS and components from Flowbite.
@@ -19,7 +6,7 @@ On this page you will find all of the input types based on multiple variants, st
19
6
 
20
7
  Use this example as a generic form element which includes multiple input fields types such as text, email, password, number, URL, and phone number and use the grid layout to add multiple columns and rows.
21
8
 
22
- {{< example github="forms/input-field.md" show_dark=true >}}
9
+ ```html
23
10
  <form>
24
11
  <div class="grid gap-6 mb-6 md:grid-cols-2">
25
12
  <div>
@@ -67,13 +54,13 @@ Use this example as a generic form element which includes multiple input fields
67
54
  </div>
68
55
  <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>
69
56
  </form>
70
- {{< /example >}}
57
+ ```
71
58
 
72
59
  ## Input sizes
73
60
 
74
61
  Use the following examples to apply a small, default or large size for the input fields.
75
62
 
76
- {{< example class="space-y-6" github="forms/input-field.md" show_dark=true >}}
63
+ ```html
77
64
  <div>
78
65
  <label for="visitors" class="block mb-2.5 text-sm font-medium text-heading">Small Input</label>
79
66
  <input type="text" id="visitors" class="bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base focus:ring-brand focus:border-brand block w-full px-2.5 py-2 shadow-xs placeholder:text-body" placeholder="" required />
@@ -90,22 +77,22 @@ Use the following examples to apply a small, default or large size for the input
90
77
  <label for="visitors" class="block mb-2.5 text-sm font-medium text-heading">Extra Large Input</label>
91
78
  <input type="text" id="visitors" class="bg-neutral-secondary-medium border border-default-medium text-heading text-base rounded-base focus:ring-brand focus:border-brand block w-full px-4 py-3.5 shadow-xs placeholder:text-body" placeholder="" required />
92
79
  </div>
93
- {{< /example >}}
80
+ ```
94
81
 
95
82
  ## Disabled state
96
83
 
97
84
  Get started with this example if you want to apply the disabled state to an input field.
98
85
 
99
- {{< example class="space-y-6" github="forms/input-field.md" show_dark=true >}}
86
+ ```html
100
87
  <input type="text" id="disabled-input" aria-label="disabled input" class="bg-neutral-secondary-medium border border-default-medium text-fg-disabled text-sm rounded-base focus:ring-brand focus:border-brand block w-full px-3 py-2.5 shadow-xs placeholder:text-body" value="Disabled input" disabled>
101
88
  <input type="text" id="disabled-input-2" aria-label="disabled input 2" class="bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base focus:ring-brand focus:border-brand block w-full px-3 py-2.5 shadow-xs placeholder:text-body" value="Disabled readonly input" disabled readonly>
102
- {{< /example >}}
89
+ ```
103
90
 
104
91
  ## Validation
105
92
 
106
93
  Use the following example to apply validation styles for success and error messages.
107
94
 
108
- {{< example github="forms/input-field.md" show_dark=true >}}
95
+ ```html
109
96
  <div class="mb-6">
110
97
  <label for="success" class="block mb-2.5 text-sm font-medium text-fg-success-strong">Your name</label>
111
98
  <input type="text" id="success" class="bg-success-soft border border-success-subtle text-fg-success-strong text-sm rounded-base focus:ring-success focus:border-success block w-full px-3 py-2.5 shadow-xs placeholder:text-fg-success-strong" placeholder="Success input">
@@ -116,13 +103,13 @@ Use the following example to apply validation styles for success and error messa
116
103
  <input type="text" id="danger" class="bg-danger-soft border border-danger-subtle text-fg-danger-strong text-sm rounded-base focus:ring-danger focus:border-danger block w-full px-3 py-2.5 shadow-xs placeholder:text-fg-danger-strong" placeholder="Error input">
117
104
  <p class="mt-2.5 text-sm text-fg-danger-strong"><span class="font-medium">Oh, snapp!</span> Some error message.</p>
118
105
  </div>
119
- {{< /example >}}
106
+ ```
120
107
 
121
108
  ## Input group
122
109
 
123
110
  This example can be used to add a descriptive icon or additional text inside the input field.
124
111
 
125
- {{< example class="space-y-6" github="forms/input-field.md" show_dark=true >}}
112
+ ```html
126
113
  <label for="input-group-1" class="block mb-2.5 text-sm font-medium text-heading">Your Email</label>
127
114
  <div class="relative">
128
115
  <div class="absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none">
@@ -145,13 +132,13 @@ https://
145
132
  </span>
146
133
  <input type="text" id="website" class="rounded-none rounded-e-base block w-full px-3 py-2.5 bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base focus:ring-brand focus:border-brand placeholder:text-body" placeholder="flowbite.com">
147
134
  </div>
148
- {{< /example >}}
135
+ ```
149
136
 
150
137
  ## Helper text
151
138
 
152
139
  Use this example to show a helper text below the input field for additional explanation and links.
153
140
 
154
- {{< example github="forms/input-field.md" show_dark=true >}}
141
+ ```html
155
142
  <label for="input-group-1" class="block mb-2.5 text-sm font-medium text-heading">Your Email</label>
156
143
  <div class="relative">
157
144
  <div class="absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none">
@@ -160,13 +147,13 @@ Use this example to show a helper text below the input field for additional expl
160
147
  <input type="text" id="input-group-1" class="block w-full ps-9 pe-3 py-2.5 bg-neutral-secondary-medium border border-default-medium text-heading text-sm rounded-base focus:ring-brand focus:border-brand shadow-xs placeholder:text-body" placeholder="name@flowbite.com">
161
148
  </div>
162
149
  <p id="helper-text-explanation" class="mt-2.5 text-sm text-body">We’ll never share your details. Read our <a href="#" class="font-medium text-fg-brand hover:underline">Privacy Policy</a>.</p>
163
- {{< /example >}}
150
+ ```
164
151
 
165
152
  ## Search input
166
153
 
167
154
  Get started with this example where the submit button is positioned inside the input field.
168
155
 
169
- {{< example github="forms/input-field.md" show_dark=true >}}
156
+ ```html
170
157
  <form>
171
158
  <label for="search" class="mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white">Search</label>
172
159
  <div class="relative">
@@ -177,17 +164,15 @@ Get started with this example where the submit button is positioned inside the i
177
164
  <button type="button" class="absolute end-1.5 bottom-1.5 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 text-xs px-3 py-1.5 focus:outline-none">Search</button>
178
165
  </div>
179
166
  </form>
180
- {{< /example >}}
167
+ ```
168
+
181
169
 
182
- <div class="mt-8 -mb-5">
183
- {{< requires_js >}}
184
- </div>
185
170
 
186
171
  ## Dropdown input
187
172
 
188
173
  Use this example to show a dropdown menu right next to the input field.
189
174
 
190
- {{< example github="forms/input-field.md" show_dark=true iframeHeight="290" >}}
175
+ ```html
191
176
  <form>
192
177
  <div class="flex shadow-xs rounded-base -space-x-0.5">
193
178
  <label for="search-dropdown" class="mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white">Your Email</label>
@@ -219,4 +204,4 @@ Use this example to show a dropdown menu right next to the input field.
219
204
  </button>
220
205
  </div>
221
206
  </form>
222
- {{< /example >}}
207
+ ```