flowbite-mcp 1.0.0

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 (77) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +324 -0
  3. package/build/index.js +975 -0
  4. package/build/server-runner.js +228 -0
  5. package/data/components/accordion.md +860 -0
  6. package/data/components/alerts.md +739 -0
  7. package/data/components/avatar.md +178 -0
  8. package/data/components/badge.md +420 -0
  9. package/data/components/banner.md +145 -0
  10. package/data/components/bottom-navigation.md +513 -0
  11. package/data/components/breadcrumb.md +273 -0
  12. package/data/components/button-group.md +410 -0
  13. package/data/components/buttons.md +405 -0
  14. package/data/components/card.md +711 -0
  15. package/data/components/carousel.md +858 -0
  16. package/data/components/chat-bubble.md +1063 -0
  17. package/data/components/clipboard.md +1029 -0
  18. package/data/components/datepicker.md +673 -0
  19. package/data/components/device-mockups.md +152 -0
  20. package/data/components/drawer.md +1353 -0
  21. package/data/components/dropdowns.md +1925 -0
  22. package/data/components/footer.md +299 -0
  23. package/data/components/forms.md +371 -0
  24. package/data/components/gallery.md +322 -0
  25. package/data/components/indicators.md +262 -0
  26. package/data/components/jumbotron.md +213 -0
  27. package/data/components/kbd.md +217 -0
  28. package/data/components/list-group.md +365 -0
  29. package/data/components/mega-menu.md +558 -0
  30. package/data/components/modal.md +1309 -0
  31. package/data/components/navbar.md +1053 -0
  32. package/data/components/pagination.md +472 -0
  33. package/data/components/popover.md +826 -0
  34. package/data/components/progress.md +95 -0
  35. package/data/components/qr-code.md +280 -0
  36. package/data/components/rating.md +323 -0
  37. package/data/components/sidebar.md +1067 -0
  38. package/data/components/skeleton.md +221 -0
  39. package/data/components/speed-dial.md +1270 -0
  40. package/data/components/spinner.md +222 -0
  41. package/data/components/stepper.md +271 -0
  42. package/data/components/tables.md +3127 -0
  43. package/data/components/tabs.md +808 -0
  44. package/data/components/timeline.md +304 -0
  45. package/data/components/toast.md +341 -0
  46. package/data/components/tooltips.md +524 -0
  47. package/data/components/typography.md +269 -0
  48. package/data/components/video.md +95 -0
  49. package/data/forms/checkbox.md +375 -0
  50. package/data/forms/file-input.md +98 -0
  51. package/data/forms/floating-label.md +185 -0
  52. package/data/forms/input-field.md +222 -0
  53. package/data/forms/number-input.md +1099 -0
  54. package/data/forms/phone-input.md +577 -0
  55. package/data/forms/radio.md +315 -0
  56. package/data/forms/range.md +83 -0
  57. package/data/forms/search-input.md +280 -0
  58. package/data/forms/select.md +259 -0
  59. package/data/forms/textarea.md +155 -0
  60. package/data/forms/timepicker.md +732 -0
  61. package/data/forms/toggle.md +176 -0
  62. package/data/plugins/charts.md +2683 -0
  63. package/data/plugins/datatables.md +1922 -0
  64. package/data/plugins/datepicker.md +5 -0
  65. package/data/plugins/wysiwyg.md +2377 -0
  66. package/data/quickstart.md +169 -0
  67. package/data/theme.md +231 -0
  68. package/data/toc.md +79 -0
  69. package/data/typography/blockquote.md +182 -0
  70. package/data/typography/headings.md +174 -0
  71. package/data/typography/hr.md +74 -0
  72. package/data/typography/images.md +168 -0
  73. package/data/typography/links.md +118 -0
  74. package/data/typography/lists.md +387 -0
  75. package/data/typography/paragraphs.md +186 -0
  76. package/data/typography/text.md +249 -0
  77. package/package.json +71 -0
