flowbite-mcp 1.1.2 → 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
package/README.md CHANGED
@@ -38,55 +38,12 @@ An [MCP server](https://flowbite.com/docs/getting-started/mcp/) that enables AI
38
38
  The simplest way to use Flowbite MCP Server:
39
39
 
40
40
  ```bash
41
- # Run directly with npx (no installation needed)
42
41
  npx flowbite-mcp
43
-
44
- # Show help and options
45
- npx flowbite-mcp --help
46
-
47
- # Run in HTTP server mode for production
48
- npx flowbite-mcp --mode http --port 3000
49
42
  ```
50
43
 
51
- ## Local Transport Modes
52
-
53
- ### Standard I/O (stdio)
54
-
55
- The default mode for local development and CLI integrations:
56
-
57
- ```bash
58
- # Start in stdio mode (default)
59
- node build/index.js
60
-
61
- # Configure in MCP client (ie. Cursor, Windsurf, Claude)
62
- {
63
- "mcpServers": {
64
- "flowbite": {
65
- "command": "node",
66
- "args": ["/path/to/flowbite-mcp/build/index.js"],
67
- "env": {
68
- "FIGMA_ACCESS_TOKEN": "YOUR_PERSONAL_FIGMA_ACCESS_TOKEN"
69
- }
70
- }
71
- }
72
- }
73
- ```
74
-
75
- Learn how to get the [Figma personal access token](https://help.figma.com/hc/en-us/articles/8085703771159-Manage-personal-access-tokens) to enable the Figma to code generation tool.
76
-
77
- ### HTTP server
78
-
79
- HTTP-based transport for production and multi-client scenarios:
80
-
81
- ```bash
82
- node build/index.js --mode http --port 3000
83
- ```
84
-
85
- This will make the MCP server available at 'http://localhost:3000/mcp'.
86
-
87
44
  ### Environment variables
88
45
 
89
- Currently you only need the Figma personal access token if you want to enable the [Figma to code generation tool](https://help.figma.com/hc/en-us/articles/8085703771159-Manage-personal-access-tokens). You set this variable in your MCP client configuration file.
46
+ Currently you only need the [Figma personal access token](https://help.figma.com/hc/en-us/articles/8085703771159-Manage-personal-access-tokens) if you want to enable the Figma to code generation tool.
90
47
 
91
48
  ```bash
92
49
  // other options
@@ -95,27 +52,11 @@ Currently you only need the Figma personal access token if you want to enable th
95
52
  }
96
53
  ```
97
54
 
98
- ### Hosting variables
99
-
100
- Configure the server behavior with these environment variables:
101
-
102
- ```bash
103
- # Transport mode: stdio (default) or http
104
- MCP_TRANSPORT_MODE=http
105
-
106
- # Server port for HTTP mode
107
- MCP_PORT=3000
108
-
109
- # Host binding for HTTP mode
110
- MCP_HOST=0.0.0.0
111
-
112
- # CORS origins (comma-separated)
113
- MCP_CORS_ORIGINS=http://localhost:3000,https://myapp.com
114
- ```
55
+ You set this variable in your MCP client configuration file.
115
56
 
116
57
  ## Integration examples
117
58
 
118
- Use the following configuration examples to install the Flowbite MCP server in popular clients such as Cursor, Claude, Windsurf, and more.
59
+ Use the following configuration examples to install the Flowbite MCP server in popular clients such as Cursor, Claude, Windsurf, and others.
119
60
 
120
61
  ### Claude desktop
121
62
 
@@ -179,6 +120,41 @@ Update the `mcp_config.json` file and add the following configuration:
179
120
  <img width="380" height="200" src="https://glama.ai/mcp/servers/@zoltanszogyenyi/flowbite-mcp/badge" />
180
121
  </a>
181
122
 
123
+ ## Local Transport Modes
124
+
125
+ ### Standard I/O (stdio)
126
+
127
+ The default mode for local development and CLI integrations:
128
+
129
+ ```bash
130
+ # Start in stdio mode (default)
131
+ node build/index.js
132
+
133
+ {
134
+ "mcpServers": {
135
+ "flowbite": {
136
+ "command": "node",
137
+ "args": ["/path/to/flowbite-mcp/build/index.js"],
138
+ "env": {
139
+ "FIGMA_ACCESS_TOKEN": "YOUR_PERSONAL_FIGMA_ACCESS_TOKEN"
140
+ }
141
+ }
142
+ }
143
+ }
144
+ ```
145
+
146
+ Learn how to get the [Figma personal access token](https://help.figma.com/hc/en-us/articles/8085703771159-Manage-personal-access-tokens) to enable the Figma to code generation tool.
147
+
148
+ ### HTTP server
149
+
150
+ HTTP-based transport for production and multi-client scenarios:
151
+
152
+ ```bash
153
+ node build/index.js --mode http --port 3000
154
+ ```
155
+
156
+ This will make the MCP server available at 'http://localhost:3000/mcp'.
157
+
182
158
  ### Local development
183
159
 
184
160
  ```bash
@@ -217,23 +193,22 @@ docker-compose up -d
217
193
  curl http://localhost:3000/health
218
194
  ```
219
195
 
220
- ## Development Scripts
196
+ ### Hosting variables
221
197
 
222
- ```bash
223
- # Build TypeScript to JavaScript
224
- npm run build
198
+ Configure the server behavior with these environment variables:
225
199
 
226
- # Watch mode for development
227
- npm run watch
200
+ ```bash
201
+ # Transport mode: stdio (default) or http
202
+ MCP_TRANSPORT_MODE=http
228
203
 
229
- # Development with auto-reload
230
- npm run dev
204
+ # Server port for HTTP mode
205
+ MCP_PORT=3000
231
206
 
232
- # Run MCP Inspector for debugging
233
- npm run inspector
207
+ # Host binding for HTTP mode
208
+ MCP_HOST=0.0.0.0
234
209
 
235
- # Start production server
236
- npm start
210
+ # CORS origins (comma-separated)
211
+ MCP_CORS_ORIGINS=http://localhost:3000,https://myapp.com
237
212
  ```
238
213
 
239
214
  ## Docker Configuration
package/build/index.js CHANGED
@@ -15,17 +15,17 @@ const args = process.argv.slice(2);
15
15
  if (args.includes('--version') || args.includes('-v')) {
16
16
  try {
17
17
  const packageJson = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf-8'));
18
- console.log(`Flowbite MCP Server v${packageJson.version}`);
18
+ console.error(`Flowbite MCP Server v${packageJson.version}`);
19
19
  process.exit(0);
20
20
  }
21
21
  catch (error) {
22
- console.log('Flowbite MCP Server (version unknown)');
22
+ console.error('Flowbite MCP Server (version unknown)');
23
23
  process.exit(0);
24
24
  }
25
25
  }
26
26
  // Handle --help flag
27
27
  if (args.includes('--help') || args.includes('-h')) {
28
- console.log(`
28
+ console.error(`
29
29
  Flowbite MCP Server - AI-powered Flowbite component and theme generation
30
30
 
31
31
  Usage:
@@ -57,7 +57,7 @@ const modeIndex = args.indexOf('--mode');
57
57
  const portIndex = args.indexOf('--port');
58
58
  const TRANSPORT_MODE = modeIndex !== -1 ? args[modeIndex + 1] : process.env.MCP_TRANSPORT_MODE || 'stdio';
59
59
  const PORT = portIndex !== -1 ? parseInt(args[portIndex + 1]) : parseInt(process.env.MCP_PORT || '3000');
60
- console.log(`Initializing Flowbite MCP Server in ${TRANSPORT_MODE} mode${TRANSPORT_MODE === 'http' ? ` on port ${PORT}` : ''}`);
60
+ console.error(`Initializing Flowbite MCP Server in ${TRANSPORT_MODE} mode${TRANSPORT_MODE === 'http' ? ` on port ${PORT}` : ''}`);
61
61
  const COMPONENT_FILES = [
62
62
  {
63
63
  name: 'flowbite_accordion',
@@ -879,35 +879,19 @@ Look at the rendered image below and the node structure data to understand:
879
879
  - Component patterns that match Flowbite components
880
880
 
881
881
  ### Step 2: Use Flowbite MCP Resources
882
- Before writing code, fetch the relevant Flowbite component documentation using the MCP resources. Based on the design, you may need:
883
-
884
- **Common Components to Check:**
885
- - \`flowbite://components/buttons\` - For button styles
886
- - \`flowbite://components/card\` - For card layouts
887
- - \`flowbite://components/navbar\` - For navigation bars
888
- - \`flowbite://components/modal\` - For modal dialogs
889
- - \`flowbite://components/forms\` - For form layouts
890
- - \`flowbite://forms/input-field\` - For input fields
891
- - \`flowbite://components/avatar\` - For user avatars
892
- - \`flowbite://components/badge\` - For badges/tags
893
- - \`flowbite://components/tables\` - For data tables
894
- - \`flowbite://components/tabs\` - For tab navigation
895
- - \`flowbite://components/dropdowns\` - For dropdown menus
896
- - \`flowbite://components/sidebar\` - For sidebar navigation
897
- - \`flowbite://components/footer\` - For footer sections
898
- - \`flowbite://typography/headings\` - For heading styles
899
- - \`flowbite://typography/text\` - For text styles
882
+ Before writing code, fetch the relevant Flowbite component documentation using the MCP resources.
900
883
 
901
884
  ### Step 3: Write the Code
902
885
  Generate clean, semantic HTML with Tailwind CSS classes following these guidelines:
903
886
 
904
887
  1. **Use Flowbite Components**: Match the Figma design to Flowbite components whenever possible
905
- 2. **Tailwind CSS Classes**: Use Tailwind utility classes for styling
906
- 3. **Responsive Design**: Include responsive breakpoints (sm:, md:, lg:, xl:)
907
- 4. **Semantic HTML**: Use proper HTML5 semantic elements
908
- 5. **Accessibility**: Include ARIA attributes and proper alt texts
909
- 6. **Match Colors**: Use Flowbite variables and secondly Tailwind color classes that best match the Figma design colors
910
- 7. **Match Spacing**: Use Tailwind spacing utilities (p-*, m-*, gap-*) to match the design
888
+ 2. **Flowbite variables** - Use Flowbite variable utility classes when possible (e.g. text-brand, rounded-base, etc.)
889
+ 3. **Tailwind CSS Classes**: Use Tailwind utility classes for styling
890
+ 4. **Responsive Design**: Include responsive breakpoints (sm:, md:, lg:, xl:)
891
+ 5. **Semantic HTML**: Use proper HTML5 semantic elements
892
+ 6. **Accessibility**: Include ARIA attributes and proper alt texts
893
+ 7. **Match Colors**: Use Flowbite variables and secondly Tailwind color classes that best match the Figma design colors
894
+ 8. **Match Spacing**: Use Tailwind spacing utilities (p-*, m-*, gap-*) to match the design
911
895
 
912
896
  ### Step 4: Output Format - IMPORTANT
913
897
 
@@ -1281,7 +1265,7 @@ Example usage:
1281
1265
  // Start server based on transport mode
1282
1266
  if (TRANSPORT_MODE === 'stdio') {
1283
1267
  // Standard I/O mode for local development and CLI integrations
1284
- console.log('Starting Flowbite MCP Server in stdio mode...');
1268
+ console.error('Starting Flowbite MCP Server in stdio mode...');
1285
1269
  const server = new McpServer({
1286
1270
  name: "flowbite-mcp",
1287
1271
  version: "1.0.0",
@@ -1297,19 +1281,19 @@ if (TRANSPORT_MODE === 'stdio') {
1297
1281
  console.error('Failed to connect stdio transport:', error);
1298
1282
  process.exit(1);
1299
1283
  });
1300
- console.log('Flowbite MCP Server running in stdio mode');
1301
- console.log('Ready to accept requests via standard I/O');
1284
+ console.error('Flowbite MCP Server running in stdio mode');
1285
+ console.error('Ready to accept requests via standard I/O');
1302
1286
  }
1303
1287
  else if (TRANSPORT_MODE === 'http') {
1304
1288
  // HTTP Streamable mode for server/production deployments
1305
- console.log(`Starting Flowbite MCP Server in HTTP mode on port ${PORT}...`);
1289
+ console.error(`Starting Flowbite MCP Server in HTTP mode on port ${PORT}...`);
1306
1290
  ExpressHttpStreamableMcpServer({
1307
1291
  name: "flowbite-mcp",
1308
1292
  }, setupServer);
1309
- console.log(`Flowbite MCP Server running in HTTP mode`);
1310
- console.log(`Server listening on http://localhost:${PORT}`);
1311
- console.log(`Health check: http://localhost:${PORT}/health`);
1312
- console.log(`MCP endpoint: http://localhost:${PORT}/mcp`);
1293
+ console.error(`Flowbite MCP Server running in HTTP mode`);
1294
+ console.error(`Server listening on http://localhost:${PORT}`);
1295
+ console.error(`Health check: http://localhost:${PORT}/health`);
1296
+ console.error(`MCP endpoint: http://localhost:${PORT}/mcp`);
1313
1297
  }
1314
1298
  else {
1315
1299
  console.error(`Invalid transport mode: ${TRANSPORT_MODE}`);
@@ -1,17 +1,3 @@
1
- ---
2
- layout: docs
3
- title: Tailwind CSS Accordion - Flowbite
4
- description: Use the accordion component to show hidden information based on the collapse and expand state of the child elements using data attribute options
5
- group: components
6
- toc: true
7
- requires_js: true
8
-
9
- previous: RTL (Right-To-Left)
10
- previousLink: customize/rtl/
11
- next: Alerts
12
- nextLink: components/alerts/
13
- ---
14
-
15
1
  The accordion component is a collection of vertically collapsing header and body elements that can be used to show and hide information based on the Tailwind CSS utility classes and JavaScript from Flowbite.
16
2
 
17
3
  A popular use case would be the "Frequently Asked Questions" section of a website or page when you can show questions and answers for each child element.
@@ -27,7 +13,7 @@ Don't forget to set the `data-accordion-target="{selector}"` data attribute to t
27
13
 
28
14
  Use the `data-accordion="collapse"` to collapse every other child element when expanding a single one.
29
15
 
30
- {{< example github="components/accordion.md" show_dark=true >}}
16
+ ```html
31
17
  <div id="accordion-collapse" data-accordion="collapse" class="rounded-base border border-default overflow-hidden shadow-xs">
32
18
  <h2 id="accordion-collapse-heading-1">
33
19
  <button type="button" class="flex items-center justify-between w-full p-5 font-medium rtl:text-right text-body rounded-t-base border border-t-0 border-x-0 border-b-default hover:text-heading hover:bg-neutral-secondary-medium gap-3" data-accordion-target="#accordion-collapse-body-1" aria-expanded="true" aria-controls="accordion-collapse-body-1">
@@ -50,7 +36,7 @@ Use the `data-accordion="collapse"` to collapse every other child element when e
50
36
  <div id="accordion-collapse-body-2" class="hidden border border-s-0 border-e-0 border-t-0 border-b-default" aria-labelledby="accordion-collapse-heading-2">
51
37
  <div class="p-4 md:p-5">
52
38
  <p class="mb-2 text-body">Flowbite is first conceptualized and designed using the Figma software so everything you see in the library has a design equivalent in our Figma file.</p>
53
- <p class="text-body">Check out the <a href="{{< param homepage >}}/figma/" class="text-fg-brand hover:underline">Figma design system</a> based on the utility classes from Tailwind CSS and components from Flowbite.</p>
39
+ <p class="text-body">Check out the <a href="https://flowbite.com/figma/" class="text-fg-brand hover:underline">Figma design system</a> based on the utility classes from Tailwind CSS and components from Flowbite.</p>
54
40
  </div>
55
41
  </div>
56
42
  <h2 id="accordion-collapse-heading-3">
@@ -65,19 +51,19 @@ Use the `data-accordion="collapse"` to collapse every other child element when e
65
51
  <p class="mb-2 text-body">However, we actually recommend using both Flowbite, Flowbite Pro, and even Tailwind UI as there is no technical reason stopping you from using the best of two worlds.</p>
66
52
  <p class="mb-2 text-body">Learn more about these technologies:</p>
67
53
  <ul class="ps-5 text-body list-disc">
68
- <li><a href="{{< param homepage >}}/pro/" class="text-fg-brand hover:underline">Flowbite Pro</a></li>
54
+ <li><a href="https://flowbite.com/pro/" class="text-fg-brand hover:underline">Flowbite Pro</a></li>
69
55
  <li><a href="https://tailwindui.com/" rel="nofollow" class="text-fg-brand hover:underline">Tailwind UI</a></li>
70
56
  </ul>
71
57
  </div>
72
58
  </div>
73
59
  </div>
74
- {{< /example >}}
60
+ ```
75
61
 
76
62
  ## Separated cards
77
63
 
78
64
  Use this example of an accordion with space delimitation between the accordion items.
79
65
 
80
- {{< example github="components/accordion.md" show_dark=true >}}
66
+ ```html
81
67
  <div id="accordion-card" data-accordion="collapse">
82
68
  <h2 id="accordion-card-heading-1">
83
69
  <button type="button" class="flex items-center justify-between w-full p-5 font-medium rtl:text-right text-body rounded-base shadow-xs border border-default hover:text-heading hover:bg-neutral-secondary-medium gap-3 [&[aria-expanded='true']]:rounded-b-none [&[aria-expanded='true']]:shadow-none" data-accordion-target="#accordion-card-body-1" aria-expanded="true" aria-controls="accordion-card-body-1">
@@ -100,7 +86,7 @@ Use this example of an accordion with space delimitation between the accordion i
100
86
  <div id="accordion-card-body-2" class="hidden border border-t-0 border-default rounded-b-base shadow-xs" aria-labelledby="accordion-card-heading-2">
101
87
  <div class="p-4 md:p-5">
102
88
  <p class="mb-2 text-body">Flowbite is first conceptualized and designed using the Figma software so everything you see in the library has a design equivalent in our Figma file.</p>
103
- <p class="text-body">Check out the <a href="{{< param homepage >}}/figma/" class="text-fg-brand hover:underline">Figma design system</a> based on the utility classes from Tailwind CSS and components from Flowbite.</p>
89
+ <p class="text-body">Check out the <a href="https://flowbite.com/figma/" class="text-fg-brand hover:underline">Figma design system</a> based on the utility classes from Tailwind CSS and components from Flowbite.</p>
104
90
  </div>
105
91
  </div>
106
92
  <h2 id="accordion-card-heading-3" class="mt-4">
@@ -115,19 +101,19 @@ Use this example of an accordion with space delimitation between the accordion i
115
101
  <p class="mb-2 text-body">However, we actually recommend using both Flowbite, Flowbite Pro, and even Tailwind UI as there is no technical reason stopping you from using the best of two worlds.</p>
116
102
  <p class="mb-2 text-body">Learn more about these technologies:</p>
117
103
  <ul class="ps-5 text-body list-disc">
118
- <li><a href="{{< param homepage >}}/pro/" class="text-fg-brand hover:underline">Flowbite Pro</a></li>
104
+ <li><a href="https://flowbite.com/pro/" class="text-fg-brand hover:underline">Flowbite Pro</a></li>
119
105
  <li><a href="https://tailwindui.com/" rel="nofollow" class="text-fg-brand hover:underline">Tailwind UI</a></li>
120
106
  </ul>
121
107
  </div>
122
108
  </div>
123
109
  </div>
124
- {{< /example >}}
110
+ ```
125
111
 
126
112
  ## Always open
127
113
 
128
114
  Use the `data-accordion="open"` option to keep previously opened accordion elements unchanged.
129
115
 
130
- {{< example github="components/accordion.md" show_dark=true >}}
116
+ ```html
131
117
  <div id="accordion-open" data-accordion="open" class="rounded-base border border-default overflow-hidden shadow-xs">
132
118
  <h2 id="accordion-open-heading-1">
133
119
  <button type="button" class="flex items-center justify-between w-full p-5 font-medium rtl:text-right text-body rounded-t-base border border-t-0 border-x-0 border-b-default hover:text-heading hover:bg-neutral-secondary-medium gap-3" data-accordion-target="#accordion-open-body-1" aria-expanded="true" aria-controls="accordion-open-body-1">
@@ -150,7 +136,7 @@ Use the `data-accordion="open"` option to keep previously opened accordion eleme
150
136
  <div id="accordion-open-body-2" class="hidden border border-s-0 border-e-0 border-t-0 border-b-default" aria-labelledby="accordion-open-heading-2">
151
137
  <div class="p-4 md:p-5">
152
138
  <p class="mb-2 text-body">Flowbite is first conceptualized and designed using the Figma software so everything you see in the library has a design equivalent in our Figma file.</p>
153
- <p class="text-body">Check out the <a href="{{< param homepage >}}/figma/" class="text-fg-brand hover:underline">Figma design system</a> based on the utility classes from Tailwind CSS and components from Flowbite.</p>
139
+ <p class="text-body">Check out the <a href="https://flowbite.com/figma/" class="text-fg-brand hover:underline">Figma design system</a> based on the utility classes from Tailwind CSS and components from Flowbite.</p>
154
140
  </div>
155
141
  </div>
156
142
  <h2 id="accordion-open-heading-3">
@@ -165,13 +151,13 @@ Use the `data-accordion="open"` option to keep previously opened accordion eleme
165
151
  <p class="mb-2 text-body">However, we actually recommend using both Flowbite, Flowbite Pro, and even Tailwind UI as there is no technical reason stopping you from using the best of two worlds.</p>
166
152
  <p class="mb-2 text-body">Learn more about these technologies:</p>
167
153
  <ul class="ps-5 text-body list-disc">
168
- <li><a href="{{< param homepage >}}/pro/" class="text-fg-brand hover:underline">Flowbite Pro</a></li>
154
+ <li><a href="https://flowbite.com/pro/" class="text-fg-brand hover:underline">Flowbite Pro</a></li>
169
155
  <li><a href="https://tailwindui.com/" rel="nofollow" class="text-fg-brand hover:underline">Tailwind UI</a></li>
170
156
  </ul>
171
157
  </div>
172
158
  </div>
173
159
  </div>
174
- {{< /example >}}
160
+ ```
175
161
 
176
162
  ## Color options
177
163
 
@@ -179,7 +165,7 @@ Use the `data-active-classes` and `data-inactive-classes` to set the active and
179
165
 
180
166
  Here's an example where we apply the blue colors instead of gray:
181
167
 
182
- {{< example github="components/accordion.md" show_dark=true >}}
168
+ ```html
183
169
  <div id="accordion-color" data-accordion="collapse" class="rounded-base border border-default overflow-hidden shadow-xs">
184
170
  <h2 id="accordion-color-heading-1">
185
171
  <button type="button" class="flex items-center justify-between w-full p-5 font-medium rtl:text-right text-body rounded-t-base border border-t-0 border-x-0 border-b-default hover:text-fg-brand hover:bg-brand-softer gap-3" data-accordion-target="#accordion-color-body-1" aria-expanded="true" aria-controls="accordion-color-body-1">
@@ -202,7 +188,7 @@ Here's an example where we apply the blue colors instead of gray:
202
188
  <div id="accordion-color-body-2" class="hidden border border-s-0 border-e-0 border-t-0 border-b-default" aria-labelledby="accordion-color-heading-2">
203
189
  <div class="p-4 md:p-5">
204
190
  <p class="mb-2 text-body">Flowbite is first conceptualized and designed using the Figma software so everything you see in the library has a design equivalent in our Figma file.</p>
205
- <p class="text-body">Check out the <a href="{{< param homepage >}}/figma/" class="text-fg-brand hover:underline">Figma design system</a> based on the utility classes from Tailwind CSS and components from Flowbite.</p>
191
+ <p class="text-body">Check out the <a href="https://flowbite.com/figma/" class="text-fg-brand hover:underline">Figma design system</a> based on the utility classes from Tailwind CSS and components from Flowbite.</p>
206
192
  </div>
207
193
  </div>
208
194
  <h2 id="accordion-color-heading-3">
@@ -217,19 +203,19 @@ Here's an example where we apply the blue colors instead of gray:
217
203
  <p class="mb-2 text-body">However, we actually recommend using both Flowbite, Flowbite Pro, and even Tailwind UI as there is no technical reason stopping you from using the best of two worlds.</p>
218
204
  <p class="mb-2 text-body">Learn more about these technologies:</p>
219
205
  <ul class="ps-5 text-body list-disc">
220
- <li><a href="{{< param homepage >}}/pro/" class="text-fg-brand hover:underline">Flowbite Pro</a></li>
206
+ <li><a href="https://flowbite.com/pro/" class="text-fg-brand hover:underline">Flowbite Pro</a></li>
221
207
  <li><a href="https://tailwindui.com/" rel="nofollow" class="text-fg-brand hover:underline">Tailwind UI</a></li>
222
208
  </ul>
223
209
  </div>
224
210
  </div>
225
211
  </div>
226
- {{< /example >}}
212
+ ```
227
213
 
228
214
  ## Flush accordion
229
215
 
230
216
  Use this example to remove the background color and rounded borders from the accordion component.
231
217
 
232
- {{< example github="components/accordion.md" show_dark=true >}}
218
+ ```html
233
219
  <div id="accordion-flush" data-accordion="collapse" data-active-classes="bg-neutral-primary text-heading" data-inactive-classes="text-body">
234
220
  <h2 id="accordion-flush-heading-1">
235
221
  <button type="button" class="flex items-center justify-between w-full py-5 font-medium rtl:text-right text-body border-b border-default gap-3" data-accordion-target="#accordion-flush-body-1" aria-expanded="true" aria-controls="accordion-flush-body-1">
@@ -252,7 +238,7 @@ Use this example to remove the background color and rounded borders from the acc
252
238
  <div id="accordion-flush-body-2" class="hidden" aria-labelledby="accordion-flush-heading-2">
253
239
  <div class="py-5 border-b border-default text-body">
254
240
  <p class="mb-2">Flowbite is first conceptualized and designed using the Figma software so everything you see in the library has a design equivalent in our Figma file.</p>
255
- <p>Check out the <a href="{{< param homepage >}}/figma/" class="text-fg-brand hover:underline">Figma design system</a> based on the utility classes from Tailwind CSS and components from Flowbite.</p>
241
+ <p>Check out the <a href="https://flowbite.com/figma/" class="text-fg-brand hover:underline">Figma design system</a> based on the utility classes from Tailwind CSS and components from Flowbite.</p>
256
242
  </div>
257
243
  </div>
258
244
  <h2 id="accordion-flush-heading-3">
@@ -267,19 +253,19 @@ Use this example to remove the background color and rounded borders from the acc
267
253
  <p class="mb-2">However, we actually recommend using both Flowbite, Flowbite Pro, and even Tailwind UI as there is no technical reason stopping you from using the best of two worlds.</p>
268
254
  <p class="mb-2">Learn more about these technologies:</p>
269
255
  <ul class="ps-5 list-disc">
270
- <li><a href="{{< param homepage >}}/pro/" class="text-fg-brand hover:underline">Flowbite Pro</a></li>
256
+ <li><a href="https://flowbite.com/pro/" class="text-fg-brand hover:underline">Flowbite Pro</a></li>
271
257
  <li><a href="https://tailwindui.com/" rel="nofollow" class="text-fg-brand hover:underline">Tailwind UI</a></li>
272
258
  </ul>
273
259
  </div>
274
260
  </div>
275
261
  </div>
276
- {{< /example >}}
262
+ ```
277
263
 
278
264
  ## Arrow style
279
265
 
280
266
  Use the `data-accordion-icon` data attribute to optionally set an element to rotate 180 degrees when the accordion element is expanded. If the data attribute is not set, then it will not rotate.
281
267
 
282
- {{< example github="components/accordion.md" show_dark=true >}}
268
+ ```html
283
269
  <div id="accordion-arrow" data-accordion="collapse" data-active-classes="bg-neutral-primary text-heading" data-inactive-classes="text-body">
284
270
  <h2 id="accordion-arrow-heading-1">
285
271
  <button type="button" class="flex items-center justify-between w-full py-5 font-medium rtl:text-right text-body border-b border-default gap-3" data-accordion-target="#accordion-arrow-body-1" aria-expanded="true" aria-controls="accordion-arrow-body-1">
@@ -303,7 +289,7 @@ Use the `data-accordion-icon` data attribute to optionally set an element to rot
303
289
  <div id="accordion-arrow-body-2" class="hidden" aria-labelledby="accordion-arrow-heading-2">
304
290
  <div class="py-5 border-b border-default text-body">
305
291
  <p class="mb-2">Flowbite is first conceptualized and designed using the Figma software so everything you see in the library has a design equivalent in our Figma file.</p>
306
- <p>Check out the <a href="{{< param homepage >}}/figma/" class="text-fg-brand hover:underline">Figma design system</a> based on the utility classes from Tailwind CSS and components from Flowbite.</p>
292
+ <p>Check out the <a href="https://flowbite.com/figma/" class="text-fg-brand hover:underline">Figma design system</a> based on the utility classes from Tailwind CSS and components from Flowbite.</p>
307
293
  </div>
308
294
  </div>
309
295
  <h2 id="accordion-arrow-heading-3">
@@ -318,13 +304,13 @@ Use the `data-accordion-icon` data attribute to optionally set an element to rot
318
304
  <p class="mb-2">However, we actually recommend using both Flowbite, Flowbite Pro, and even Tailwind UI as there is no technical reason stopping you from using the best of two worlds.</p>
319
305
  <p class="mb-2">Learn more about these technologies:</p>
320
306
  <ul class="ps-5 list-disc">
321
- <li><a href="{{< param homepage >}}/pro/" class="text-fg-brand hover:underline">Flowbite Pro</a></li>
307
+ <li><a href="https://flowbite.com/pro/" class="text-fg-brand hover:underline">Flowbite Pro</a></li>
322
308
  <li><a href="https://tailwindui.com/" rel="nofollow" class="text-fg-brand hover:underline">Tailwind UI</a></li>
323
309
  </ul>
324
310
  </div>
325
311
  </div>
326
312
  </div>
327
- {{< /example >}}
313
+ ```
328
314
 
329
315
  ## Nesting accordions
330
316
 
@@ -332,7 +318,7 @@ Accordions can be nested. All of the mentioned options are supported.
332
318
 
333
319
  To enable nested accordions you need to wrap the nested accordion in an element with the `data-accordion` attribute and don't accidentally initialize an accordion with nested accordions' items (e.g. by using `$accordionBodyEl.querySelectorAll`), when using <a href="#javascript-behaviour">custom JavaScript</a>.
334
320
 
335
- {{< example github="components/accordion.md" show_dark=true >}}
321
+ ```html
336
322
 
337
323
  <div id="accordion-collapse-2" data-accordion="collapse" class="rounded-base border border-default overflow-hidden shadow-xs">
338
324
  <h2 id="accordion-collapse-heading-6">
@@ -408,7 +394,7 @@ To enable nested accordions you need to wrap the nested accordion in an element
408
394
  </div>
409
395
  </div>
410
396
  </div>
411
- {{< /example >}}
397
+ ```
412
398
 
413
399
  ## JavaScript behaviour
414
400
 
@@ -653,7 +639,7 @@ To get started you need to create an array of accordion item objects including a
653
639
 
654
640
  Additionally, you can also set some options to change the default behaviour of the accordion, customize the styles, and set callback functions.
655
641
 
656
- {{< code lang="javascript" file="accordion.js" icon="file" >}}
642
+ ```javascript
657
643
  const accordionElement = document.getElementById('accordion-example');
658
644
 
659
645
  // create an array of objects with the id, trigger element (eg. button), and the content element
@@ -702,11 +688,11 @@ const instanceOptions = {
702
688
  id: 'accordion-example',
703
689
  override: true
704
690
  };
705
- {{< /code >}}
691
+ ```
706
692
 
707
693
  Create a new Accordion object using the options set above as the parameters.
708
694
 
709
- {{< code lang="javascript" file="accordion.js" icon="file" >}}
695
+ ```javascript
710
696
  import { Accordion } from 'flowbite';
711
697
 
712
698
  /*
@@ -716,11 +702,11 @@ import { Accordion } from 'flowbite';
716
702
  * instanceOptions (optional)
717
703
  */
718
704
  const accordion = new Accordion(accordionElement, accordionItems, options, instanceOptions);
719
- {{< /code >}}
705
+ ```
720
706
 
721
707
  Now you can access the object methods to programmatically open, close, and toggle the accordion items based on the unique identifier.
722
708
 
723
- {{< code lang="javascript" file="accordion.js" icon="file" >}}
709
+ ```javascript
724
710
  // open accordion item based on id
725
711
  accordion.open('accordion-example-heading-2');
726
712
 
@@ -729,13 +715,13 @@ accordion.close('accordion-example-heading-2');
729
715
 
730
716
  // toggle visibility of item based on id
731
717
  accordion.toggle('accordion-example-heading-3');
732
- {{< /code >}}
718
+ ```
733
719
 
734
720
  ### HTML Markup
735
721
 
736
722
  Use the following HTML markup example for the JavaScript script above.
737
723
 
738
- {{< code lang="html" file="accordion.html" icon="file" >}}
724
+ ```html
739
725
  <div id="accordion-example">
740
726
  <h2 id="accordion-example-heading-1">
741
727
  <button type="button" class="flex items-center justify-between w-full p-5 font-medium rtl:text-right text-body border border-b-0 border-default rounded-t-xl focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-800 dark:border-gray-700 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800" aria-expanded="true" aria-controls="accordion-example-body-1">
@@ -758,7 +744,7 @@ Use the following HTML markup example for the JavaScript script above.
758
744
  <div id="accordion-example-body-2" class="hidden" aria-labelledby="accordion-example-heading-2">
759
745
  <div class="p-5 border border-b-0 border-default dark:border-gray-700">
760
746
  <p class="mb-2 text-body">Flowbite is first conceptualized and designed using the Figma software so everything you see in the library has a design equivalent in our Figma file.</p>
761
- <p class="text-body">Check out the <a href="{{< param homepage >}}/figma/" class="text-fg-brand hover:underline">Figma design system</a> based on the utility classes from Tailwind CSS and components from Flowbite.</p>
747
+ <p class="text-body">Check out the <a href="https://flowbite.com/figma/" class="text-fg-brand hover:underline">Figma design system</a> based on the utility classes from Tailwind CSS and components from Flowbite.</p>
762
748
  </div>
763
749
  </div>
764
750
  <h2 id="accordion-example-heading-3">
@@ -773,21 +759,21 @@ Use the following HTML markup example for the JavaScript script above.
773
759
  <p class="mb-2 text-body">However, we actually recommend using both Flowbite, Flowbite Pro, and even Tailwind UI as there is no technical reason stopping you from using the best of two worlds.</p>
774
760
  <p class="mb-2 text-body">Learn more about these technologies:</p>
775
761
  <ul class="ps-5 text-body list-disc dark:text-gray-400">
776
- <li><a href="{{< param homepage >}}/pro/" class="text-fg-brand hover:underline">Flowbite Pro</a></li>
762
+ <li><a href="https://flowbite.com/pro/" class="text-fg-brand hover:underline">Flowbite Pro</a></li>
777
763
  <li><a href="https://tailwindui.com/" rel="nofollow" class="text-fg-brand hover:underline">Tailwind UI</a></li>
778
764
  </ul>
779
765
  </div>
780
766
  </div>
781
767
  </div>
782
- {{< /code >}}
768
+ ```
783
769
 
784
770
  ### TypeScript
785
771
 
786
- If you're using the <a href="{{< ref "getting-started/typescript" >}}">TypeScript configuration</a> from Flowbite then you can import the types for the Accordion object, parameters and its options.
772
+ If you're using the TypeScript configuration from Flowbite then you can import the types for the Accordion object, parameters and its options.
787
773
 
788
774
  Here's an example that applies the types from Flowbite to the code above:
789
775
 
790
- {{< code lang="typescript" file="accordion.ts" icon="file" >}}
776
+ ```typescript
791
777
  import { Accordion } from "flowbite";
792
778
  import type { AccordionOptions, AccordionItem, AccordionInterface } from "flowbite";
793
779
  import type { InstanceOptions } from 'flowbite';
@@ -857,4 +843,4 @@ accordion.destroy();
857
843
 
858
844
  // re-initialize accordion
859
845
  accordion.init();
860
- {{< /code >}}
846
+ ```