@@ -0,0 +1,739 @@
1
+ ---
2
+ layout: docs
3
+ title: Tailwind CSS Alerts - Flowbite
4
+ description: Show contextual information to your users using alert elements based on Tailwind CSS
5
+ group: components
6
+ toc: true
7
+
8
+ previous: Accordion
9
+ previousLink: components/accordion/
10
+ next: Avatar
11
+ nextLink: components/avatar/
12
+ ---
13
+
14
+ The alert component can be used to provide information to your users such as success or error messages, but also highlighted information complementing the normal flow of paragraphs and headers on a page.
15
+
16
+ Flowbite also includes dismissible alerts which can be hidden by the users by clicking on the close icon.
17
+
18
+ ## Default alert
19
+
20
+ Use the following examples of alert components to show messages as feedback to your users.
21
+
22
+ {{< example github="components/alerts.md" show_dark=true >}}
23
+ <div class="p-4 mb-4 text-sm text-fg-brand-strong rounded-base bg-brand-softer" role="alert">
24
+ <span class="font-medium">Info alert!</span> Change a few things up and try submitting again.
25
+ </div>
26
+ <div class="p-4 mb-4 text-sm text-fg-danger-strong rounded-base bg-danger-soft" role="alert">
27
+ <span class="font-medium">Danger alert!</span> Change a few things up and try submitting again.
28
+ </div>
29
+ <div class="p-4 mb-4 text-sm text-fg-success-strong rounded-base bg-success-soft" role="alert">
30
+ <span class="font-medium">Success alert!</span> Change a few things up and try submitting again.
31
+ </div>
32
+ <div class="p-4 mb-4 text-sm text-fg-warning rounded-base bg-warning-soft" role="alert">
33
+ <span class="font-medium">Warning alert!</span> Change a few things up and try submitting again.
34
+ </div>
35
+ <div class="p-4 text-sm text-heading rounded-base bg-neutral-secondary-medium" role="alert">
36
+ <span class="font-medium">Dark alert!</span> Change a few things up and try submitting again.
37
+ </div>
38
+ {{< /example >}}
39
+
40
+ ## Alerts with icon
41
+
42
+ You can also include a descriptive icon to complement the message inside the alert component with the following example.
43
+
44
+ {{< example github="components/alerts.md" show_dark=true >}}
45
+ <div class="flex items-start sm:items-center p-4 mb-4 text-sm text-fg-brand-strong rounded-base bg-brand-softer" role="alert">
46
+ <svg class="w-4 h-4 me-2 shrink-0 mt-0.5 sm:mt-0" 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="M10 11h2v5m-2 0h4m-2.592-8.5h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
47
+ <p><span class="font-medium me-1">Info alert!</span> Change a few things up and try submitting again.</p>
48
+ </div>
49
+ <div class="flex items-start sm:items-center p-4 mb-4 text-sm text-fg-danger-strong rounded-base bg-danger-soft" role="alert">
50
+ <svg class="w-4 h-4 me-2 shrink-0 mt-0.5 sm:mt-0" 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="M10 11h2v5m-2 0h4m-2.592-8.5h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
51
+ <p><span class="font-medium me-1">Danger alert!</span> Change a few things up and try submitting again.</p>
52
+ </div>
53
+ <div class="flex items-start sm:items-center p-4 mb-4 text-sm text-fg-success-strong rounded-base bg-success-soft" role="alert">
54
+ <svg class="w-4 h-4 me-2 shrink-0 mt-0.5 sm:mt-0" 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="M10 11h2v5m-2 0h4m-2.592-8.5h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
55
+ <p><span class="font-medium me-1">Success alert!</span> Change a few things up and try submitting again.</p>
56
+ </div>
57
+ <div class="flex items-start sm:items-center p-4 mb-4 text-sm text-fg-warning rounded-base bg-warning-soft" role="alert">
58
+ <svg class="w-4 h-4 me-2 shrink-0 mt-0.5 sm:mt-0" 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="M10 11h2v5m-2 0h4m-2.592-8.5h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
59
+ <p><span class="font-medium me-1">Warning alert!</span> Change a few things up and try submitting again.</p>
60
+ </div>
61
+ <div class="flex items-start sm:items-center p-4 text-sm text-heading rounded-base bg-neutral-secondary-medium" role="alert">
62
+ <svg class="w-4 h-4 me-2 shrink-0 mt-0.5 sm:mt-0" 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="M10 11h2v5m-2 0h4m-2.592-8.5h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
63
+ <p><span class="font-medium me-1">Dark alert!</span> Change a few things up and try submitting again.</p>
64
+ </div>
65
+ {{< /example >}}
66
+
67
+ ## Bordered alerts
68
+
69
+ Use this example to add a border accent to the alert component instead of just a plain background.
70
+
71
+ {{< example github="components/alerts.md" show_dark=true >}}
72
+ <div class="flex items-start sm:items-center p-4 mb-4 text-sm text-fg-brand-strong rounded-base bg-brand-softer border border-brand-subtle" role="alert">
73
+ <svg class="w-4 h-4 me-2 shrink-0 mt-0.5 sm:mt-0" 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="M10 11h2v5m-2 0h4m-2.592-8.5h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
74
+ <p><span class="font-medium me-1">Info alert!</span> Change a few things up and try submitting again.</p>
75
+ </div>
76
+ <div class="flex items-start sm:items-center p-4 mb-4 text-sm text-fg-danger-strong rounded-base bg-danger-soft border border-danger-subtle" role="alert">
77
+ <svg class="w-4 h-4 me-2 shrink-0 mt-0.5 sm:mt-0" 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="M10 11h2v5m-2 0h4m-2.592-8.5h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
78
+ <p><span class="font-medium me-1">Danger alert!</span> Change a few things up and try submitting again.</p>
79
+ </div>
80
+ <div class="flex items-start sm:items-center p-4 mb-4 text-sm text-fg-success-strong rounded-base bg-success-soft border border-success-subtle" role="alert">
81
+ <svg class="w-4 h-4 me-2 shrink-0 mt-0.5 sm:mt-0" 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="M10 11h2v5m-2 0h4m-2.592-8.5h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
82
+ <p><span class="font-medium me-1">Success alert!</span> Change a few things up and try submitting again.</p>
83
+ </div>
84
+ <div class="flex items-start sm:items-center p-4 mb-4 text-sm text-fg-warning rounded-base bg-warning-soft border border-warning-subtle" role="alert">
85
+ <svg class="w-4 h-4 me-2 shrink-0 mt-0.5 sm:mt-0" 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="M10 11h2v5m-2 0h4m-2.592-8.5h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
86
+ <p><span class="font-medium me-1">Warning alert!</span> Change a few things up and try submitting again.</p>
87
+ </div>
88
+ <div class="flex items-start sm:items-center p-4 text-sm text-heading rounded-base bg-neutral-secondary-medium border border-default-medium" role="alert">
89
+ <svg class="w-4 h-4 me-2 shrink-0 mt-0.5 sm:mt-0" 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="M10 11h2v5m-2 0h4m-2.592-8.5h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
90
+ <p><span class="font-medium me-1">Dark alert!</span> Change a few things up and try submitting again.</p>
91
+ </div>
92
+ {{< /example >}}
93
+
94
+ ## Alerts with list
95
+
96
+ Use this example to show a list and a description inside an alert component.
97
+
98
+ {{< example github="components/alerts.md" show_dark=true >}}
99
+ <div class="flex p-4 mb-4 text-sm text-fg-brand-strong rounded-base bg-brand-softer border border-brand-subtle" role="alert">
100
+ <svg class="w-4 h-4 me-2 shrink-0" 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="M10 11h2v5m-2 0h4m-2.592-8.5h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
101
+ <span class="sr-only">Info</span>
102
+ <div>
103
+ <span class="font-medium">Ensure that these requirements are met:</span>
104
+ <ul class="mt-2 list-disc list-outside space-y-1 ps-2.5">
105
+ <li>At least 10 characters (and up to 100 characters)</li>
106
+ <li>At least one lowercase character</li>
107
+ <li>Inclusion of at least one special character, e.g., ! @ # ?</li>
108
+ </ul>
109
+ </div>
110
+ </div>
111
+ <div class="flex p-4 mb-4 text-sm text-fg-danger-strong rounded-base bg-danger-soft border border-danger-subtle" role="alert">
112
+ <svg class="w-4 h-4 me-2 shrink-0" 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="M10 11h2v5m-2 0h4m-2.592-8.5h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
113
+ <span class="sr-only">Danger</span>
114
+ <div>
115
+ <span class="font-medium">Ensure that these requirements are met:</span>
116
+ <ul class="mt-2 list-disc list-outside space-y-1 ps-2.5">
117
+ <li>At least 10 characters (and up to 100 characters)</li>
118
+ <li>At least one lowercase character</li>
119
+ <li>Inclusion of at least one special character, e.g., ! @ # ?</li>
120
+ </ul>
121
+ </div>
122
+ </div>
123
+ <div class="flex p-4 mb-4 text-sm text-fg-success-strong rounded-base bg-success-soft border border-success-subtle" role="alert">
124
+ <svg class="w-4 h-4 me-2 shrink-0" 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="M10 11h2v5m-2 0h4m-2.592-8.5h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
125
+ <span class="sr-only">Success</span>
126
+ <div>
127
+ <span class="font-medium">Ensure that these requirements are met:</span>
128
+ <ul class="mt-2 list-disc list-outside space-y-1 ps-2.5">
129
+ <li>At least 10 characters (and up to 100 characters)</li>
130
+ <li>At least one lowercase character</li>
131
+ <li>Inclusion of at least one special character, e.g., ! @ # ?</li>
132
+ </ul>
133
+ </div>
134
+ </div>
135
+ <div class="flex p-4 mb-4 text-sm text-fg-warning rounded-base bg-warning-soft border border-warning-subtle" role="alert">
136
+ <svg class="w-4 h-4 me-2 shrink-0" 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="M10 11h2v5m-2 0h4m-2.592-8.5h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
137
+ <span class="sr-only">Success</span>
138
+ <div>
139
+ <span class="font-medium">Ensure that these requirements are met:</span>
140
+ <ul class="mt-2 list-disc list-outside space-y-1 ps-2.5">
141
+ <li>At least 10 characters (and up to 100 characters)</li>
142
+ <li>At least one lowercase character</li>
143
+ <li>Inclusion of at least one special character, e.g., ! @ # ?</li>
144
+ </ul>
145
+ </div>
146
+ </div>
147
+ {{< /example >}}
148
+
149
+ <div class="mt-8 -mb-5">
150
+ {{< requires_js >}}
151
+ </div>
152
+
153
+ ## Dismissing
154
+
155
+ Use the following alert elements that are also dismissible.
156
+
157
+ {{< example github="components/alerts.md" show_dark=true >}}
158
+ <div id="alert-1" class="flex sm:items-center p-4 mb-4 text-sm text-fg-brand-strong rounded-base bg-brand-softer" role="alert">
159
+ <svg class="w-4 h-4 shrink-0 mt-0.5 md:mt-0" 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="M10 11h2v5m-2 0h4m-2.592-8.5h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
160
+ <span class="sr-only">Info</span>
161
+ <div class="ms-2 text-sm">
162
+ A simple info alert with an <a href="#" class="font-medium underline hover:no-underline">example link</a>. Give it a click if you like.
163
+ </div>
164
+ <button type="button" class="ms-auto -mx-1.5 -my-1.5 rounded focus:ring-2 focus:ring-brand-medium hover:bg-brand-soft inline-flex items-center justify-center h-8 w-8 shrink-0 shrink-0" data-dismiss-target="#alert-1" aria-label="Close">
165
+ <span class="sr-only">Close</span>
166
+ <svg class="w-4 h-4" 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="M6 18 17.94 6M18 18 6.06 6"/></svg>
167
+ </button>
168
+ </div>
169
+ <div id="alert-2" class="flex sm:items-center p-4 mb-4 text-sm text-fg-danger-strong rounded-base bg-danger-soft" role="alert">
170
+ <svg class="w-4 h-4 shrink-0 mt-0.5 md:mt-0" 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="M10 11h2v5m-2 0h4m-2.592-8.5h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
171
+ <span class="sr-only">Info</span>
172
+ <div class="ms-2 text-sm ">
173
+ A simple info alert with an <a href="#" class="font-medium underline hover:no-underline">example link</a>. Give it a click if you like.
174
+ </div>
175
+ <button type="button" class="ms-auto -mx-1.5 -my-1.5 bg-danger-soft text-fg-danger-strong rounded focus:ring-2 focus:ring-danger-medium p-1.5 hover:bg-danger-medium inline-flex items-center justify-center h-8 w-8 shrink-0 shrink-0" data-dismiss-target="#alert-2" aria-label="Close">
176
+ <span class="sr-only">Close</span>
177
+ <svg class="w-4 h-4" 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="M6 18 17.94 6M18 18 6.06 6"/></svg>
178
+ </button>
179
+ </div>
180
+ <div id="alert-3" class="flex sm:items-center p-4 mb-4 text-sm text-fg-success-strong rounded-base bg-success-soft" role="alert">
181
+ <svg class="w-4 h-4 shrink-0 mt-0.5 md:mt-0" 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="M10 11h2v5m-2 0h4m-2.592-8.5h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
182
+ <span class="sr-only">Info</span>
183
+ <div class="ms-2 text-sm ">
184
+ A simple info alert with an <a href="#" class="font-medium underline hover:no-underline">example link</a>. Give it a click if you like.
185
+ </div>
186
+ <button type="button" class="ms-auto -mx-1.5 -my-1.5 rounded focus:ring-2 focus:ring-success-medium p-1.5 hover:bg-success-medium inline-flex items-center justify-center h-8 w-8 shrink-0 shrink-0" data-dismiss-target="#alert-3" aria-label="Close">
187
+ <span class="sr-only">Close</span>
188
+ <svg class="w-4 h-4" 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="M6 18 17.94 6M18 18 6.06 6"/></svg>
189
+ </button>
190
+ </div>
191
+ <div id="alert-4" class="flex smitems-center flex items-center p-4 mb-4 text-sm text-fg-warning rounded-base bg-warning-soft" role="alert">
192
+ <svg class="w-4 h-4 shrink-0 mt-0.5 md:mt-0" 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="M10 11h2v5m-2 0h4m-2.592-8.5h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
193
+ <span class="sr-only">Info</span>
194
+ <div class="ms-2 text-sm ">
195
+ A simple info alert with an <a href="#" class="font-medium underline hover:no-underline">example link</a>. Give it a click if you like.
196
+ </div>
197
+ <button type="button" class="ms-auto -mx-1.5 -my-1.5 rounded focus:ring-2 focus:ring-warning-medium p-1.5 hover:bg-warning-medium inline-flex items-center justify-center h-8 w-8 shrink-0 shrink-0" data-dismiss-target="#alert-4" aria-label="Close">
198
+ <span class="sr-only">Close</span>
199
+ <svg class="w-4 h-4" 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="M6 18 17.94 6M18 18 6.06 6"/></svg>
200
+ </button>
201
+ </div>
202
+ <div id="alert-5" class="flex sm:items-center p-4 text-sm text-heading rounded-base bg-neutral-secondary-medium" role="alert">
203
+ <svg class="w-4 h-4 shrink-0 mt-0.5 md:mt-0" 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="M10 11h2v5m-2 0h4m-2.592-8.5h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
204
+ <span class="sr-only">Info</span>
205
+ <div class="ms-2 text-sm ">
206
+ A simple dark alert with an <a href="#" class="font-medium underline hover:no-underline">example link</a>. Give it a click if you like.
207
+ </div>
208
+ <button type="button" class="ms-auto -mx-1.5 -my-1.5 rounded focus:ring-2 focus:ring-neutral-tertiary p-1.5 hover:bg-neutral-tertiary-medium inline-flex items-center justify-center h-8 w-8 shrink-0 shrink-0" data-dismiss-target="#alert-5" aria-label="Close">
209
+ <span class="sr-only">Dismiss</span>
210
+ <svg class="w-4 h-4" 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="M6 18 17.94 6M18 18 6.06 6"/></svg>
211
+ </button>
212
+ </div>
213
+ {{< /example >}}
214
+
215
+ ## Border accent
216
+
217
+ Use this example to add a border accent on top of the alert component for further visual distinction.
218
+
219
+ {{< example github="components/alerts.md" show_dark=true >}}
220
+ <div id="alert-border-1" class="flex sm:items-center p-4 mb-4 text-sm text-fg-brand-strong bg-brand-softer border-t-4 border-brand-subtle" role="alert">
221
+ <svg class="w-4 h-4 shrink-0 mt-0.5 md:mt-0" 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="M10 11h2v5m-2 0h4m-2.592-8.5h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
222
+ <span class="sr-only">Info</span>
223
+ <div class="ms-2 text-sm">
224
+ A simple info alert with an <a href="#" class="font-medium underline hover:no-underline">example link</a>. Give it a click if you like.
225
+ </div>
226
+ <button type="button" class="ms-auto -mx-1.5 -my-1.5 rounded focus:ring-2 focus:ring-brand-medium hover:bg-brand-soft inline-flex items-center justify-center h-8 w-8 shrink-0" data-dismiss-target="#alert-border-1" aria-label="Close">
227
+ <span class="sr-only">Close</span>
228
+ <svg class="w-4 h-4" 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="M6 18 17.94 6M18 18 6.06 6"/></svg>
229
+ </button>
230
+ </div>
231
+ <div id="alert-border-2" class="flex sm:items-center p-4 mb-4 text-sm text-fg-danger-strong bg-danger-soft border-t-4 border-danger-subtle" role="alert">
232
+ <svg class="w-4 h-4 shrink-0 mt-0.5 md:mt-0" 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="M10 11h2v5m-2 0h4m-2.592-8.5h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
233
+ <span class="sr-only">Info</span>
234
+ <div class="ms-2 text-sm ">
235
+ A simple info alert with an <a href="#" class="font-medium underline hover:no-underline">example link</a>. Give it a click if you like.
236
+ </div>
237
+ <button type="button" class="ms-auto -mx-1.5 -my-1.5 bg-danger-soft text-fg-danger-strong rounded focus:ring-2 focus:ring-danger-medium p-1.5 hover:bg-danger-medium inline-flex items-center justify-center h-8 w-8 shrink-0" data-dismiss-target="#alert-border-2" aria-label="Close">
238
+ <span class="sr-only">Close</span>
239
+ <svg class="w-4 h-4" 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="M6 18 17.94 6M18 18 6.06 6"/></svg>
240
+ </button>
241
+ </div>
242
+ <div id="alert-border-3" class="flex sm:items-center p-4 mb-4 text-sm text-fg-success-strong bg-success-soft border-t-4 border-success-subtle" role="alert">
243
+ <svg class="w-4 h-4 shrink-0 mt-0.5 md:mt-0" 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="M10 11h2v5m-2 0h4m-2.592-8.5h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
244
+ <span class="sr-only">Info</span>
245
+ <div class="ms-2 text-sm ">
246
+ A simple info alert with an <a href="#" class="font-medium underline hover:no-underline">example link</a>. Give it a click if you like.
247
+ </div>
248
+ <button type="button" class="ms-auto -mx-1.5 -my-1.5 rounded focus:ring-2 focus:ring-success-medium p-1.5 hover:bg-success-medium inline-flex items-center justify-center h-8 w-8 shrink-0" data-dismiss-target="#alert-border-3" aria-label="Close">
249
+ <span class="sr-only">Close</span>
250
+ <svg class="w-4 h-4" 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="M6 18 17.94 6M18 18 6.06 6"/></svg>
251
+ </button>
252
+ </div>
253
+ <div id="alert-border-4" class="flex sm:items-center p-4 mb-4 text-sm text-fg-warning bg-warning-soft border-t-4 border-warning-subtle" role="alert">
254
+ <svg class="w-4 h-4 shrink-0 mt-0.5 md:mt-0" 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="M10 11h2v5m-2 0h4m-2.592-8.5h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
255
+ <span class="sr-only">Info</span>
256
+ <div class="ms-2 text-sm ">
257
+ A simple info alert with an <a href="#" class="font-medium underline hover:no-underline">example link</a>. Give it a click if you like.
258
+ </div>
259
+ <button type="button" class="ms-auto -mx-1.5 -my-1.5 rounded focus:ring-2 focus:ring-warning-medium p-1.5 hover:bg-warning-medium inline-flex items-center justify-center h-8 w-8 shrink-0" data-dismiss-target="#alert-border-4" aria-label="Close">
260
+ <span class="sr-only">Close</span>
261
+ <svg class="w-4 h-4" 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="M6 18 17.94 6M18 18 6.06 6"/></svg>
262
+ </button>
263
+ </div>
264
+ <div id="alert-border-5" class="flex sm:items-center p-4 text-sm text-heading bg-neutral-secondary-medium border-t-4 border-default-medium" role="alert">
265
+ <svg class="w-4 h-4 shrink-0 mt-0.5 md:mt-0" 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="M10 11h2v5m-2 0h4m-2.592-8.5h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
266
+ <span class="sr-only">Info</span>
267
+ <div class="ms-2 text-sm ">
268
+ A simple dark alert with an <a href="#" class="font-medium underline hover:no-underline">example link</a>. Give it a click if you like.
269
+ </div>
270
+ <button type="button" class="ms-auto -mx-1.5 -my-1.5 rounded focus:ring-2 focus:ring-neutral-tertiary p-1.5 hover:bg-neutral-tertiary-medium inline-flex items-center justify-center h-8 w-8 shrink-0" data-dismiss-target="#alert-border-5" aria-label="Close">
271
+ <span class="sr-only">Dismiss</span>
272
+ <svg class="w-4 h-4" 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="M6 18 17.94 6M18 18 6.06 6"/></svg>
273
+ </button>
274
+ </div>
275
+ {{< /example >}}
276
+
277
+ ## Additional content
278
+
279
+ The following alert components can be used if you wish to disclose more information inside the element.
280
+
281
+ {{< example github="components/alerts.md" show_dark=true >}}
282
+ <div id="alert-additional-content-1" class="p-4 mb-4 text-sm text-fg-brand-strong rounded-base bg-brand-softer border border-brand-subtle" role="alert">
283
+ <div class="flex items-center justify-between">
284
+ <div class="flex items-center">
285
+ <svg class="w-4 h-4 shrink-0 me-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="M10 11h2v5m-2 0h4m-2.592-8.5h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
286
+ <span class="sr-only">Info</span>
287
+ <h3 class="font-medium">This is a info alert</h3>
288
+ </div>
289
+ <button type="button" data-dismiss-target="#alert-additional-content-1" aria-label="Close" class="ms-auto -mx-1.5 -my-1.5 rounded focus:ring-2 focus:ring-brand-medium hover:bg-brand-soft inline-flex items-center justify-center h-8 w-8 shrink-0">
290
+ <span class="sr-only">Close</span>
291
+ <svg class="w-4 h-4" 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="M6 18 17.94 6M18 18 6.06 6"/></svg>
292
+ </button>
293
+ </div>
294
+ <div class="mt-2 mb-4">
295
+ More info about this info alert goes here. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.
296
+ </div>
297
+ <button 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-xs px-3 py-1.5 focus:outline-none">
298
+ <svg class="w-3.5 h-3.5 me-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-width="2" d="M21 12c0 1.2-4.03 6-9 6s-9-4.8-9-6c0-1.2 4.03-6 9-6s9 4.8 9 6Z"/><path stroke="currentColor" stroke-width="2" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/></svg>
299
+ View more
300
+ </button>
301
+ </div>
302
+
303
+ <div id="alert-additional-content-2" class="p-4 mb-4 text-sm text-fg-danger-strong rounded-base bg-danger-soft border border-danger-subtle" role="alert">
304
+ <div class="flex items-center justify-between">
305
+ <div class="flex items-center">
306
+ <svg class="w-4 h-4 shrink-0 me-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="M10 11h2v5m-2 0h4m-2.592-8.5h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
307
+ <span class="sr-only">Info</span>
308
+ <h3 class="font-medium">This is a danger alert</h3>
309
+ </div>
310
+ <button type="button" data-dismiss-target="#alert-additional-content-2" aria-label="Close" class="ms-auto -mx-1.5 -my-1.5 bg-danger-soft text-fg-danger-strong rounded focus:ring-2 focus:ring-danger-medium p-1.5 hover:bg-danger-medium inline-flex items-center justify-center h-8 w-8 shrink-0">
311
+ <span class="sr-only">Close</span>
312
+ <svg class="w-4 h-4" 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="M6 18 17.94 6M18 18 6.06 6"/></svg>
313
+ </button>
314
+ </div>
315
+ <div class="mt-2 mb-4">
316
+ More info about this info alert goes here. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.
317
+ </div>
318
+ <button type="button" class="inline-flex items-center text-white bg-danger box-border border border-transparent hover:bg-danger-strong focus:ring-4 focus:ring-danger-medium shadow-xs font-medium leading-5 rounded-base text-xs px-3 py-1.5 focus:outline-none">
319
+ <svg class="w-3.5 h-3.5 me-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-width="2" d="M21 12c0 1.2-4.03 6-9 6s-9-4.8-9-6c0-1.2 4.03-6 9-6s9 4.8 9 6Z"/><path stroke="currentColor" stroke-width="2" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/></svg>
320
+ View more
321
+ </button>
322
+ </div>
323
+
324
+ <div id="alert-additional-content-3" class="p-4 mb-4 text-sm text-fg-success-strong rounded-base bg-success-soft border border-success-subtle" role="alert">
325
+ <div class="flex items-center justify-between">
326
+ <div class="flex items-center">
327
+ <svg class="w-4 h-4 shrink-0 me-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="M10 11h2v5m-2 0h4m-2.592-8.5h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
328
+ <span class="sr-only">Info</span>
329
+ <h3 class="font-medium">This is a success alert</h3>
330
+ </div>
331
+ <button type="button" data-dismiss-target="#alert-additional-content-3" aria-label="Close" class="ms-auto -mx-1.5 -my-1.5 bg-success-soft text-fg-success-strong rounded focus:ring-2 focus:ring-success-medium p-1.5 hover:bg-success-medium inline-flex items-center justify-center h-8 w-8 shrink-0">
332
+ <span class="sr-only">Close</span>
333
+ <svg class="w-4 h-4" 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="M6 18 17.94 6M18 18 6.06 6"/></svg>
334
+ </button>
335
+ </div>
336
+ <div class="mt-2 mb-4">
337
+ More info about this info alert goes here. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.
338
+ </div>
339
+ <button type="button" class="inline-flex items-center text-white bg-success box-border border border-transparent hover:bg-success-strong focus:ring-4 focus:ring-success-medium shadow-xs font-medium leading-5 rounded-base text-xs px-3 py-1.5 focus:outline-none">
340
+ <svg class="w-3.5 h-3.5 me-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-width="2" d="M21 12c0 1.2-4.03 6-9 6s-9-4.8-9-6c0-1.2 4.03-6 9-6s9 4.8 9 6Z"/><path stroke="currentColor" stroke-width="2" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/></svg>
341
+ View more
342
+ </button>
343
+ </div>
344
+
345
+ <div id="alert-additional-content-4" class="p-4 mb-4 text-sm text-fg-warning rounded-base bg-warning-soft border border-warning-subtle" role="alert">
346
+ <div class="flex items-center justify-between">
347
+ <div class="flex items-center">
348
+ <svg class="w-4 h-4 shrink-0 me-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="M10 11h2v5m-2 0h4m-2.592-8.5h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
349
+ <span class="sr-only">Info</span>
350
+ <h3 class="font-medium">This is a warning alert</h3>
351
+ </div>
352
+ <button type="button" data-dismiss-target="#alert-additional-content-4" aria-label="Close" class="ms-auto -mx-1.5 -my-1.5 bg-warning-soft text-fg-warning-strong rounded focus:ring-2 focus:ring-warning-medium p-1.5 hover:bg-warning-medium inline-flex items-center justify-center h-8 w-8 shrink-0">
353
+ <span class="sr-only">Close</span>
354
+ <svg class="w-4 h-4" 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="M6 18 17.94 6M18 18 6.06 6"/></svg>
355
+ </button>
356
+ </div>
357
+ <div class="mt-2 mb-4">
358
+ More info about this info alert goes here. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.
359
+ </div>
360
+ <button type="button" class="inline-flex items-center text-white bg-warning box-border border border-transparent hover:bg-warning-strong focus:ring-4 focus:ring-warning-medium shadow-xs font-medium leading-5 rounded-base text-xs px-3 py-1.5 focus:outline-none">
361
+ <svg class="w-3.5 h-3.5 me-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-width="2" d="M21 12c0 1.2-4.03 6-9 6s-9-4.8-9-6c0-1.2 4.03-6 9-6s9 4.8 9 6Z"/><path stroke="currentColor" stroke-width="2" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/></svg>
362
+ View more
363
+ </button>
364
+ </div>
365
+
366
+ <div id="alert-additional-content-5" class="p-4 text-sm text-heading rounded-base bg-neutral-secondary-medium border border-default-medium" role="alert">
367
+ <div class="flex items-center justify-between">
368
+ <div class="flex items-center">
369
+ <svg class="w-4 h-4 shrink-0 me-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="M10 11h2v5m-2 0h4m-2.592-8.5h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
370
+ <span class="sr-only">Info</span>
371
+ <h3 class="font-medium">This is a default alert</h3>
372
+ </div>
373
+ <button type="button" data-dismiss-target="#alert-additional-content-5" aria-label="Close" class="ms-auto -mx-1.5 -my-1.5 rounded focus:ring-2 focus:ring-neutral-tertiary p-1.5 hover:bg-neutral-tertiary-medium inline-flex items-center justify-center h-8 w-8 shrink-0">
374
+ <span class="sr-only">Close</span>
375
+ <svg class="w-4 h-4" 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="M6 18 17.94 6M18 18 6.06 6"/></svg>
376
+ </button>
377
+ </div>
378
+ <div class="mt-2 mb-4">
379
+ More info about this info alert goes here. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.
380
+ </div>
381
+ <button type="button" class="inline-flex items-center text-white bg-dark-soft box-border border border-transparent hover:bg-dark-strong focus:ring-4 focus:ring-neutral-tertiary shadow-xs font-medium leading-5 rounded-base text-xs px-3 py-1.5 focus:outline-none">
382
+ <svg class="w-3.5 h-3.5 me-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-width="2" d="M21 12c0 1.2-4.03 6-9 6s-9-4.8-9-6c0-1.2 4.03-6 9-6s9 4.8 9 6Z"/><path stroke="currentColor" stroke-width="2" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/></svg>
383
+ View more
384
+ </button>
385
+ </div>
386
+
387
+ {{< /example >}}
388
+
389
+ ## Announcement alerts
390
+
391
+ Use this alert component to make announcements with a CTA link.
392
+
393
+ {{< example github="components/alerts.md" show_dark=true >}}
394
+ <div id="alert-small-1" class="w-auto inline-flex items-center p-1 pe-2 mb-4 text-sm text-fg-brand-strong rounded-full bg-brand-softer border border-brand-subtle" role="alert">
395
+ <span class="bg-brand-soft text-fg-brand-strong py-0.5 px-2 rounded-full">New</span>
396
+ <div class="ms-2 text-sm">
397
+ Great job! You've acknowledged this <a href="#" class="font-medium underline hover:no-underline">significant</a> alert message.
398
+ </div>
399
+ <svg class="w-4 h-4 ms-1 shrink-0" 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 5 7 7-7 7"/></svg>
400
+ </div>
401
+
402
+ <div id="alert-small-2" class="w-auto inline-flex items-center p-1 pe-2 mb-4 text-sm text-fg-danger-strong rounded-full bg-danger-soft border border-danger-subtle" role="alert">
403
+ <span class="bg-danger-medium text-fg-danger-strong py-0.5 px-2 rounded-full">New</span>
404
+ <div class="ms-2 text-sm">
405
+ Great job! You've acknowledged this <a href="#" class="font-medium underline hover:no-underline">significant</a> alert message.
406
+ </div>
407
+ <svg class="w-4 h-4 ms-1 shrink-0" 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 5 7 7-7 7"/></svg>
408
+ </div>
409
+
410
+ <div id="alert-small-3" class="w-auto inline-flex items-center p-1 pe-2 mb-4 text-sm text-fg-success-strong rounded-full bg-success-soft border border-success-subtle" role="alert">
411
+ <span class="bg-success-medium text-fg-success-strong py-0.5 px-2 rounded-full">New</span>
412
+ <div class="ms-2 text-sm">
413
+ Great job! You've acknowledged this <a href="#" class="font-medium underline hover:no-underline">significant</a> alert message.
414
+ </div>
415
+ <svg class="w-4 h-4 ms-1 shrink-0" 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 5 7 7-7 7"/></svg>
416
+ </div>
417
+
418
+ <div id="alert-small-4" class="w-auto inline-flex items-center p-1 pe-2 mb-4 text-sm text-fg-warning rounded-full bg-warning-soft border border-warning-subtle" role="alert">
419
+ <span class="bg-warning-medium text-fg-warning py-0.5 px-2 rounded-full">New</span>
420
+ <div class="ms-2 text-sm">
421
+ Great job! You've acknowledged this <a href="#" class="font-medium underline hover:no-underline">significant</a> alert message.
422
+ </div>
423
+ <svg class="w-4 h-4 ms-1 shrink-0" 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 5 7 7-7 7"/></svg>
424
+ </div>
425
+
426
+ <div id="alert-small-5" class="w-auto inline-flex items-center p-1 pe-2 mb-4 text-sm text-heading rounded-full bg-neutral-secondary-medium border border-default-medium" role="alert">
427
+ <span class="bg-neutral-quaternary text-heading py-0.5 px-2 rounded-full">New</span>
428
+ <div class="ms-2 text-sm">
429
+ Great job! You've acknowledged this <a href="#" class="font-medium underline hover:no-underline">significant</a> alert message.
430
+ </div>
431
+ <svg class="w-4 h-4 ms-1 shrink-0" 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 5 7 7-7 7"/></svg>
432
+ </div>
433
+ {{< /example >}}
434
+
435
+ ## JavaScript behaviour
436
+
437
+ The **Dismiss** class from Flowbite can be used to create an object that will hide a target element or elements based on the parameters, options, and methods that you provide.
438
+
439
+ ### Object parameters
440
+
441
+ The parameters for the Dismiss object can be used to programmatically initialize and manipulate the behaviour of the dismissal of the target element.
442
+
443
+ <div class="relative my-10 overflow-x-auto shadow-xs rounded-base border border-default">
444
+ <table class="w-full text-sm text-left text-body">
445
+ <thead class="bg-neutral-secondary-soft">
446
+ <tr class="text-heading text-xs font-medium uppercase">
447
+ <th scope="col" class="px-6 py-3">
448
+ Parameter
449
+ </th>
450
+ <th scope="col" class="px-6 py-3">
451
+ Type
452
+ </th>
453
+ <th scope="col" class="px-6 py-3">
454
+ Required
455
+ </th>
456
+ <th scope="col" class="px-6 py-3">
457
+ Description
458
+ </th>
459
+ </tr>
460
+ </thead>
461
+ <tbody>
462
+ <tr class="border-b bg-neutral-primary border-default">
463
+ <td class="px-6 py-4 font-medium">
464
+ <code class="text-fg-brand">targetEl</code>
465
+ </td>
466
+ <td class="px-6 py-4">
467
+ Element
468
+ </td>
469
+ <td class="px-6 py-4">
470
+ Required
471
+ </td>
472
+ <td class="px-6 py-4">
473
+ Pass the element object that will be dismissed.
474
+ </td>
475
+ </tr>
476
+ <tr class="border-b bg-neutral-primary border-default">
477
+ <td class="px-6 py-4 font-medium">
478
+ <code class="text-fg-brand">triggerEl</code>
479
+ </td>
480
+ <td class="px-6 py-4">
481
+ Element
482
+ </td>
483
+ <td class="px-6 py-4">
484
+ Optional
485
+ </td>
486
+ <td class="px-6 py-4">
487
+ Pass the element object that will trigger the targetEl dismission on click.
488
+ </td>
489
+ </tr>
490
+ <tr class="border-b bg-neutral-primary border-default">
491
+ <td class="px-6 py-4 font-medium">
492
+ <code class="text-fg-brand">options</code>
493
+ </td>
494
+ <td class="px-6 py-4">
495
+ Object
496
+ </td>
497
+ <td class="px-6 py-4">
498
+ Optional
499
+ </td>
500
+ <td class="px-6 py-4">
501
+ Pass the options object to set the trigger element, transition, duration, timing classes of the dismiss animation and callback functions.
502
+ </td>
503
+ </tr>
504
+ <tr class="bg-neutral-primary">
505
+ <td class="px-6 py-4 font-medium">
506
+ <code class="text-fg-brand">instanceOptions</code>
507
+ </td>
508
+ <td class="px-6 py-4">
509
+ Object
510
+ </td>
511
+ <td class="px-6 py-4">
512
+ Optional
513
+ </td>
514
+ <td class="px-6 py-4">
515
+ Object of options that allows you to set a custom ID for the instance that is being added to the <a href="https://flowbite.com/docs/getting-started/javascript/#instance-options" class="underline hover:no-underline">Instance Manager</a> and whether to override or not an existing instance.
516
+ </td>
517
+ </tr>
518
+ </tbody>
519
+ </table>
520
+ </div>
521
+
522
+ ### Options
523
+
524
+ Use these optional options for the Dismiss object to set the transition, duration, and timing function types based on the utility classes from Tailwind CSS.
525
+
526
+ <div class="relative my-10 overflow-x-auto shadow-xs rounded-base border border-default">
527
+ <table class="w-full text-sm text-left text-body0">
528
+ <thead class="bg-neutral-secondary-soft">
529
+ <tr class="text-heading text-xs font-medium uppercase">
530
+ <th scope="col" class="px-6 py-3">
531
+ Option
532
+ </th>
533
+ <th scope="col" class="px-6 py-3">
534
+ Type
535
+ </th>
536
+ <th scope="col" class="px-6 py-3">
537
+ Description
538
+ </th>
539
+ </tr>
540
+ </thead>
541
+ <tbody class="text-body">
542
+ <tr class="border-b bg-neutral-primary border-default">
543
+ <td class="px-6 py-4 font-medium">
544
+ <code class="text-fg-brand">transition</code>
545
+ </td>
546
+ <td class="px-6 py-4 font-medium">
547
+ String
548
+ </td>
549
+ <td class="px-6 py-4">
550
+ Use one of the Transition Property utility classes from Tailwind CSS to set transition type for the main element. The default value is <code class="text-fg-brand">transition-opacity</code>.
551
+ </td>
552
+ </tr>
553
+ <tr class="border-b bg-neutral-primary border-default">
554
+ <td class="px-6 py-4 font-medium">
555
+ <code class="text-fg-brand">duration</code>
556
+ </td>
557
+ <td class="px-6 py-4 font-medium">
558
+ Integer
559
+ </td>
560
+ <td class="px-6 py-4">
561
+ Set the duration of the dismissing animation. The default value is <code class="text-fg-brand">300</code> (300 milliseconds).
562
+ </td>
563
+ </tr>
564
+ <tr class="border-b bg-neutral-primary border-default">
565
+ <td class="px-6 py-4 font-medium">
566
+ <code class="text-fg-brand">timing</code>
567
+ </td>
568
+ <td class="px-6 py-4 font-medium">
569
+ String
570
+ </td>
571
+ <td class="px-6 py-4">
572
+ Set the transition timing function utility class from Tailwind CSS. The default value is <code class="text-fg-brand">ease-out</code>.
573
+ </td>
574
+ </tr>
575
+ <tr class="bg-neutral-primary">
576
+ <td class="px-6 py-4 font-medium">
577
+ <code class="text-fg-brand">onHide</code>
578
+ </td>
579
+ <td class="px-6 py-4 font-medium">
580
+ Function
581
+ </td>
582
+ <td class="px-6 py-4">
583
+ Set a callback function when the item has been dismissed.
584
+ </td>
585
+ </tr>
586
+ </tbody>
587
+ </table>
588
+ </div>
589
+
590
+ ### Methods
591
+
592
+ Use the following methods on the Dismiss object to programmatically manipulate the behaviour.
593
+
594
+ <div class="relative my-10 overflow-x-auto shadow-xs rounded-base border border-default">
595
+ <table class="w-full text-sm text-left text-body">
596
+ <thead class="text-heading bg-neutral-secondary-soft">
597
+ <tr class="text-xs font-medium uppercase">
598
+ <th scope="col" class="px-6 py-3">
599
+ Method
600
+ </th>
601
+ <th scope="col" class="px-6 py-3">
602
+ Description
603
+ </th>
604
+ </tr>
605
+ </thead>
606
+ <tbody>
607
+ <tr class="border-b bg-neutral-primary border-default">
608
+ <td class="px-6 py-4 font-medium">
609
+ <code class="text-fg-brand">hide()</code>
610
+ </td>
611
+ <td class="px-6 py-4">
612
+ Use this method on the Dismiss object to hide the target element.
613
+ </td>
614
+ </tr>
615
+ <tr class="bg-neutral-primary">
616
+ <td class="px-6 py-4 font-medium">
617
+ <code class="text-fg-brand">updateOnHide(callback)</code>
618
+ </td>
619
+ <td class="px-6 py-4">
620
+ Use this method to set the callback function when the item has been dismissed.
621
+ </td>
622
+ </tr>
623
+ </tbody>
624
+ </table>
625
+ </div>
626
+
627
+ ### Example
628
+
629
+ Check out the following JavaScript example to learn how to initialize, set the options, and use the methods for the Dismiss object.
630
+
631
+ First of all, you should set the required target element and optionally set a trigger element which will dismiss the target element when clicked and other options to customize the animation.
632
+
633
+ {{< code lang="javascript" file="dismiss.js" icon="file" >}}
634
+ // target element that will be dismissed
635
+ const $targetEl = document.getElementById('targetElement');
636
+
637
+ // optional trigger element
638
+ const $triggerEl = document.getElementById('triggerElement');
639
+
640
+ // options object
641
+ const options = {
642
+ transition: 'transition-opacity',
643
+ duration: 1000,
644
+ timing: 'ease-out',
645
+
646
+ // callback functions
647
+ onHide: (context, targetEl) => {
648
+ console.log('element has been dismissed')
649
+ console.log(targetEl)
650
+ }
651
+ };
652
+
653
+ // instance options object
654
+ const instanceOptions = {
655
+ id: 'targetElement',
656
+ override: true
657
+ };
658
+ {{< /code >}}
659
+
660
+ Create a new Dismiss object based on the options set above.
661
+
662
+ {{< code lang="javascript" file="dismiss.js" icon="file" >}}
663
+ import { Dismiss } from 'flowbite';
664
+
665
+ /*
666
+ * $targetEl (required)
667
+ * $triggerEl (optional)
668
+ * options (optional)
669
+ * instanceOptions (optional)
670
+ */
671
+ const dismiss = new Dismiss($targetEl, $triggerEl, options, instanceOptions);
672
+ {{< /code >}}
673
+
674
+ You can now use the methods on the Dismiss object.
675
+
676
+ {{< code lang="javascript" >}}
677
+ // hide the target element
678
+ dismiss.hide();
679
+ {{< /code >}}
680
+
681
+ ### HTML Markup
682
+
683
+ Use this HTML code for the JavaScript code example above.
684
+
685
+ {{< code lang="html" file="dismiss.html" icon="file" >}}
686
+ <button id="triggerElement" 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">Hide alert</button>
687
+
688
+ <div id="targetElement" class="p-4 mb-4 text-sm text-fg-brand-strong rounded-base bg-brand-softer" role="alert">
689
+ <span class="font-medium">Info alert!</span> Change a few things up and try submitting again.
690
+ </div>
691
+ {{< /code >}}
692
+
693
+ ### TypeScript
694
+
695
+ If you're using the <a href="{{< ref "getting-started/typescript" >}}">TypeScript configuration</a> from Flowbite then you can import the types for the Dismiss class, parameters and its options.
696
+
697
+ Here's an example that applies the types from Flowbite to the code above:
698
+
699
+ {{< code lang="typescript" file="dismiss.ts" icon="file" >}}
700
+ import { Dismiss } from "flowbite";
701
+ import type { DismissOptions, DismissInterface } from "flowbite";
702
+ import type { InstanceOptions } from 'flowbite';
703
+
704
+ // target element that will be dismissed
705
+ const $targetEl: HTMLElement = document.getElementById('targetElement');
706
+
707
+ // optional trigger element
708
+ const $triggerEl: HTMLElement = document.getElementById('triggerElement');
709
+
710
+ // options object
711
+ const options: DismissOptions = {
712
+ transition: 'transition-opacity',
713
+ duration: 1000,
714
+ timing: 'ease-out',
715
+
716
+ // callback functions
717
+ onHide: (context, targetEl) => {
718
+ console.log('element has been dismissed')
719
+ console.log(targetEl)
720
+ }
721
+ };
722
+
723
+ // instance options object
724
+ const instanceOptions: InstanceOptions = {
725
+ id: 'targetElement',
726
+ override: true
727
+ };
728
+
729
+ /*
730
+ * $targetEl (required)
731
+ * $triggerEl (optional)
732
+ * options (optional)
733
+ * instanceOptions (optional)
734
+ */
735
+ const dismiss: DismissInterface = new Dismiss($targetEl, $triggerEl, options, instanceOptions);
736
+
737
+ // programmatically hide it
738
+ dismiss.hide();
739
+ {{< /code >}}