viho 0.0.9 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/viho-ask.js +3 -8
- package/bin/viho-chat.js +3 -10
- package/bin/viho-expert.js +78 -0
- package/bin/viho.js +1 -0
- package/package.json +3 -2
- package/src/experts/antd.md +23127 -0
- package/src/experts/daisyui.md +2228 -0
- package/src/experts/experts.js +10 -0
- package/src/llm.js +25 -2
- package/src/util.js +24 -0
|
@@ -0,0 +1,2228 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: daisyUI 5
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
applyTo: '**'
|
|
5
|
+
downloadedFrom: https://daisyui.com/llms.txt
|
|
6
|
+
version: 5.5.x
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# daisyUI 5
|
|
10
|
+
|
|
11
|
+
daisyUI 5 is a CSS library for Tailwind CSS 4
|
|
12
|
+
daisyUI 5 provides class names for common UI components
|
|
13
|
+
|
|
14
|
+
- [daisyUI 5 docs](http://daisyui.com)
|
|
15
|
+
- [Guide: How to use this file in LLMs and code editors](https://daisyui.com/docs/editor/)
|
|
16
|
+
- [daisyUI 5 release notes](https://daisyui.com/docs/v5/)
|
|
17
|
+
- [daisyUI 4 to 5 upgrade guide](https://daisyui.com/docs/upgrade/)
|
|
18
|
+
|
|
19
|
+
## daisyUI 5 install notes
|
|
20
|
+
|
|
21
|
+
[install guide](https://daisyui.com/docs/install/)
|
|
22
|
+
|
|
23
|
+
1. daisyUI 5 requires Tailwind CSS 4
|
|
24
|
+
2. `tailwind.config.js` file is deprecated in Tailwind CSS v4. do not use `tailwind.config.js`. Tailwind CSS v4 only needs `@import "tailwindcss";` in the CSS file if it's a node dependency.
|
|
25
|
+
3. daisyUI 5 can be installed using `npm i -D daisyui@latest` and then adding `@plugin "daisyui";` to the CSS file
|
|
26
|
+
4. daisyUI is suggested to be installed as a dependency but if you really want to use it from CDN, you can use Tailwind CSS and daisyUI CDN files:
|
|
27
|
+
|
|
28
|
+
```html
|
|
29
|
+
<link href="https://cdn.jsdelivr.net/npm/daisyui@5" rel="stylesheet" type="text/css" />
|
|
30
|
+
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
5. A CSS file with Tailwind CSS and daisyUI looks like this (if it's a node dependency)
|
|
34
|
+
|
|
35
|
+
```css
|
|
36
|
+
@import 'tailwindcss';
|
|
37
|
+
@plugin "daisyui";
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## daisyUI 5 usage rules
|
|
41
|
+
|
|
42
|
+
1. We can give styles to a HTML element by adding daisyUI class names to it. By adding a component class name, part class names (if there's any available for that component), and modifier class names (if there's any available for that component)
|
|
43
|
+
2. Components can be customized using Tailwind CSS utility classes if the customization is not possible using the existing daisyUI classes. For example `btn px-10` sets a custom horizontal padding to a `btn`
|
|
44
|
+
3. If customization of daisyUI styles using Tailwind CSS utility classes didn't work because of CSS specificity issues, you can use the `!` at the end of the Tailwind CSS utility class to override the existing styles. For example `btn bg-red-500!` sets a custom background color to a `btn` forcefully. This is a last resort solution and should be used sparingly
|
|
45
|
+
4. If a specific component or something similar to it doesn't exist in daisyUI, you can create your own component using Tailwind CSS utility
|
|
46
|
+
5. when using Tailwind CSS `flex` and `grid` for layout, it should be responsive using Tailwind CSS responsive utility prefixes.
|
|
47
|
+
6. Only allowed class names are existing daisyUI class names or Tailwind CSS utility classes.
|
|
48
|
+
7. Ideally, you won't need to write any custom CSS. Using daisyUI class names or Tailwind CSS utility classes is preferred.
|
|
49
|
+
8. suggested - if you need placeholder images, use https://picsum.photos/200/300 with the size you want
|
|
50
|
+
9. suggested - when designing , don't add a custom font unless it's necessary
|
|
51
|
+
10. don't add `bg-base-100 text-base-content` to body unless it's necessary
|
|
52
|
+
11. For design decisions, use Refactoring UI book best practices
|
|
53
|
+
|
|
54
|
+
daisyUI 5 class names are one of the following categories. These type names are only for reference and are not used in the actual code
|
|
55
|
+
|
|
56
|
+
- `component`: the required component class
|
|
57
|
+
- `part`: a child part of a component
|
|
58
|
+
- `style`: sets a specific style to component or part
|
|
59
|
+
- `behavior`: changes the behavior of component or part
|
|
60
|
+
- `color`: sets a specific color to component or part
|
|
61
|
+
- `size`: sets a specific size to component or part
|
|
62
|
+
- `placement`: sets a specific placement to component or part
|
|
63
|
+
- `direction`: sets a specific direction to component or part
|
|
64
|
+
- `modifier`: modifies the component or part in a specific way
|
|
65
|
+
- `variant`: prefixes for utility classes that conditionally apply styles. syntax is `variant:utility-class`
|
|
66
|
+
|
|
67
|
+
## Config
|
|
68
|
+
|
|
69
|
+
daisyUI 5 config docs: https://daisyui.com/docs/config/
|
|
70
|
+
daisyUI without config:
|
|
71
|
+
|
|
72
|
+
```css
|
|
73
|
+
@plugin "daisyui";
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
daisyUI config with `light` theme only:
|
|
77
|
+
|
|
78
|
+
```css
|
|
79
|
+
@plugin "daisyui" {
|
|
80
|
+
themes: light --default;
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
daisyUI with all the default configs:
|
|
85
|
+
|
|
86
|
+
```css
|
|
87
|
+
@plugin "daisyui" {
|
|
88
|
+
themes:
|
|
89
|
+
light --default,
|
|
90
|
+
dark --prefersdark;
|
|
91
|
+
root: ':root';
|
|
92
|
+
include:;
|
|
93
|
+
exclude:;
|
|
94
|
+
prefix:;
|
|
95
|
+
logs: true;
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
An example config:
|
|
100
|
+
In below config, all the built-in themes are enabled while bumblebee is the default theme and synthwave is the prefersdark theme (default dark mode)
|
|
101
|
+
All the other themes are enabled and can be used by adding `data-theme="THEME_NAME"` to the `<html>` element
|
|
102
|
+
root scrollbar gutter is excluded. `daisy-` prefix is used for all daisyUI classes and console.log is disabled
|
|
103
|
+
|
|
104
|
+
```css
|
|
105
|
+
@plugin "daisyui" {
|
|
106
|
+
themes:
|
|
107
|
+
light,
|
|
108
|
+
dark,
|
|
109
|
+
cupcake,
|
|
110
|
+
bumblebee --default,
|
|
111
|
+
emerald,
|
|
112
|
+
corporate,
|
|
113
|
+
synthwave --prefersdark,
|
|
114
|
+
retro,
|
|
115
|
+
cyberpunk,
|
|
116
|
+
valentine,
|
|
117
|
+
halloween,
|
|
118
|
+
garden,
|
|
119
|
+
forest,
|
|
120
|
+
aqua,
|
|
121
|
+
lofi,
|
|
122
|
+
pastel,
|
|
123
|
+
fantasy,
|
|
124
|
+
wireframe,
|
|
125
|
+
black,
|
|
126
|
+
luxury,
|
|
127
|
+
dracula,
|
|
128
|
+
cmyk,
|
|
129
|
+
autumn,
|
|
130
|
+
business,
|
|
131
|
+
acid,
|
|
132
|
+
lemonade,
|
|
133
|
+
night,
|
|
134
|
+
coffee,
|
|
135
|
+
winter,
|
|
136
|
+
dim,
|
|
137
|
+
nord,
|
|
138
|
+
sunset,
|
|
139
|
+
caramellatte,
|
|
140
|
+
abyss,
|
|
141
|
+
silk;
|
|
142
|
+
root: ':root';
|
|
143
|
+
include:;
|
|
144
|
+
exclude: rootscrollgutter, checkbox;
|
|
145
|
+
prefix: daisy-;
|
|
146
|
+
logs: false;
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## daisyUI 5 colors
|
|
151
|
+
|
|
152
|
+
### daisyUI color names
|
|
153
|
+
|
|
154
|
+
- `primary`: Primary brand color, The main color of your brand
|
|
155
|
+
- `primary-content`: Foreground content color to use on primary color
|
|
156
|
+
- `secondary`: Secondary brand color, The optional, secondary color of your brand
|
|
157
|
+
- `secondary-content`: Foreground content color to use on secondary color
|
|
158
|
+
- `accent`: Accent brand color, The optional, accent color of your brand
|
|
159
|
+
- `accent-content`: Foreground content color to use on accent color
|
|
160
|
+
- `neutral`: Neutral dark color, For not-saturated parts of UI
|
|
161
|
+
- `neutral-content`: Foreground content color to use on neutral color
|
|
162
|
+
- `base-100`:-100 Base surface color of page, used for blank backgrounds
|
|
163
|
+
- `base-200`:-200 Base color, darker shade, to create elevations
|
|
164
|
+
- `base-300`:-300 Base color, even more darker shade, to create elevations
|
|
165
|
+
- `base-content`: Foreground content color to use on base color
|
|
166
|
+
- `info`: Info color, For informative/helpful messages
|
|
167
|
+
- `info-content`: Foreground content color to use on info color
|
|
168
|
+
- `success`: Success color, For success/safe messages
|
|
169
|
+
- `success-content`: Foreground content color to use on success color
|
|
170
|
+
- `warning`: Warning color, For warning/caution messages
|
|
171
|
+
- `warning-content`: Foreground content color to use on warning color
|
|
172
|
+
- `error`: Error color, For error/danger/destructive messages
|
|
173
|
+
- `error-content`: Foreground content color to use on error color
|
|
174
|
+
|
|
175
|
+
### daisyUI color rules
|
|
176
|
+
|
|
177
|
+
1. daisyUI adds semantic color names to Tailwind CSS colors
|
|
178
|
+
2. daisyUI color names can be used in utility classes, like other Tailwind CSS color names. for example, `bg-primary` will use the primary color for the background
|
|
179
|
+
3. daisyUI color names include variables as value so they can change based the theme
|
|
180
|
+
4. There's no need to use `dark:` for daisyUI color names
|
|
181
|
+
5. Ideally only daisyUI color names should be used for colors so the colors can change automatically based on the theme
|
|
182
|
+
6. If a Tailwind CSS color name (like `red-500`) is used, it will be same red color on all themes
|
|
183
|
+
7. If a daisyUI color name (like `primary`) is used, it will change color based on the theme
|
|
184
|
+
8. Using Tailwind CSS color names for text colors should be avoided because Tailwind CSS color `text-gray-800` on `bg-base-100` would be unreadable on a dark theme - because on dark theme, `bg-base-100` is a dark color
|
|
185
|
+
9. `*-content` colors should have a good contrast compared to their associated colors
|
|
186
|
+
10. suggestion - when designing a page use `base-*` colors for majority of the page. use `primary` color for important elements
|
|
187
|
+
|
|
188
|
+
### daisyUI custom theme with custom colors
|
|
189
|
+
|
|
190
|
+
A CSS file with Tailwind CSS, daisyUI and a custom daisyUI theme looks like this:
|
|
191
|
+
|
|
192
|
+
```css
|
|
193
|
+
@import 'tailwindcss';
|
|
194
|
+
@plugin "daisyui";
|
|
195
|
+
@plugin "daisyui/theme" {
|
|
196
|
+
name: 'mytheme';
|
|
197
|
+
default: true; /* set as default */
|
|
198
|
+
prefersdark: false; /* set as default dark mode (prefers-color-scheme:dark) */
|
|
199
|
+
color-scheme: light; /* color of browser-provided UI */
|
|
200
|
+
|
|
201
|
+
--color-base-100: oklch(98% 0.02 240);
|
|
202
|
+
--color-base-200: oklch(95% 0.03 240);
|
|
203
|
+
--color-base-300: oklch(92% 0.04 240);
|
|
204
|
+
--color-base-content: oklch(20% 0.05 240);
|
|
205
|
+
--color-primary: oklch(55% 0.3 240);
|
|
206
|
+
--color-primary-content: oklch(98% 0.01 240);
|
|
207
|
+
--color-secondary: oklch(70% 0.25 200);
|
|
208
|
+
--color-secondary-content: oklch(98% 0.01 200);
|
|
209
|
+
--color-accent: oklch(65% 0.25 160);
|
|
210
|
+
--color-accent-content: oklch(98% 0.01 160);
|
|
211
|
+
--color-neutral: oklch(50% 0.05 240);
|
|
212
|
+
--color-neutral-content: oklch(98% 0.01 240);
|
|
213
|
+
--color-info: oklch(70% 0.2 220);
|
|
214
|
+
--color-info-content: oklch(98% 0.01 220);
|
|
215
|
+
--color-success: oklch(65% 0.25 140);
|
|
216
|
+
--color-success-content: oklch(98% 0.01 140);
|
|
217
|
+
--color-warning: oklch(80% 0.25 80);
|
|
218
|
+
--color-warning-content: oklch(20% 0.05 80);
|
|
219
|
+
--color-error: oklch(65% 0.3 30);
|
|
220
|
+
--color-error-content: oklch(98% 0.01 30);
|
|
221
|
+
|
|
222
|
+
--radius-selector: 1rem; /* border radius of selectors (checkbox, toggle, badge) */
|
|
223
|
+
--radius-field: 0.25rem; /* border radius of fields (button, input, select, tab) */
|
|
224
|
+
--radius-box: 0.5rem; /* border radius of boxes (card, modal, alert) */
|
|
225
|
+
/* preferred values for --radius-* : 0rem, 0.25rem, 0.5rem, 1rem, 2rem */
|
|
226
|
+
|
|
227
|
+
--size-selector: 0.25rem; /* base size of selectors (checkbox, toggle, badge). Value must be 0.25rem unless we intentionally want bigger selectors. In so it can be 0.28125 or 0.3125. If we intentionally want smaller selectors, it can be 0.21875 or 0.1875 */
|
|
228
|
+
--size-field: 0.25rem; /* base size of fields (button, input, select, tab). Value must be 0.25rem unless we intentionally want bigger fields. In so it can be 0.28125 or 0.3125. If we intentionally want smaller fields, it can be 0.21875 or 0.1875 */
|
|
229
|
+
|
|
230
|
+
--border: 1px; /* border size. Value must be 1px unless we intentionally want thicker borders. In so it can be 1.5px or 2px. If we intentionally want thinner borders, it can be 0.5px */
|
|
231
|
+
|
|
232
|
+
--depth: 1; /* only 0 or 1 – Adds a shadow and subtle 3D depth effect to components */
|
|
233
|
+
--noise: 0; /* only 0 or 1 - Adds a subtle noise (grain) effect to components */
|
|
234
|
+
}
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
#### Rules
|
|
238
|
+
|
|
239
|
+
- All CSS variables above are required
|
|
240
|
+
- Colors can be OKLCH or hex or other formats
|
|
241
|
+
- If you're generating a custom theme, do not include the comments from the example above. Just provide the code.
|
|
242
|
+
|
|
243
|
+
People can use https://daisyui.com/theme-generator/ visual tool to create their own theme.
|
|
244
|
+
|
|
245
|
+
## daisyUI 5 components
|
|
246
|
+
|
|
247
|
+
### accordion
|
|
248
|
+
|
|
249
|
+
Accordion is used for showing and hiding content but only one item can stay open at a time
|
|
250
|
+
|
|
251
|
+
[accordion docs](https://daisyui.com/components/accordion/)
|
|
252
|
+
|
|
253
|
+
#### Class names
|
|
254
|
+
|
|
255
|
+
- component: `collapse`
|
|
256
|
+
- part: `collapse-title`, `collapse-content`
|
|
257
|
+
- modifier: `collapse-arrow`, `collapse-plus`, `collapse-open`, `collapse-close`
|
|
258
|
+
|
|
259
|
+
#### Syntax
|
|
260
|
+
|
|
261
|
+
```html
|
|
262
|
+
<div class="collapse {MODIFIER}">{CONTENT}</div>
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
where content is:
|
|
266
|
+
|
|
267
|
+
```html
|
|
268
|
+
<input type="radio" name="{name}" checked="{checked}" />
|
|
269
|
+
<div class="collapse-title">{title}</div>
|
|
270
|
+
<div class="collapse-content">{CONTENT}</div>
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
#### Rules
|
|
274
|
+
|
|
275
|
+
- {MODIFIER} is optional and can have one of the modifier class names
|
|
276
|
+
- Accordion uses radio inputs. All radio inputs with the same name work together and only one of them can be open at a time
|
|
277
|
+
- If you have more than one set of accordion items on a page, use different names for the radio inputs on each set
|
|
278
|
+
- Replace {name} with a unique name for the accordion group
|
|
279
|
+
- replace `{checked}` with `checked="checked"` if you want the accordion to be open by default
|
|
280
|
+
|
|
281
|
+
### alert
|
|
282
|
+
|
|
283
|
+
Alert informs users about important events
|
|
284
|
+
|
|
285
|
+
[alert docs](https://daisyui.com/components/alert/)
|
|
286
|
+
|
|
287
|
+
#### Class names
|
|
288
|
+
|
|
289
|
+
- component: `alert`
|
|
290
|
+
- style: `alert-outline`, `alert-dash`, `alert-soft`
|
|
291
|
+
- color: `alert-info`, `alert-success`, `alert-warning`, `alert-error`
|
|
292
|
+
- direction: `alert-vertical`, `alert-horizontal`
|
|
293
|
+
|
|
294
|
+
#### Syntax
|
|
295
|
+
|
|
296
|
+
```html
|
|
297
|
+
<div role="alert" class="alert {MODIFIER}">{CONTENT}</div>
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
#### Rules
|
|
301
|
+
|
|
302
|
+
- {MODIFIER} is optional and can have one of each style/color/direction class names
|
|
303
|
+
- Add `sm:alert-horizontal` for responsive layouts
|
|
304
|
+
|
|
305
|
+
### avatar
|
|
306
|
+
|
|
307
|
+
Avatars are used to show a thumbnail
|
|
308
|
+
|
|
309
|
+
[avatar docs](https://daisyui.com/components/avatar/)
|
|
310
|
+
|
|
311
|
+
#### Class names
|
|
312
|
+
|
|
313
|
+
- component: `avatar`, `avatar-group`
|
|
314
|
+
- modifier: `avatar-online`, `avatar-offline`, `avatar-placeholder`
|
|
315
|
+
|
|
316
|
+
#### Syntax
|
|
317
|
+
|
|
318
|
+
```html
|
|
319
|
+
<div class="avatar {MODIFIER}">
|
|
320
|
+
<div>
|
|
321
|
+
<img src="{image-url}" />
|
|
322
|
+
</div>
|
|
323
|
+
</div>
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
#### Rules
|
|
327
|
+
|
|
328
|
+
- {MODIFIER} is optional and can have one of the modifier class names
|
|
329
|
+
- Use `avatar-group` for containing multiple avatars
|
|
330
|
+
- You can set custom sizes using `w-*` and `h-*`
|
|
331
|
+
- You can use mask classes such as `mask-squircle`, `mask-hexagon`, `mask-triangle`
|
|
332
|
+
|
|
333
|
+
### badge
|
|
334
|
+
|
|
335
|
+
Badges are used to inform the user of the status of specific data
|
|
336
|
+
|
|
337
|
+
[badge docs](https://daisyui.com/components/badge/)
|
|
338
|
+
|
|
339
|
+
#### Class names
|
|
340
|
+
|
|
341
|
+
- component: `badge`
|
|
342
|
+
- style: `badge-outline`, `badge-dash`, `badge-soft`, `badge-ghost`
|
|
343
|
+
- color: `badge-neutral`, `badge-primary`, `badge-secondary`, `badge-accent`, `badge-info`, `badge-success`, `badge-warning`, `badge-error`
|
|
344
|
+
- size: `badge-xs`, `badge-sm`, `badge-md`, `badge-lg`, `badge-xl`
|
|
345
|
+
|
|
346
|
+
#### Syntax
|
|
347
|
+
|
|
348
|
+
```html
|
|
349
|
+
<span class="badge {MODIFIER}">Badge</span>
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
#### Rules
|
|
353
|
+
|
|
354
|
+
- {MODIFIER} is optional and can have one of each style/color/size class names
|
|
355
|
+
- Can be used inside text or buttons
|
|
356
|
+
- To create an empty badge, just remove the text between the span tags
|
|
357
|
+
|
|
358
|
+
### breadcrumbs
|
|
359
|
+
|
|
360
|
+
Breadcrumbs helps users to navigate
|
|
361
|
+
|
|
362
|
+
[breadcrumbs docs](https://daisyui.com/components/breadcrumbs/)
|
|
363
|
+
|
|
364
|
+
#### Class names
|
|
365
|
+
|
|
366
|
+
- component: `breadcrumbs`
|
|
367
|
+
|
|
368
|
+
#### Syntax
|
|
369
|
+
|
|
370
|
+
```html
|
|
371
|
+
<div class="breadcrumbs">
|
|
372
|
+
<ul>
|
|
373
|
+
<li><a>Link</a></li>
|
|
374
|
+
</ul>
|
|
375
|
+
</div>
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
#### Rules
|
|
379
|
+
|
|
380
|
+
- breadcrumbs only has one main class name
|
|
381
|
+
- Can contain icons inside the links
|
|
382
|
+
- If you set `max-width` or the list gets larger than the container it will scroll
|
|
383
|
+
|
|
384
|
+
### button
|
|
385
|
+
|
|
386
|
+
Buttons allow the user to take actions
|
|
387
|
+
|
|
388
|
+
[button docs](https://daisyui.com/components/button/)
|
|
389
|
+
|
|
390
|
+
#### Class names
|
|
391
|
+
|
|
392
|
+
- component: `btn`
|
|
393
|
+
- color: `btn-neutral`, `btn-primary`, `btn-secondary`, `btn-accent`, `btn-info`, `btn-success`, `btn-warning`, `btn-error`
|
|
394
|
+
- style: `btn-outline`, `btn-dash`, `btn-soft`, `btn-ghost`, `btn-link`
|
|
395
|
+
- behavior: `btn-active`, `btn-disabled`
|
|
396
|
+
- size: `btn-xs`, `btn-sm`, `btn-md`, `btn-lg`, `btn-xl`
|
|
397
|
+
- modifier: `btn-wide`, `btn-block`, `btn-square`, `btn-circle`
|
|
398
|
+
|
|
399
|
+
#### Syntax
|
|
400
|
+
|
|
401
|
+
```html
|
|
402
|
+
<button class="btn {MODIFIER}">Button</button>
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
#### Rules
|
|
406
|
+
|
|
407
|
+
- {MODIFIER} is optional and can have one of each color/style/behavior/size/modifier class names
|
|
408
|
+
- btn can be used on any html tags such as `<button>`, `<a>`, `<input>`
|
|
409
|
+
- btn can have an icon before or after the text
|
|
410
|
+
- set `tabindex="-1" role="button" aria-disabled="true"` if you want to disable the button using a class name
|
|
411
|
+
|
|
412
|
+
### calendar
|
|
413
|
+
|
|
414
|
+
Calendar includes styles for different calendar libraries
|
|
415
|
+
|
|
416
|
+
[calendar docs](https://daisyui.com/components/calendar/)
|
|
417
|
+
|
|
418
|
+
#### Class names
|
|
419
|
+
|
|
420
|
+
- component
|
|
421
|
+
- `cally (for Cally web component)`
|
|
422
|
+
- `pika-single (for the input field that opens Pikaday calendar)`
|
|
423
|
+
- `react-day-picker (for the DayPicker component)`
|
|
424
|
+
|
|
425
|
+
#### Syntax
|
|
426
|
+
|
|
427
|
+
For Cally:
|
|
428
|
+
|
|
429
|
+
```html
|
|
430
|
+
<calendar-date class="cally">{CONTENT}</calendar-date>
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
For Pikaday:
|
|
434
|
+
|
|
435
|
+
```html
|
|
436
|
+
<input type="text" class="input pika-single" />
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
For React Day Picker:
|
|
440
|
+
|
|
441
|
+
```html
|
|
442
|
+
<DayPicker className="react-day-picker"></DayPicker>
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
#### Rules
|
|
446
|
+
|
|
447
|
+
- daisyUI supports Cally, Pikaday, React Day Picker
|
|
448
|
+
|
|
449
|
+
### card
|
|
450
|
+
|
|
451
|
+
Cards are used to group and display content
|
|
452
|
+
|
|
453
|
+
[card docs](https://daisyui.com/components/card/)
|
|
454
|
+
|
|
455
|
+
#### Class names
|
|
456
|
+
|
|
457
|
+
- component: `card`
|
|
458
|
+
- part: `card-title`, `card-body`, `card-actions`
|
|
459
|
+
- style: `card-border`, `card-dash`
|
|
460
|
+
- modifier: `card-side`, `image-full`
|
|
461
|
+
- size: `card-xs`, `card-sm`, `card-md`, `card-lg`, `card-xl`
|
|
462
|
+
|
|
463
|
+
#### Syntax
|
|
464
|
+
|
|
465
|
+
```html
|
|
466
|
+
<div class="card {MODIFIER}">
|
|
467
|
+
<figure><img src="{image-url}" alt="{alt-text}" /></figure>
|
|
468
|
+
<div class="card-body">
|
|
469
|
+
<h2 class="card-title">{title}</h2>
|
|
470
|
+
<p>{CONTENT}</p>
|
|
471
|
+
<div class="card-actions">{actions}</div>
|
|
472
|
+
</div>
|
|
473
|
+
</div>
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
#### Rules
|
|
477
|
+
|
|
478
|
+
- {MODIFIER} is optional and can have one of the modifier class names and one of the size class names
|
|
479
|
+
- `<figure>` and `<div class="card-body">` are optional
|
|
480
|
+
- can use `sm:card-horizontal` for responsive layouts
|
|
481
|
+
- If image is placed after `card-body`, the image will be placed at the bottom
|
|
482
|
+
|
|
483
|
+
### carousel
|
|
484
|
+
|
|
485
|
+
Carousel show images or content in a scrollable area
|
|
486
|
+
|
|
487
|
+
[carousel docs](https://daisyui.com/components/carousel/)
|
|
488
|
+
|
|
489
|
+
#### Class names
|
|
490
|
+
|
|
491
|
+
- component: `carousel`
|
|
492
|
+
- part: `carousel-item`
|
|
493
|
+
- modifier: `carousel-start`, `carousel-center`, `carousel-end`
|
|
494
|
+
- direction: `carousel-horizontal`, `carousel-vertical`
|
|
495
|
+
|
|
496
|
+
#### Syntax
|
|
497
|
+
|
|
498
|
+
```html
|
|
499
|
+
<div class="carousel {MODIFIER}">{CONTENT}</div>
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
#### Rules
|
|
503
|
+
|
|
504
|
+
- {MODIFIER} is optional and can have one of the modifier/direction class names
|
|
505
|
+
- Content is a list of `carousel-item` divs: `<div class="carousel-item"></div>`
|
|
506
|
+
- To create a full-width carousel, add `w-full` to each carousel item
|
|
507
|
+
|
|
508
|
+
### chat
|
|
509
|
+
|
|
510
|
+
Chat bubbles are used to show one line of conversation and all its data, including the author image, author name, time, etc
|
|
511
|
+
|
|
512
|
+
[chat docs](https://daisyui.com/components/chat/)
|
|
513
|
+
|
|
514
|
+
#### Class names
|
|
515
|
+
|
|
516
|
+
- component: `chat`
|
|
517
|
+
- part: `chat-image`, `chat-header`, `chat-footer`, `chat-bubble`
|
|
518
|
+
- placement: `chat-start`, `chat-end`
|
|
519
|
+
- color: `chat-bubble-neutral`, `chat-bubble-primary`, `chat-bubble-secondary`, `chat-bubble-accent`, `chat-bubble-info`, `chat-bubble-success`, `chat-bubble-warning`, `chat-bubble-error`
|
|
520
|
+
|
|
521
|
+
#### Syntax
|
|
522
|
+
|
|
523
|
+
```html
|
|
524
|
+
<div class="chat {PLACEMENT}">
|
|
525
|
+
<div class="chat-image"></div>
|
|
526
|
+
<div class="chat-header"></div>
|
|
527
|
+
<div class="chat-bubble {COLOR}">Message text</div>
|
|
528
|
+
<div class="chat-footer"></div>
|
|
529
|
+
</div>
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
#### Rules
|
|
533
|
+
|
|
534
|
+
- {PLACEMENT} is required and must be either `chat-start` or `chat-end`
|
|
535
|
+
- {COLOR} is optional and can have one of the color class names
|
|
536
|
+
- To add an avatar, use `<div class="chat-image avatar">` and nest the avatar content inside
|
|
537
|
+
|
|
538
|
+
### checkbox
|
|
539
|
+
|
|
540
|
+
Checkboxes are used to select or deselect a value
|
|
541
|
+
|
|
542
|
+
[checkbox docs](https://daisyui.com/components/checkbox/)
|
|
543
|
+
|
|
544
|
+
#### Class names
|
|
545
|
+
|
|
546
|
+
- component: `checkbox`
|
|
547
|
+
- color: `checkbox-primary`, `checkbox-secondary`, `checkbox-accent`, `checkbox-neutral`, `checkbox-success`, `checkbox-warning`, `checkbox-info`, `checkbox-error`
|
|
548
|
+
- size: `checkbox-xs`, `checkbox-sm`, `checkbox-md`, `checkbox-lg`, `checkbox-xl`
|
|
549
|
+
|
|
550
|
+
#### Syntax
|
|
551
|
+
|
|
552
|
+
```html
|
|
553
|
+
<input type="checkbox" class="checkbox {MODIFIER}" />
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
#### Rules
|
|
557
|
+
|
|
558
|
+
- {MODIFIER} is optional and can have one of each color/size class names
|
|
559
|
+
|
|
560
|
+
### collapse
|
|
561
|
+
|
|
562
|
+
Collapse is used for showing and hiding content
|
|
563
|
+
|
|
564
|
+
[collapse docs](https://daisyui.com/components/collapse/)
|
|
565
|
+
|
|
566
|
+
#### Class names
|
|
567
|
+
|
|
568
|
+
- component: `collapse`
|
|
569
|
+
- part: `collapse-title`, `collapse-content`
|
|
570
|
+
- modifier: `collapse-arrow`, `collapse-plus`, `collapse-open`, `collapse-close`
|
|
571
|
+
|
|
572
|
+
#### Syntax
|
|
573
|
+
|
|
574
|
+
```html
|
|
575
|
+
<div tabindex="0" class="collapse {MODIFIER}">
|
|
576
|
+
<div class="collapse-title">{title}</div>
|
|
577
|
+
<div class="collapse-content">{CONTENT}</div>
|
|
578
|
+
</div>
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
#### Rules
|
|
582
|
+
|
|
583
|
+
- {MODIFIER} is optional and can have one of the modifier class names
|
|
584
|
+
- instead of `tabindex="0"`, you can use `<input type="checkbox">` as a first child
|
|
585
|
+
- Can also be a details/summary tag
|
|
586
|
+
|
|
587
|
+
### countdown
|
|
588
|
+
|
|
589
|
+
Countdown gives you a transition effect when you change a number between 0 to 999
|
|
590
|
+
|
|
591
|
+
[countdown docs](https://daisyui.com/components/countdown/)
|
|
592
|
+
|
|
593
|
+
#### Class names
|
|
594
|
+
|
|
595
|
+
- component: `countdown`
|
|
596
|
+
|
|
597
|
+
#### Syntax
|
|
598
|
+
|
|
599
|
+
```html
|
|
600
|
+
<span class="countdown">
|
|
601
|
+
<span style="--value:{number};">number</span>
|
|
602
|
+
</span>
|
|
603
|
+
```
|
|
604
|
+
|
|
605
|
+
#### Rules
|
|
606
|
+
|
|
607
|
+
- The `--value` CSS variable and text must be a number between 0 and 999
|
|
608
|
+
- you need to change the span text and the `--value` CSS variable using JS
|
|
609
|
+
- you need to add `aria-live="polite"` and `aria-label="{number}"` so screen readers can properly read changes
|
|
610
|
+
|
|
611
|
+
### diff
|
|
612
|
+
|
|
613
|
+
Diff component shows a side-by-side comparison of two items
|
|
614
|
+
|
|
615
|
+
[diff docs](https://daisyui.com/components/diff/)
|
|
616
|
+
|
|
617
|
+
#### Class names
|
|
618
|
+
|
|
619
|
+
- component: `diff`
|
|
620
|
+
- part: `diff-item-1`, `diff-item-2`, `diff-resizer`
|
|
621
|
+
|
|
622
|
+
#### Syntax
|
|
623
|
+
|
|
624
|
+
```html
|
|
625
|
+
<figure class="diff">
|
|
626
|
+
<div class="diff-item-1">{item1}</div>
|
|
627
|
+
<div class="diff-item-2">{item2}</div>
|
|
628
|
+
<div class="diff-resizer"></div>
|
|
629
|
+
</figure>
|
|
630
|
+
```
|
|
631
|
+
|
|
632
|
+
#### Rules
|
|
633
|
+
|
|
634
|
+
- To maintain aspect ratio, add `aspect-16/9` or other aspect ratio classes to `<figure class="diff">` element
|
|
635
|
+
|
|
636
|
+
### divider
|
|
637
|
+
|
|
638
|
+
Divider will be used to separate content vertically or horizontally
|
|
639
|
+
|
|
640
|
+
[divider docs](https://daisyui.com/components/divider/)
|
|
641
|
+
|
|
642
|
+
#### Class names
|
|
643
|
+
|
|
644
|
+
- component: `divider`
|
|
645
|
+
- color: `divider-neutral`, `divider-primary`, `divider-secondary`, `divider-accent`, `divider-success`, `divider-warning`, `divider-info`, `divider-error`
|
|
646
|
+
- direction: `divider-vertical`, `divider-horizontal`
|
|
647
|
+
- placement: `divider-start`, `divider-end`
|
|
648
|
+
|
|
649
|
+
#### Syntax
|
|
650
|
+
|
|
651
|
+
```html
|
|
652
|
+
<div class="divider {MODIFIER}">{text}</div>
|
|
653
|
+
```
|
|
654
|
+
|
|
655
|
+
#### Rules
|
|
656
|
+
|
|
657
|
+
- {MODIFIER} is optional and can have one of each direction/color/placement class names
|
|
658
|
+
- Omit text for a blank divider
|
|
659
|
+
|
|
660
|
+
### dock
|
|
661
|
+
|
|
662
|
+
Dock (also know as Bottom navigation or Bottom bar) is a UI element that provides navigation options to the user. Dock sticks to the bottom of the screen
|
|
663
|
+
|
|
664
|
+
[dock docs](https://daisyui.com/components/dock/)
|
|
665
|
+
|
|
666
|
+
#### Class names
|
|
667
|
+
|
|
668
|
+
- component: `dock`
|
|
669
|
+
- part: `dock-label`
|
|
670
|
+
- modifier: `dock-active`
|
|
671
|
+
- size: `dock-xs`, `dock-sm`, `dock-md`, `dock-lg`, `dock-xl`
|
|
672
|
+
|
|
673
|
+
#### Syntax
|
|
674
|
+
|
|
675
|
+
```html
|
|
676
|
+
<div class="dock {MODIFIER}">{CONTENT}</div>
|
|
677
|
+
```
|
|
678
|
+
|
|
679
|
+
where content is a list of buttons:
|
|
680
|
+
|
|
681
|
+
```html
|
|
682
|
+
<button>
|
|
683
|
+
<svg>{icon}</svg>
|
|
684
|
+
<span class="dock-label">Text</span>
|
|
685
|
+
</button>
|
|
686
|
+
```
|
|
687
|
+
|
|
688
|
+
#### Rules
|
|
689
|
+
|
|
690
|
+
- {MODIFIER} is optional and can have one of the size class names
|
|
691
|
+
- To make a button active, add `dock-active` class to the button
|
|
692
|
+
- add `<meta name="viewport" content="viewport-fit=cover">` is required for responsivness of the dock in iOS
|
|
693
|
+
|
|
694
|
+
### drawer
|
|
695
|
+
|
|
696
|
+
Drawer is a grid layout that can show/hide a sidebar on the left or right side of the page
|
|
697
|
+
|
|
698
|
+
[drawer docs](https://daisyui.com/components/drawer/)
|
|
699
|
+
|
|
700
|
+
#### Class names
|
|
701
|
+
|
|
702
|
+
- component: `drawer`
|
|
703
|
+
- part: `drawer-toggle`, `drawer-content`, `drawer-side`, `drawer-overlay`
|
|
704
|
+
- placement: `drawer-end`
|
|
705
|
+
- modifier: `drawer-open`
|
|
706
|
+
- variant: `is-drawer-open:`, `is-drawer-close:`
|
|
707
|
+
|
|
708
|
+
#### Syntax
|
|
709
|
+
|
|
710
|
+
```html
|
|
711
|
+
<div class="drawer {MODIFIER}">
|
|
712
|
+
<input id="my-drawer" type="checkbox" class="drawer-toggle" />
|
|
713
|
+
<div class="drawer-content">{CONTENT}</div>
|
|
714
|
+
<div class="drawer-side">{SIDEBAR}</div>
|
|
715
|
+
</div>
|
|
716
|
+
```
|
|
717
|
+
|
|
718
|
+
where {CONTENT} can be navbar, site content, footer, etc
|
|
719
|
+
and {SIDEBAR} can be a menu like:
|
|
720
|
+
|
|
721
|
+
```html
|
|
722
|
+
<ul class="menu p-4 w-80 min-h-full bg-base-100 text-base-content">
|
|
723
|
+
<li><a>Item 1</a></li>
|
|
724
|
+
<li><a>Item 2</a></li>
|
|
725
|
+
</ul>
|
|
726
|
+
```
|
|
727
|
+
|
|
728
|
+
To open/close the drawer, use a label that points to the `drawer-toggle` input:
|
|
729
|
+
|
|
730
|
+
```html
|
|
731
|
+
<label for="my-drawer" class="btn drawer-button">Open/close drawer</label>
|
|
732
|
+
```
|
|
733
|
+
|
|
734
|
+
Example: This sidebar is always visible on large screen, can be toggled on small screen:
|
|
735
|
+
|
|
736
|
+
```html
|
|
737
|
+
<div class="drawer lg:drawer-open">
|
|
738
|
+
<input id="my-drawer-3" type="checkbox" class="drawer-toggle" />
|
|
739
|
+
<div class="drawer-content flex flex-col items-center justify-center">
|
|
740
|
+
<!-- Page content here -->
|
|
741
|
+
<label for="my-drawer-3" class="btn drawer-button lg:hidden"> Open drawer </label>
|
|
742
|
+
</div>
|
|
743
|
+
<div class="drawer-side">
|
|
744
|
+
<label for="my-drawer-3" aria-label="close sidebar" class="drawer-overlay"></label>
|
|
745
|
+
<ul class="menu bg-base-200 min-h-full w-80 p-4">
|
|
746
|
+
<!-- Sidebar content here -->
|
|
747
|
+
<li><button>Sidebar Item 1</button></li>
|
|
748
|
+
<li><button>Sidebar Item 2</button></li>
|
|
749
|
+
</ul>
|
|
750
|
+
</div>
|
|
751
|
+
</div>
|
|
752
|
+
```
|
|
753
|
+
|
|
754
|
+
Example: This sidebar is always visible. When it's close we only see iocns, when it's open we see icons and text
|
|
755
|
+
|
|
756
|
+
```html
|
|
757
|
+
<div class="drawer lg:drawer-open">
|
|
758
|
+
<input id="my-drawer-4" type="checkbox" class="drawer-toggle" />
|
|
759
|
+
<div class="drawer-content">
|
|
760
|
+
<!-- Page content here -->
|
|
761
|
+
</div>
|
|
762
|
+
<div class="drawer-side is-drawer-close:overflow-visible">
|
|
763
|
+
<label for="my-drawer-4" aria-label="close sidebar" class="drawer-overlay"></label>
|
|
764
|
+
<div class="is-drawer-close:w-14 is-drawer-open:w-64 bg-base-200 flex flex-col items-start min-h-full">
|
|
765
|
+
<!-- Sidebar content here -->
|
|
766
|
+
<ul class="menu w-full grow">
|
|
767
|
+
<!-- list item -->
|
|
768
|
+
<li>
|
|
769
|
+
<button class="is-drawer-close:tooltip is-drawer-close:tooltip-right" data-tip="Homepage">
|
|
770
|
+
🏠
|
|
771
|
+
<span class="is-drawer-close:hidden">Homepage</span>
|
|
772
|
+
</button>
|
|
773
|
+
</li>
|
|
774
|
+
<!-- list item -->
|
|
775
|
+
<li>
|
|
776
|
+
<button class="is-drawer-close:tooltip is-drawer-close:tooltip-right" data-tip="Settings">
|
|
777
|
+
⚙️
|
|
778
|
+
<span class="is-drawer-close:hidden">Settings</span>
|
|
779
|
+
</button>
|
|
780
|
+
</li>
|
|
781
|
+
</ul>
|
|
782
|
+
<!-- button to open/close drawer -->
|
|
783
|
+
<div class="m-2 is-drawer-close:tooltip is-drawer-close:tooltip-right" data-tip="Open">
|
|
784
|
+
<label for="my-drawer-4" class="btn btn-ghost btn-circle drawer-button is-drawer-open:rotate-y-180"> ↔️ </label>
|
|
785
|
+
</div>
|
|
786
|
+
</div>
|
|
787
|
+
</div>
|
|
788
|
+
</div>
|
|
789
|
+
```
|
|
790
|
+
|
|
791
|
+
#### Rules
|
|
792
|
+
|
|
793
|
+
- {MODIFIER} is optional and can have one of the modifier/placement class names
|
|
794
|
+
- `id` is required for the `drawer-toggle` input. change `my-drawer` to a unique id according to your needs
|
|
795
|
+
- `lg:drawer-open` can be used to make sidebar visible on larger screens
|
|
796
|
+
- `drawer-toggle` is a hidden checkbox. Use label with "for" attribute to toggle state
|
|
797
|
+
- if you want to open the drawer when a button is clicked, use `<label for="my-drawer" class="btn drawer-button">Open drawer</label>` where `my-drawer` is the id of the `drawer-toggle` input
|
|
798
|
+
- when using drawer, every page content must be inside `drawer-content` element. for example navbar, footer, etc should not be outside of `drawer`
|
|
799
|
+
|
|
800
|
+
### dropdown
|
|
801
|
+
|
|
802
|
+
Dropdown can open a menu or any other element when the button is clicked
|
|
803
|
+
|
|
804
|
+
[dropdown docs](https://daisyui.com/components/dropdown/)
|
|
805
|
+
|
|
806
|
+
#### Class names
|
|
807
|
+
|
|
808
|
+
- component: `dropdown`
|
|
809
|
+
- part: `dropdown-content`
|
|
810
|
+
- placement: `dropdown-start`, `dropdown-center`, `dropdown-end`, `dropdown-top`, `dropdown-bottom`, `dropdown-left`, `dropdown-right`
|
|
811
|
+
- modifier: `dropdown-hover`, `dropdown-open`, `dropdown-close`
|
|
812
|
+
|
|
813
|
+
#### Syntax
|
|
814
|
+
|
|
815
|
+
Using details and summary
|
|
816
|
+
|
|
817
|
+
```html
|
|
818
|
+
<details class="dropdown">
|
|
819
|
+
<summary>Button</summary>
|
|
820
|
+
<ul class="dropdown-content">
|
|
821
|
+
{CONTENT}
|
|
822
|
+
</ul>
|
|
823
|
+
</details>
|
|
824
|
+
```
|
|
825
|
+
|
|
826
|
+
Using popover API
|
|
827
|
+
|
|
828
|
+
```html
|
|
829
|
+
<button popovertarget="{id}" style="anchor-name:--{anchor}">{button}</button>
|
|
830
|
+
<ul class="dropdown-content" popover id="{id}" style="position-anchor:--{anchor}">
|
|
831
|
+
{CONTENT}
|
|
832
|
+
</ul>
|
|
833
|
+
```
|
|
834
|
+
|
|
835
|
+
Using CSS focus
|
|
836
|
+
|
|
837
|
+
```html
|
|
838
|
+
<div class="dropdown">
|
|
839
|
+
<div tabindex="0" role="button">Button</div>
|
|
840
|
+
<ul tabindex="-1" class="dropdown-content">
|
|
841
|
+
{CONTENT}
|
|
842
|
+
</ul>
|
|
843
|
+
</div>
|
|
844
|
+
```
|
|
845
|
+
|
|
846
|
+
#### Rules
|
|
847
|
+
|
|
848
|
+
- {MODIFIER} is optional and can have one of the modifier/placement class names
|
|
849
|
+
- replace `{id}` and `{anchor}` with a unique name
|
|
850
|
+
- For CSS focus dropdowns, use `tabindex="0"` and `role="button"` on the button
|
|
851
|
+
- The content can be any HTML element (not just `<ul>`)
|
|
852
|
+
|
|
853
|
+
### fab
|
|
854
|
+
|
|
855
|
+
FAB (Floating Action Button) stays in the bottom corner of screen. It includes a focusable and accessible element with button role. Clicking or focusing it shows additional buttons (known as Speed Dial buttons) in a vertical arrangement or a flower shape (quarter circle)
|
|
856
|
+
|
|
857
|
+
[fab docs](https://daisyui.com/components/fab/)
|
|
858
|
+
|
|
859
|
+
#### Class names
|
|
860
|
+
|
|
861
|
+
- component: `fab`
|
|
862
|
+
- part: `fab-close`, `fab-main-action`
|
|
863
|
+
- modifier: `fab-flower`
|
|
864
|
+
|
|
865
|
+
#### Syntax
|
|
866
|
+
|
|
867
|
+
A single FAB in the corder of screen
|
|
868
|
+
|
|
869
|
+
```html
|
|
870
|
+
<div class="fab">
|
|
871
|
+
<button class="btn btn-lg btn-circle">{IconOriginal}</button>
|
|
872
|
+
</div>
|
|
873
|
+
```
|
|
874
|
+
|
|
875
|
+
A FAB that opens a 3 other buttons in the corner of page vertically
|
|
876
|
+
|
|
877
|
+
```html
|
|
878
|
+
<div class="fab">
|
|
879
|
+
<div tabindex="0" role="button" class="btn btn-lg btn-circle btn-primary">{IconOriginal}</div>
|
|
880
|
+
<button class="btn btn-lg btn-circle">{Icon1}</button>
|
|
881
|
+
<button class="btn btn-lg btn-circle">{Icon2}</button>
|
|
882
|
+
<button class="btn btn-lg btn-circle">{Icon3}</button>
|
|
883
|
+
</div>
|
|
884
|
+
```
|
|
885
|
+
|
|
886
|
+
A FAB that opens a 3 other buttons in the corner of page vertically and they have label text
|
|
887
|
+
|
|
888
|
+
```html
|
|
889
|
+
<div class="fab">
|
|
890
|
+
<div tabindex="0" role="button" class="btn btn-lg btn-circle btn-primary">{IconOriginal}</div>
|
|
891
|
+
<div>{Label1}<button class="btn btn-lg btn-circle">{Icon1}</button></div>
|
|
892
|
+
<div>{Label2}<button class="btn btn-lg btn-circle">{Icon2}</button></div>
|
|
893
|
+
<div>{Label3}<button class="btn btn-lg btn-circle">{Icon3}</button></div>
|
|
894
|
+
</div>
|
|
895
|
+
```
|
|
896
|
+
|
|
897
|
+
FAB with rectangle buttons. These are not circular buttons so they can have more content.
|
|
898
|
+
|
|
899
|
+
```html
|
|
900
|
+
<div class="fab">
|
|
901
|
+
<div tabindex="0" role="button" class="btn btn-lg btn-circle btn-primary">{IconOriginal}</div>
|
|
902
|
+
<button class="btn btn-lg">{Label1}</button>
|
|
903
|
+
<button class="btn btn-lg">{Label2}</button>
|
|
904
|
+
<button class="btn btn-lg">{Label3}</button>
|
|
905
|
+
</div>
|
|
906
|
+
```
|
|
907
|
+
|
|
908
|
+
FAB with close button. When FAB is open, the original button is replaced with a close button
|
|
909
|
+
|
|
910
|
+
```html
|
|
911
|
+
<div class="fab">
|
|
912
|
+
<div tabindex="0" role="button" class="btn btn-lg btn-circle btn-primary">{IconOriginal}</div>
|
|
913
|
+
<div class="fab-close">Close <span class="btn btn-circle btn-lg btn-error">✕</span></div>
|
|
914
|
+
<div>{Label1}<button class="btn btn-lg btn-circle">{Icon1}</button></div>
|
|
915
|
+
<div>{Label2}<button class="btn btn-lg btn-circle">{Icon2}</button></div>
|
|
916
|
+
<div>{Label3}<button class="btn btn-lg btn-circle">{Icon3}</button></div>
|
|
917
|
+
</div>
|
|
918
|
+
```
|
|
919
|
+
|
|
920
|
+
FAB with Main Action button. When FAB is open, the original button is replaced with a main action button
|
|
921
|
+
|
|
922
|
+
```html
|
|
923
|
+
<div class="fab">
|
|
924
|
+
<div tabindex="0" role="button" class="btn btn-lg btn-circle btn-primary">{IconOriginal}</div>
|
|
925
|
+
<div class="fab-main-action">
|
|
926
|
+
{LabelMainAction}<button class="btn btn-circle btn-secondary btn-lg">{IconMainAction}</button>
|
|
927
|
+
</div>
|
|
928
|
+
<div>{Label1}<button class="btn btn-lg btn-circle">{Icon1}</button></div>
|
|
929
|
+
<div>{Label2}<button class="btn btn-lg btn-circle">{Icon2}</button></div>
|
|
930
|
+
<div>{Label3}<button class="btn btn-lg btn-circle">{Icon3}</button></div>
|
|
931
|
+
</div>
|
|
932
|
+
```
|
|
933
|
+
|
|
934
|
+
FAB Flower. It opens the buttons in a flower shape (quarter circle) arrangement instead of vertical
|
|
935
|
+
|
|
936
|
+
```html
|
|
937
|
+
<div class="fab fab-flower">
|
|
938
|
+
<div tabindex="0" role="button" class="btn btn-lg btn-circle btn-primary">{IconOriginal}</div>
|
|
939
|
+
<button class="fab-main-action btn btn-circle btn-lg">{IconMainAction}</button>
|
|
940
|
+
<button class="btn btn-lg btn-circle">{Icon1}</button>
|
|
941
|
+
<button class="btn btn-lg btn-circle">{Icon2}</button>
|
|
942
|
+
<button class="btn btn-lg btn-circle">{Icon3}</button>
|
|
943
|
+
</div>
|
|
944
|
+
```
|
|
945
|
+
|
|
946
|
+
FAB Flower with tooltips. There's no space for a text label in a quarter circle, so tooltips are used to indicate the button's function
|
|
947
|
+
|
|
948
|
+
```html
|
|
949
|
+
<div class="fab fab-flower">
|
|
950
|
+
<div tabindex="0" role="button" class="btn btn-lg btn-circle btn-primary">{IconOriginal}</div>
|
|
951
|
+
<button class="fab-main-action btn btn-circle btn-lg">{IconMainAction}</button>
|
|
952
|
+
<div class="tooltip tooltip-left" data-tip="{Label1}">
|
|
953
|
+
<button class="btn btn-lg btn-circle">{Icon1}</button>
|
|
954
|
+
</div>
|
|
955
|
+
<div class="tooltip tooltip-left" data-tip="{Label2}">
|
|
956
|
+
<button class="btn btn-lg btn-circle">{Icon2}</button>
|
|
957
|
+
</div>
|
|
958
|
+
<div class="tooltip tooltip-left" data-tip="{Label3}">
|
|
959
|
+
<button class="btn btn-lg btn-circle">{Icon3}</button>
|
|
960
|
+
</div>
|
|
961
|
+
</div>
|
|
962
|
+
```
|
|
963
|
+
|
|
964
|
+
#### Rules
|
|
965
|
+
|
|
966
|
+
- {Icon\*} should be replaced with the appropriate icon for each button. SVG icons are recommended
|
|
967
|
+
- {IconOriginal} is the icon that we see before opening the FAB
|
|
968
|
+
- {IconMainAction} is the icon we see after opening the FAB
|
|
969
|
+
- {Icon1}, {Icon2}, {Icon3} are the icons for the additional buttons
|
|
970
|
+
- {Label\*} is the label text for each button
|
|
971
|
+
|
|
972
|
+
### fieldset
|
|
973
|
+
|
|
974
|
+
Fieldset is a container for grouping related form elements. It includes fieldset-legend as a title and label as a description
|
|
975
|
+
|
|
976
|
+
[fieldset docs](https://daisyui.com/components/fieldset/)
|
|
977
|
+
|
|
978
|
+
#### Class names
|
|
979
|
+
|
|
980
|
+
- Component: `fieldset`, `label`
|
|
981
|
+
- Parts: `fieldset-legend`
|
|
982
|
+
|
|
983
|
+
#### Syntax
|
|
984
|
+
|
|
985
|
+
```html
|
|
986
|
+
<fieldset class="fieldset">
|
|
987
|
+
<legend class="fieldset-legend">{title}</legend>
|
|
988
|
+
{CONTENT}
|
|
989
|
+
<p class="label">{description}</p>
|
|
990
|
+
</fieldset>
|
|
991
|
+
```
|
|
992
|
+
|
|
993
|
+
#### Rules
|
|
994
|
+
|
|
995
|
+
- You can use any element as a direct child of fieldset to add form elements
|
|
996
|
+
|
|
997
|
+
### file-input
|
|
998
|
+
|
|
999
|
+
File Input is a an input field for uploading files
|
|
1000
|
+
|
|
1001
|
+
[file-input docs](https://daisyui.com/components/file-input/)
|
|
1002
|
+
|
|
1003
|
+
#### Class Names:
|
|
1004
|
+
|
|
1005
|
+
- Component: `file-input`
|
|
1006
|
+
- Style: `file-input-ghost`
|
|
1007
|
+
- Color: `file-input-neutral`, `file-input-primary`, `file-input-secondary`, `file-input-accent`, `file-input-info`, `file-input-success`, `file-input-warning`, `file-input-error`
|
|
1008
|
+
- Size: `file-input-xs`, `file-input-sm`, `file-input-md`, `file-input-lg`, `file-input-xl`
|
|
1009
|
+
|
|
1010
|
+
#### Syntax
|
|
1011
|
+
|
|
1012
|
+
```html
|
|
1013
|
+
<input type="file" class="file-input {MODIFIER}" />
|
|
1014
|
+
```
|
|
1015
|
+
|
|
1016
|
+
#### Rules
|
|
1017
|
+
|
|
1018
|
+
- {MODIFIER} is optional and can have one of each style/color/size class names
|
|
1019
|
+
|
|
1020
|
+
### filter
|
|
1021
|
+
|
|
1022
|
+
Filter is a group of radio buttons. Choosing one of the options will hide the others and shows a reset button next to the chosen option
|
|
1023
|
+
|
|
1024
|
+
[filter docs](https://daisyui.com/components/filter/)
|
|
1025
|
+
|
|
1026
|
+
#### Class names
|
|
1027
|
+
|
|
1028
|
+
- component: `filter`
|
|
1029
|
+
- part: `filter-reset`
|
|
1030
|
+
|
|
1031
|
+
#### Syntax
|
|
1032
|
+
|
|
1033
|
+
Using HTML form
|
|
1034
|
+
|
|
1035
|
+
```html
|
|
1036
|
+
<form class="filter">
|
|
1037
|
+
<input class="btn btn-square" type="reset" value="×" />
|
|
1038
|
+
<input class="btn" type="radio" name="{NAME}" aria-label="Tab 1 title" />
|
|
1039
|
+
<input class="btn" type="radio" name="{NAME}" aria-label="Tab 2 title" />
|
|
1040
|
+
</form>
|
|
1041
|
+
```
|
|
1042
|
+
|
|
1043
|
+
Without HTML form
|
|
1044
|
+
|
|
1045
|
+
```html
|
|
1046
|
+
<div class="filter">
|
|
1047
|
+
<input class="btn filter-reset" type="radio" name="{NAME}" aria-label="×" />
|
|
1048
|
+
<input class="btn" type="radio" name="{NAME}" aria-label="Tab 1 title" />
|
|
1049
|
+
<input class="btn" type="radio" name="{NAME}" aria-label="Tab 2 title" />
|
|
1050
|
+
</div>
|
|
1051
|
+
```
|
|
1052
|
+
|
|
1053
|
+
#### Rules
|
|
1054
|
+
|
|
1055
|
+
- replace `{NAME}` with proper value, according to the context of the filter
|
|
1056
|
+
- Each set of radio inputs must have unique `name` attributes to avoid conflicts
|
|
1057
|
+
- Use `<form>` tag when possible and only use `<div>` if you can't use a HTML form for some reason
|
|
1058
|
+
- Use `filter-reset` class for the reset button
|
|
1059
|
+
|
|
1060
|
+
### footer
|
|
1061
|
+
|
|
1062
|
+
Footer can contain logo, copyright notice, and links to other pages
|
|
1063
|
+
|
|
1064
|
+
[footer docs](https://daisyui.com/components/footer/)
|
|
1065
|
+
|
|
1066
|
+
#### Class names
|
|
1067
|
+
|
|
1068
|
+
- component: `footer`
|
|
1069
|
+
- part: `footer-title`
|
|
1070
|
+
- placement: `footer-center`
|
|
1071
|
+
- direction: `footer-horizontal`, `footer-vertical`
|
|
1072
|
+
|
|
1073
|
+
#### Syntax
|
|
1074
|
+
|
|
1075
|
+
```html
|
|
1076
|
+
<footer class="footer {MODIFIER}">{CONTENT}</footer>
|
|
1077
|
+
```
|
|
1078
|
+
|
|
1079
|
+
where content can contain several `<nav>` tags with `footer-title` and links inside
|
|
1080
|
+
|
|
1081
|
+
#### Rules
|
|
1082
|
+
|
|
1083
|
+
- {MODIFIER} is optional and can have one of each placement/direction class names
|
|
1084
|
+
- try to use `sm:footer-horizontal` to make footer responsive
|
|
1085
|
+
- suggestion - use `base-200` for background color
|
|
1086
|
+
|
|
1087
|
+
### hero
|
|
1088
|
+
|
|
1089
|
+
Hero is a component for displaying a large box or image with a title and description
|
|
1090
|
+
|
|
1091
|
+
[hero docs](https://daisyui.com/components/hero/)
|
|
1092
|
+
|
|
1093
|
+
#### Class names
|
|
1094
|
+
|
|
1095
|
+
- component: `hero`
|
|
1096
|
+
- part: `hero-content`, `hero-overlay`
|
|
1097
|
+
|
|
1098
|
+
#### Syntax
|
|
1099
|
+
|
|
1100
|
+
```html
|
|
1101
|
+
<div class="hero {MODIFIER}">{CONTENT}</div>
|
|
1102
|
+
```
|
|
1103
|
+
|
|
1104
|
+
#### Rules
|
|
1105
|
+
|
|
1106
|
+
- {MODIFIER} is optional
|
|
1107
|
+
- Use `hero-content` for the text content
|
|
1108
|
+
- Use `hero-overlay` inside the hero to overlay the background image with a color
|
|
1109
|
+
- Content can contain a figure
|
|
1110
|
+
|
|
1111
|
+
### hover-3d
|
|
1112
|
+
|
|
1113
|
+
Hover 3D is a wrapper component that adds a 3D hover effect to its content. When we hover over the component, it tilts and rotates based on the mouse position, creating an interactive 3D effect.
|
|
1114
|
+
|
|
1115
|
+
`hover-3d` works by placing 8 hover zones on top of the content. Each zone detects mouse movement and applies a slight rotation to the content based on the mouse position within that zone. The combined effect of all 8 zones creates a smooth and responsive 3D tilt effect as the user moves their mouse over the component.
|
|
1116
|
+
|
|
1117
|
+
Only use non-interactive content inside the `hover-3d` wrapper. If you want to make the entire card clickable, use a link for the whole `hover-3d` component instead of putting interactive elements like buttons or links inside it.
|
|
1118
|
+
|
|
1119
|
+
[hover-3d docs](https://daisyui.com/components/hover-3d/)
|
|
1120
|
+
|
|
1121
|
+
#### Class names
|
|
1122
|
+
|
|
1123
|
+
- component: `hover-3d`
|
|
1124
|
+
|
|
1125
|
+
#### Syntax
|
|
1126
|
+
|
|
1127
|
+
```html
|
|
1128
|
+
<div class="hover-3d my-12 mx-2">
|
|
1129
|
+
<figure class="max-w-100 rounded-2xl">
|
|
1130
|
+
<img src="https://img.daisyui.com/images/stock/creditcard.webp" alt="Tailwind CSS 3D card" />
|
|
1131
|
+
</figure>
|
|
1132
|
+
<div></div>
|
|
1133
|
+
<div></div>
|
|
1134
|
+
<div></div>
|
|
1135
|
+
<div></div>
|
|
1136
|
+
<div></div>
|
|
1137
|
+
<div></div>
|
|
1138
|
+
<div></div>
|
|
1139
|
+
<div></div>
|
|
1140
|
+
</div>
|
|
1141
|
+
```
|
|
1142
|
+
|
|
1143
|
+
#### Rules
|
|
1144
|
+
|
|
1145
|
+
- hover-3d can be a `<div>` or a `<a>`
|
|
1146
|
+
- hover-3d must have exactly 9 direct children where the first child is the main content and the other 8 children are empty `<div>`s for hover zones
|
|
1147
|
+
- content inside hover-3d should be non-interactive (no buttons, links, inputs, etc)
|
|
1148
|
+
|
|
1149
|
+
### hover-gallery
|
|
1150
|
+
|
|
1151
|
+
Hover Gallery is container of images. The first image is visible be default and when we hover it horizontally, other images show up. Hover Gallery is useful for product cards in ecommerce sites, portfoilios or in image galleries. Hover Gallery can include up to 10 images.
|
|
1152
|
+
|
|
1153
|
+
[hover-gallery docs](https://daisyui.com/components/hover-gallery/)
|
|
1154
|
+
|
|
1155
|
+
#### Class names
|
|
1156
|
+
|
|
1157
|
+
- component: `hover-gallery`
|
|
1158
|
+
|
|
1159
|
+
#### Syntax
|
|
1160
|
+
|
|
1161
|
+
```html
|
|
1162
|
+
<figure class="hover-gallery max-w-60">
|
|
1163
|
+
<img src="https://img.daisyui.com/images/stock/daisyui-hat-1.webp" />
|
|
1164
|
+
<img src="https://img.daisyui.com/images/stock/daisyui-hat-2.webp" />
|
|
1165
|
+
<img src="https://img.daisyui.com/images/stock/daisyui-hat-3.webp" />
|
|
1166
|
+
<img src="https://img.daisyui.com/images/stock/daisyui-hat-4.webp" />
|
|
1167
|
+
</figure>
|
|
1168
|
+
```
|
|
1169
|
+
|
|
1170
|
+
#### Rules
|
|
1171
|
+
|
|
1172
|
+
- hover-gallery can be a `<div>` or a `<figure>`
|
|
1173
|
+
- hover-gallery can include up to 10 images
|
|
1174
|
+
- hover-gallery needs a max width otherwise if fills the container width
|
|
1175
|
+
- images must be same dimensions for a proper alignment
|
|
1176
|
+
|
|
1177
|
+
### indicator
|
|
1178
|
+
|
|
1179
|
+
Indicators are used to place an element on the corner of another element
|
|
1180
|
+
|
|
1181
|
+
[indicator docs](https://daisyui.com/components/indicator/)
|
|
1182
|
+
|
|
1183
|
+
#### Class names
|
|
1184
|
+
|
|
1185
|
+
- component: `indicator`
|
|
1186
|
+
- part: `indicator-item`
|
|
1187
|
+
- placement: `indicator-start`, `indicator-center`, `indicator-end`, `indicator-top`, `indicator-middle`, `indicator-bottom`
|
|
1188
|
+
|
|
1189
|
+
#### Syntax
|
|
1190
|
+
|
|
1191
|
+
```html
|
|
1192
|
+
<div class="indicator">
|
|
1193
|
+
<span class="indicator-item">{indicator content}</span>
|
|
1194
|
+
<div>{main content}</div>
|
|
1195
|
+
</div>
|
|
1196
|
+
```
|
|
1197
|
+
|
|
1198
|
+
#### Rules
|
|
1199
|
+
|
|
1200
|
+
- Add all indicator elements (with `indicator-item` class) before the main content
|
|
1201
|
+
- {placement} is optional and can have one of each horizontal/vertical class names. default is `indicator-end indicator-top`
|
|
1202
|
+
|
|
1203
|
+
### input
|
|
1204
|
+
|
|
1205
|
+
Text Input is a simple input field
|
|
1206
|
+
|
|
1207
|
+
[input docs](https://daisyui.com/components/input/)
|
|
1208
|
+
|
|
1209
|
+
#### Class names
|
|
1210
|
+
|
|
1211
|
+
- component: `input`
|
|
1212
|
+
- style: `input-ghost`
|
|
1213
|
+
- color: `input-neutral`, `input-primary`, `input-secondary`, `input-accent`, `input-info`, `input-success`, `input-warning`, `input-error`
|
|
1214
|
+
- size: `input-xs`, `input-sm`, `input-md`, `input-lg`, `input-xl`
|
|
1215
|
+
|
|
1216
|
+
#### Syntax
|
|
1217
|
+
|
|
1218
|
+
```html
|
|
1219
|
+
<input type="{type}" placeholder="Type here" class="input {MODIFIER}" />
|
|
1220
|
+
```
|
|
1221
|
+
|
|
1222
|
+
#### Rules
|
|
1223
|
+
|
|
1224
|
+
- {MODIFIER} is optional and can have one of each style/color/size class names
|
|
1225
|
+
- Can be used with any input field type (text, password, email, etc.)
|
|
1226
|
+
- Use `input` class for the parent when you have more than one element inside input
|
|
1227
|
+
|
|
1228
|
+
### join
|
|
1229
|
+
|
|
1230
|
+
Join is a container for grouping multiple items, it can be used to group buttons, inputs, etc. Join applies border radius to the first and last item. Join can be used to create a horizontal or vertical list of items
|
|
1231
|
+
|
|
1232
|
+
[join docs](https://daisyui.com/components/join/)
|
|
1233
|
+
|
|
1234
|
+
#### Class names
|
|
1235
|
+
|
|
1236
|
+
- component: `join`, `join-item`
|
|
1237
|
+
- direction: `join-vertical`, `join-horizontal`
|
|
1238
|
+
|
|
1239
|
+
#### Syntax
|
|
1240
|
+
|
|
1241
|
+
```html
|
|
1242
|
+
<div class="join {MODIFIER}">{CONTENT}</div>
|
|
1243
|
+
```
|
|
1244
|
+
|
|
1245
|
+
#### Rules
|
|
1246
|
+
|
|
1247
|
+
- {MODIFIER} is optional and can have one of the direction class names
|
|
1248
|
+
- Any direct child of the join element will get joined together
|
|
1249
|
+
- Any element with `join-item` will be affected
|
|
1250
|
+
- Use `lg:join-horizontal` for responsive layouts
|
|
1251
|
+
|
|
1252
|
+
### kbd
|
|
1253
|
+
|
|
1254
|
+
Kbd is used to display keyboard shortcuts
|
|
1255
|
+
|
|
1256
|
+
[kbd docs](https://daisyui.com/components/kbd/)
|
|
1257
|
+
|
|
1258
|
+
#### Class names
|
|
1259
|
+
|
|
1260
|
+
- component: `kbd`
|
|
1261
|
+
- size: `kbd-xs`, `kbd-sm`, `kbd-md`, `kbd-lg`, `kbd-xl`
|
|
1262
|
+
|
|
1263
|
+
#### Syntax
|
|
1264
|
+
|
|
1265
|
+
```html
|
|
1266
|
+
<kbd class="kbd {MODIFIER}">K</kbd>
|
|
1267
|
+
```
|
|
1268
|
+
|
|
1269
|
+
#### Rules
|
|
1270
|
+
|
|
1271
|
+
- {MODIFIER} is optional and can have one of the size class names
|
|
1272
|
+
|
|
1273
|
+
### label
|
|
1274
|
+
|
|
1275
|
+
Label is used to provide a name or title for an input field. Label can be placed before or after the field
|
|
1276
|
+
|
|
1277
|
+
[label docs](https://daisyui.com/components/label/)
|
|
1278
|
+
|
|
1279
|
+
#### Class names
|
|
1280
|
+
|
|
1281
|
+
- component: `label`, `floating-label`
|
|
1282
|
+
|
|
1283
|
+
#### Syntax
|
|
1284
|
+
|
|
1285
|
+
For regular label:
|
|
1286
|
+
|
|
1287
|
+
```html
|
|
1288
|
+
<label class="input">
|
|
1289
|
+
<span class="label">{label text}</span>
|
|
1290
|
+
<input type="text" placeholder="Type here" />
|
|
1291
|
+
</label>
|
|
1292
|
+
```
|
|
1293
|
+
|
|
1294
|
+
For floating label:
|
|
1295
|
+
|
|
1296
|
+
```html
|
|
1297
|
+
<label class="floating-label">
|
|
1298
|
+
<input type="text" placeholder="Type here" class="input" />
|
|
1299
|
+
<span>{label text}</span>
|
|
1300
|
+
</label>
|
|
1301
|
+
```
|
|
1302
|
+
|
|
1303
|
+
#### Rules
|
|
1304
|
+
|
|
1305
|
+
- The `input` class is for styling the parent element which contains the input field and label, so the label does not have the 'input' class
|
|
1306
|
+
- Use `floating-label` for the parent of an input field and a span that floats above the input field when the field is focused
|
|
1307
|
+
|
|
1308
|
+
### link
|
|
1309
|
+
|
|
1310
|
+
Link adds the missing underline style to links
|
|
1311
|
+
|
|
1312
|
+
[link docs](https://daisyui.com/components/link/)
|
|
1313
|
+
|
|
1314
|
+
#### Class names
|
|
1315
|
+
|
|
1316
|
+
- component: `link`
|
|
1317
|
+
- style: `link-hover`
|
|
1318
|
+
- color: `link-neutral`, `link-primary`, `link-secondary`, `link-accent`, `link-success`, `link-info`, `link-warning`, `link-error`
|
|
1319
|
+
|
|
1320
|
+
#### Syntax
|
|
1321
|
+
|
|
1322
|
+
```html
|
|
1323
|
+
<a class="link {MODIFIER}">Click me</a>
|
|
1324
|
+
```
|
|
1325
|
+
|
|
1326
|
+
#### Rules
|
|
1327
|
+
|
|
1328
|
+
- {MODIFIER} is optional and can have one of the modifier class names
|
|
1329
|
+
|
|
1330
|
+
### list
|
|
1331
|
+
|
|
1332
|
+
List is a vertical layout to display information in rows
|
|
1333
|
+
|
|
1334
|
+
[list docs](https://daisyui.com/components/list/)
|
|
1335
|
+
|
|
1336
|
+
#### Class Names:
|
|
1337
|
+
|
|
1338
|
+
- Component: `list`, `list-row`
|
|
1339
|
+
- Modifier: `list-col-wrap`, `list-col-grow`
|
|
1340
|
+
|
|
1341
|
+
#### Syntax
|
|
1342
|
+
|
|
1343
|
+
```html
|
|
1344
|
+
<ul class="list">
|
|
1345
|
+
<li class="list-row">{CONTENT}</li>
|
|
1346
|
+
</ul>
|
|
1347
|
+
```
|
|
1348
|
+
|
|
1349
|
+
#### Rules
|
|
1350
|
+
|
|
1351
|
+
- Use `list-row` for each item inside the list
|
|
1352
|
+
- By default, the second child of the `list-row` will fill the remaining space. You can use `list-col-grow` on another child to make it fill the remaining space instead
|
|
1353
|
+
- Use `list-col-wrap` to force an item to wrap to the next line
|
|
1354
|
+
|
|
1355
|
+
### loading
|
|
1356
|
+
|
|
1357
|
+
Loading shows an animation to indicate that something is loading
|
|
1358
|
+
|
|
1359
|
+
[loading docs](https://daisyui.com/components/loading/)
|
|
1360
|
+
|
|
1361
|
+
#### Class names
|
|
1362
|
+
|
|
1363
|
+
- component: `loading`
|
|
1364
|
+
- style: `loading-spinner`, `loading-dots`, `loading-ring`, `loading-ball`, `loading-bars`, `loading-infinity`
|
|
1365
|
+
- size: `loading-xs`, `loading-sm`, `loading-md`, `loading-lg`, `loading-xl`
|
|
1366
|
+
|
|
1367
|
+
#### Syntax
|
|
1368
|
+
|
|
1369
|
+
```html
|
|
1370
|
+
<span class="loading {MODIFIER}"></span>
|
|
1371
|
+
```
|
|
1372
|
+
|
|
1373
|
+
#### Rules
|
|
1374
|
+
|
|
1375
|
+
- {MODIFIER} is optional and can have one of the style/size class names
|
|
1376
|
+
|
|
1377
|
+
### mask
|
|
1378
|
+
|
|
1379
|
+
Mask crops the content of the element to common shapes
|
|
1380
|
+
|
|
1381
|
+
[mask docs](https://daisyui.com/components/mask/)
|
|
1382
|
+
|
|
1383
|
+
#### Class names
|
|
1384
|
+
|
|
1385
|
+
- component: `mask`
|
|
1386
|
+
- style: `mask-squircle`, `mask-heart`, `mask-hexagon`, `mask-hexagon-2`, `mask-decagon`, `mask-pentagon`, `mask-diamond`, `mask-square`, `mask-circle`, `mask-star`, `mask-star-2`, `mask-triangle`, `mask-triangle-2`, `mask-triangle-3`, `mask-triangle-4`
|
|
1387
|
+
- modifier: `mask-half-1`, `mask-half-2`
|
|
1388
|
+
|
|
1389
|
+
#### Syntax
|
|
1390
|
+
|
|
1391
|
+
```html
|
|
1392
|
+
<img class="mask {MODIFIER}" src="{image-url}" />
|
|
1393
|
+
```
|
|
1394
|
+
|
|
1395
|
+
#### Rules
|
|
1396
|
+
|
|
1397
|
+
- {MODIFIER} is required and can have one of the style/modifier class names
|
|
1398
|
+
- You can change the shape of any element using `mask` class names
|
|
1399
|
+
- You can set custom sizes using `w-*` and `h-*`
|
|
1400
|
+
|
|
1401
|
+
### menu
|
|
1402
|
+
|
|
1403
|
+
Menu is used to display a list of links vertically or horizontally
|
|
1404
|
+
|
|
1405
|
+
[menu docs](https://daisyui.com/components/menu/)
|
|
1406
|
+
|
|
1407
|
+
#### Class names
|
|
1408
|
+
|
|
1409
|
+
- component: `menu`
|
|
1410
|
+
- part: `menu-title`, `menu-dropdown`, `menu-dropdown-toggle`
|
|
1411
|
+
- modifier: `menu-disabled`, `menu-active`, `menu-focus`, `menu-dropdown-show`
|
|
1412
|
+
- size: `menu-xs`, `menu-sm`, `menu-md`, `menu-lg`, `menu-xl`
|
|
1413
|
+
- direction: `menu-vertical`, `menu-horizontal`
|
|
1414
|
+
|
|
1415
|
+
#### Syntax
|
|
1416
|
+
|
|
1417
|
+
Vertical menu:
|
|
1418
|
+
|
|
1419
|
+
```html
|
|
1420
|
+
<ul class="menu">
|
|
1421
|
+
<li><button>Item</button></li>
|
|
1422
|
+
</ul>
|
|
1423
|
+
```
|
|
1424
|
+
|
|
1425
|
+
Horizontal menu:
|
|
1426
|
+
|
|
1427
|
+
```html
|
|
1428
|
+
<ul class="menu menu-horizontal">
|
|
1429
|
+
<li><button>Item</button></li>
|
|
1430
|
+
</ul>
|
|
1431
|
+
```
|
|
1432
|
+
|
|
1433
|
+
#### Rules
|
|
1434
|
+
|
|
1435
|
+
- {MODIFIER} is optional and can have one of the modifier/size/direction class names
|
|
1436
|
+
- Use `lg:menu-horizontal` for responsive layouts
|
|
1437
|
+
- Use `menu-title` for list item title
|
|
1438
|
+
- Use `<details>` tag to make submenus collapsible
|
|
1439
|
+
- Use `menu-dropdown` and `menu-dropdown-toggle` to toggle the dropdown using JS
|
|
1440
|
+
|
|
1441
|
+
### mockup-browser
|
|
1442
|
+
|
|
1443
|
+
Browser mockup shows a box that looks like a browser window
|
|
1444
|
+
|
|
1445
|
+
[mockup-browser docs](https://daisyui.com/components/mockup-browser/)
|
|
1446
|
+
|
|
1447
|
+
#### Class names
|
|
1448
|
+
|
|
1449
|
+
- component: `mockup-browser`
|
|
1450
|
+
- part: `mockup-browser-toolbar`
|
|
1451
|
+
|
|
1452
|
+
#### Syntax
|
|
1453
|
+
|
|
1454
|
+
```html
|
|
1455
|
+
<div class="mockup-browser">
|
|
1456
|
+
<div class="mockup-browser-toolbar">{toolbar content}</div>
|
|
1457
|
+
<div>{CONTENT}</div>
|
|
1458
|
+
</div>
|
|
1459
|
+
```
|
|
1460
|
+
|
|
1461
|
+
#### Rules
|
|
1462
|
+
|
|
1463
|
+
- For a default mockup, use just `mockup-browser` class name
|
|
1464
|
+
- To set a URL in toolbar, add a div with `input` class
|
|
1465
|
+
|
|
1466
|
+
### mockup-code
|
|
1467
|
+
|
|
1468
|
+
Code mockup is used to show a block of code in a box that looks like a code editor
|
|
1469
|
+
|
|
1470
|
+
[mockup-code docs](https://daisyui.com/components/mockup-code/)
|
|
1471
|
+
|
|
1472
|
+
#### Class names
|
|
1473
|
+
|
|
1474
|
+
- component: `mockup-code`
|
|
1475
|
+
|
|
1476
|
+
#### Syntax
|
|
1477
|
+
|
|
1478
|
+
```html
|
|
1479
|
+
<div class="mockup-code">
|
|
1480
|
+
<pre data-prefix="$"><code>npm i daisyui</code></pre>
|
|
1481
|
+
</div>
|
|
1482
|
+
```
|
|
1483
|
+
|
|
1484
|
+
#### Rules
|
|
1485
|
+
|
|
1486
|
+
- Use `<pre data-prefix="{prefix}">` to show a prefix before each line
|
|
1487
|
+
- Use `<code>` tag to add code syntax highlighting (requires additional library)
|
|
1488
|
+
- To highlight a line, add background/text color
|
|
1489
|
+
|
|
1490
|
+
### mockup-phone
|
|
1491
|
+
|
|
1492
|
+
Phone mockup shows a mockup of an iPhone
|
|
1493
|
+
|
|
1494
|
+
[mockup-phone docs](https://daisyui.com/components/mockup-phone/)
|
|
1495
|
+
|
|
1496
|
+
#### Class names
|
|
1497
|
+
|
|
1498
|
+
- component: `mockup-phone`
|
|
1499
|
+
- part: `mockup-phone-camera`, `mockup-phone-display`
|
|
1500
|
+
|
|
1501
|
+
#### Syntax
|
|
1502
|
+
|
|
1503
|
+
```html
|
|
1504
|
+
<div class="mockup-phone">
|
|
1505
|
+
<div class="mockup-phone-camera"></div>
|
|
1506
|
+
<div class="mockup-phone-display">{CONTENT}</div>
|
|
1507
|
+
</div>
|
|
1508
|
+
```
|
|
1509
|
+
|
|
1510
|
+
#### Rules
|
|
1511
|
+
|
|
1512
|
+
- Inside `mockup-phone-display` you can add anything
|
|
1513
|
+
|
|
1514
|
+
### mockup-window
|
|
1515
|
+
|
|
1516
|
+
Window mockup shows a box that looks like an operating system window
|
|
1517
|
+
|
|
1518
|
+
[mockup-window docs](https://daisyui.com/components/mockup-window/)
|
|
1519
|
+
|
|
1520
|
+
#### Class names
|
|
1521
|
+
|
|
1522
|
+
- component: `mockup-window`
|
|
1523
|
+
|
|
1524
|
+
#### Syntax
|
|
1525
|
+
|
|
1526
|
+
```html
|
|
1527
|
+
<div class="mockup-window">
|
|
1528
|
+
<div>{CONTENT}</div>
|
|
1529
|
+
</div>
|
|
1530
|
+
```
|
|
1531
|
+
|
|
1532
|
+
### modal
|
|
1533
|
+
|
|
1534
|
+
Modal is used to show a dialog or a box when you click a button
|
|
1535
|
+
|
|
1536
|
+
[modal docs](https://daisyui.com/components/modal/)
|
|
1537
|
+
|
|
1538
|
+
#### Class names
|
|
1539
|
+
|
|
1540
|
+
- component: `modal`
|
|
1541
|
+
- part: `modal-box`, `modal-action`, `modal-backdrop`, `modal-toggle`
|
|
1542
|
+
- modifier: `modal-open`
|
|
1543
|
+
- placement: `modal-top`, `modal-middle`, `modal-bottom`, `modal-start`, `modal-end`
|
|
1544
|
+
|
|
1545
|
+
#### Syntax
|
|
1546
|
+
|
|
1547
|
+
Using HTML dialog element
|
|
1548
|
+
|
|
1549
|
+
```html
|
|
1550
|
+
<button onclick="my_modal.showModal()">Open modal</button>
|
|
1551
|
+
<dialog id="my_modal" class="modal">
|
|
1552
|
+
<div class="modal-box">{CONTENT}</div>
|
|
1553
|
+
<form method="dialog" class="modal-backdrop"><button>close</button></form>
|
|
1554
|
+
</dialog>
|
|
1555
|
+
```
|
|
1556
|
+
|
|
1557
|
+
Using checkbox (legacy)
|
|
1558
|
+
|
|
1559
|
+
```html
|
|
1560
|
+
<label for="my-modal" class="btn">Open modal</label>
|
|
1561
|
+
<input type="checkbox" id="my-modal" class="modal-toggle" />
|
|
1562
|
+
<div class="modal">
|
|
1563
|
+
<div class="modal-box">{CONTENT}</div>
|
|
1564
|
+
<label class="modal-backdrop" for="my-modal">Close</label>
|
|
1565
|
+
</div>
|
|
1566
|
+
```
|
|
1567
|
+
|
|
1568
|
+
Using anchor links (legacy)
|
|
1569
|
+
|
|
1570
|
+
```html
|
|
1571
|
+
<a href="#my-modal" class="btn">Open modal</a>
|
|
1572
|
+
<div class="modal" id="my-modal">
|
|
1573
|
+
<div class="modal-box">{CONTENT}</div>
|
|
1574
|
+
</div>
|
|
1575
|
+
```
|
|
1576
|
+
|
|
1577
|
+
#### Rules
|
|
1578
|
+
|
|
1579
|
+
- {MODIFIER} is optional and can have one of the modifier/placement class names
|
|
1580
|
+
- Add `tabindex="0"` to make modal focusable
|
|
1581
|
+
- Use unique IDs for each modal
|
|
1582
|
+
- For HTML dialog element modals, add `<form method="dialog">` for closing the modal with submit
|
|
1583
|
+
|
|
1584
|
+
### navbar
|
|
1585
|
+
|
|
1586
|
+
Navbar is used to show a navigation bar on the top of the page
|
|
1587
|
+
|
|
1588
|
+
[navbar docs](https://daisyui.com/components/navbar/)
|
|
1589
|
+
|
|
1590
|
+
#### Class names
|
|
1591
|
+
|
|
1592
|
+
- component: `navbar`
|
|
1593
|
+
- part: `navbar-start`, `navbar-center`, `navbar-end`
|
|
1594
|
+
|
|
1595
|
+
#### Syntax
|
|
1596
|
+
|
|
1597
|
+
```html
|
|
1598
|
+
<div class="navbar">{CONTENT}</div>
|
|
1599
|
+
```
|
|
1600
|
+
|
|
1601
|
+
#### Rules
|
|
1602
|
+
|
|
1603
|
+
- use `navbar-start`, `navbar-center`, `navbar-end` to position content horizontally
|
|
1604
|
+
- put anything inside each section
|
|
1605
|
+
- suggestion - use `base-200` for background color
|
|
1606
|
+
|
|
1607
|
+
### pagination
|
|
1608
|
+
|
|
1609
|
+
Pagination is a group of buttons
|
|
1610
|
+
|
|
1611
|
+
[pagination docs](https://daisyui.com/components/pagination/)
|
|
1612
|
+
|
|
1613
|
+
#### Class names
|
|
1614
|
+
|
|
1615
|
+
- component: `join`
|
|
1616
|
+
- part: `join-item`
|
|
1617
|
+
- direction: `join-vertical`, `join-horizontal`
|
|
1618
|
+
|
|
1619
|
+
#### Syntax
|
|
1620
|
+
|
|
1621
|
+
```html
|
|
1622
|
+
<div class="join">{CONTENT}</div>
|
|
1623
|
+
```
|
|
1624
|
+
|
|
1625
|
+
#### Rules
|
|
1626
|
+
|
|
1627
|
+
- Use `join-item` for each button or link inside the pagination
|
|
1628
|
+
- Use `btn` class for styling pagination items
|
|
1629
|
+
|
|
1630
|
+
### progress
|
|
1631
|
+
|
|
1632
|
+
Progress bar can be used to show the progress of a task or to show the passing of time
|
|
1633
|
+
|
|
1634
|
+
[progress docs](https://daisyui.com/components/progress/)
|
|
1635
|
+
|
|
1636
|
+
#### Class names
|
|
1637
|
+
|
|
1638
|
+
- component: `progress`
|
|
1639
|
+
- color: `progress-neutral`, `progress-primary`, `progress-secondary`, `progress-accent`, `progress-info`, `progress-success`, `progress-warning`, `progress-error`
|
|
1640
|
+
|
|
1641
|
+
#### Syntax
|
|
1642
|
+
|
|
1643
|
+
```html
|
|
1644
|
+
<progress class="progress {MODIFIER}" value="50" max="100"></progress>
|
|
1645
|
+
```
|
|
1646
|
+
|
|
1647
|
+
#### Rules
|
|
1648
|
+
|
|
1649
|
+
- {MODIFIER} is optional and can have one of the color class names
|
|
1650
|
+
- You must specify value and max attributes
|
|
1651
|
+
|
|
1652
|
+
### radial-progress
|
|
1653
|
+
|
|
1654
|
+
Radial progress can be used to show the progress of a task or to show the passing of time
|
|
1655
|
+
|
|
1656
|
+
[radial-progress docs](https://daisyui.com/components/radial-progress/)
|
|
1657
|
+
|
|
1658
|
+
#### Class names
|
|
1659
|
+
|
|
1660
|
+
- component: `radial-progress`
|
|
1661
|
+
|
|
1662
|
+
#### Syntax
|
|
1663
|
+
|
|
1664
|
+
```html
|
|
1665
|
+
<div class="radial-progress" style="--value:70;" aria-valuenow="70" role="progressbar">70%</div>
|
|
1666
|
+
```
|
|
1667
|
+
|
|
1668
|
+
#### Rules
|
|
1669
|
+
|
|
1670
|
+
- The `--value` CSS variable and text must be a number between 0 and 100
|
|
1671
|
+
- you need to add `aria-valuenow="{value}"`, `aria-valuenow={value}` so screen readers can properly read value and also show that its a progress element to them
|
|
1672
|
+
- Use `div` instead of progress because browsers can't show text inside progress tag
|
|
1673
|
+
- Use `--size` for setting size (default 5rem) and `--thickness` to set how thick the indicator is
|
|
1674
|
+
|
|
1675
|
+
### radio
|
|
1676
|
+
|
|
1677
|
+
Radio buttons allow the user to select one option
|
|
1678
|
+
|
|
1679
|
+
[radio docs](https://daisyui.com/components/radio/)
|
|
1680
|
+
|
|
1681
|
+
#### Class names
|
|
1682
|
+
|
|
1683
|
+
- component: `radio`
|
|
1684
|
+
- color: `radio-neutral`, `radio-primary`, `radio-secondary`, `radio-accent`, `radio-success`, `radio-warning`, `radio-info`, `radio-error`
|
|
1685
|
+
- size: `radio-xs`, `radio-sm`, `radio-md`, `radio-lg`, `radio-xl`
|
|
1686
|
+
|
|
1687
|
+
#### Syntax
|
|
1688
|
+
|
|
1689
|
+
```html
|
|
1690
|
+
<input type="radio" name="{name}" class="radio {MODIFIER}" />
|
|
1691
|
+
```
|
|
1692
|
+
|
|
1693
|
+
#### Rules
|
|
1694
|
+
|
|
1695
|
+
- {MODIFIER} is optional and can have one of the size/color class names
|
|
1696
|
+
- Replace {name} with a unique name for the radio group
|
|
1697
|
+
- Each set of radio inputs should have unique `name` attributes to avoid conflicts with other sets of radio inputs on the same page
|
|
1698
|
+
|
|
1699
|
+
### range
|
|
1700
|
+
|
|
1701
|
+
Range slider is used to select a value by sliding a handle
|
|
1702
|
+
|
|
1703
|
+
[range docs](https://daisyui.com/components/range/)
|
|
1704
|
+
|
|
1705
|
+
#### Class names
|
|
1706
|
+
|
|
1707
|
+
- component: `range`
|
|
1708
|
+
- color: `range-neutral`, `range-primary`, `range-secondary`, `range-accent`, `range-success`, `range-warning`, `range-info`, `range-error`
|
|
1709
|
+
- size: `range-xs`, `range-sm`, `range-md`, `range-lg`, `range-xl`
|
|
1710
|
+
|
|
1711
|
+
#### Syntax
|
|
1712
|
+
|
|
1713
|
+
```html
|
|
1714
|
+
<input type="range" min="0" max="100" value="40" class="range {MODIFIER}" />
|
|
1715
|
+
```
|
|
1716
|
+
|
|
1717
|
+
#### Rules
|
|
1718
|
+
|
|
1719
|
+
- {MODIFIER} is optional and can have one of each color/size class names
|
|
1720
|
+
- You must specify `min` and `max` attributes
|
|
1721
|
+
|
|
1722
|
+
### rating
|
|
1723
|
+
|
|
1724
|
+
Rating is a set of radio buttons that allow the user to rate something
|
|
1725
|
+
|
|
1726
|
+
[rating docs](https://daisyui.com/components/rating/)
|
|
1727
|
+
|
|
1728
|
+
#### Class names
|
|
1729
|
+
|
|
1730
|
+
- component: `rating`
|
|
1731
|
+
- modifier: `rating-half`, `rating-hidden`
|
|
1732
|
+
- size: `rating-xs`, `rating-sm`, `rating-md`, `rating-lg`, `rating-xl`
|
|
1733
|
+
|
|
1734
|
+
#### Syntax
|
|
1735
|
+
|
|
1736
|
+
```html
|
|
1737
|
+
<div class="rating {MODIFIER}">
|
|
1738
|
+
<input type="radio" name="rating-1" class="mask mask-star" />
|
|
1739
|
+
</div>
|
|
1740
|
+
```
|
|
1741
|
+
|
|
1742
|
+
#### Rules
|
|
1743
|
+
|
|
1744
|
+
- {MODIFIER} is optional and can have one of the modifier/size class names
|
|
1745
|
+
- Each set of rating inputs should have unique `name` attributes to avoid conflicts with other ratings on the same page
|
|
1746
|
+
- Add `rating-hidden` for the first radio to make it hidden so user can clear the rating
|
|
1747
|
+
|
|
1748
|
+
### select
|
|
1749
|
+
|
|
1750
|
+
Select is used to pick a value from a list of options
|
|
1751
|
+
|
|
1752
|
+
[select docs](https://daisyui.com/components/select/)
|
|
1753
|
+
|
|
1754
|
+
#### Class names
|
|
1755
|
+
|
|
1756
|
+
- component: `select`
|
|
1757
|
+
- style: `select-ghost`
|
|
1758
|
+
- color: `select-neutral`, `select-primary`, `select-secondary`, `select-accent`, `select-info`, `select-success`, `select-warning`, `select-error`
|
|
1759
|
+
- size: `select-xs`, `select-sm`, `select-md`, `select-lg`, `select-xl`
|
|
1760
|
+
|
|
1761
|
+
#### Syntax
|
|
1762
|
+
|
|
1763
|
+
```html
|
|
1764
|
+
<select class="select {MODIFIER}">
|
|
1765
|
+
<option>Option</option>
|
|
1766
|
+
</select>
|
|
1767
|
+
```
|
|
1768
|
+
|
|
1769
|
+
#### Rules
|
|
1770
|
+
|
|
1771
|
+
- {MODIFIER} is optional and can have one of each style/color/size class names
|
|
1772
|
+
|
|
1773
|
+
### skeleton
|
|
1774
|
+
|
|
1775
|
+
Skeleton is a component that can be used to show a loading state
|
|
1776
|
+
|
|
1777
|
+
[skeleton docs](https://daisyui.com/components/skeleton/)
|
|
1778
|
+
|
|
1779
|
+
#### Class names
|
|
1780
|
+
|
|
1781
|
+
- component: `skeleton`
|
|
1782
|
+
- modifier: `skeleton-text`
|
|
1783
|
+
|
|
1784
|
+
#### Syntax
|
|
1785
|
+
|
|
1786
|
+
```html
|
|
1787
|
+
<div class="skeleton"></div>
|
|
1788
|
+
```
|
|
1789
|
+
|
|
1790
|
+
Example with text skeleton:
|
|
1791
|
+
|
|
1792
|
+
```html
|
|
1793
|
+
<div class="skeleton skeleton-text">Loading data...</div>
|
|
1794
|
+
```
|
|
1795
|
+
|
|
1796
|
+
#### Rules
|
|
1797
|
+
|
|
1798
|
+
- Add `h-*` and `w-*` utility classes to set height and width
|
|
1799
|
+
|
|
1800
|
+
### stack
|
|
1801
|
+
|
|
1802
|
+
Stack visually puts elements on top of each other
|
|
1803
|
+
|
|
1804
|
+
[stack docs](https://daisyui.com/components/stack/)
|
|
1805
|
+
|
|
1806
|
+
#### Class Names:
|
|
1807
|
+
|
|
1808
|
+
- Component: `stack`
|
|
1809
|
+
- Modifier: `stack-top`, `stack-bottom`, `stack-start`, `stack-end`
|
|
1810
|
+
|
|
1811
|
+
#### Syntax
|
|
1812
|
+
|
|
1813
|
+
```html
|
|
1814
|
+
<div class="stack {MODIFIER}">{CONTENT}</div>
|
|
1815
|
+
```
|
|
1816
|
+
|
|
1817
|
+
#### Rules
|
|
1818
|
+
|
|
1819
|
+
- {MODIFIER} is optional and can have one of the modifier class names
|
|
1820
|
+
- You can use `w-*` and `h-*` classes to set the width and height of the stack, making all items the same size
|
|
1821
|
+
|
|
1822
|
+
### stat
|
|
1823
|
+
|
|
1824
|
+
Stat is used to show numbers and data in a block
|
|
1825
|
+
|
|
1826
|
+
[stat docs](https://daisyui.com/components/stat/)
|
|
1827
|
+
|
|
1828
|
+
#### Class names
|
|
1829
|
+
|
|
1830
|
+
- Component: `stats`
|
|
1831
|
+
- Part: `stat`, `stat-title`, `stat-value`, `stat-desc`, `stat-figure`, `stat-actions`
|
|
1832
|
+
- Direction: `stats-horizontal`, `stats-vertical`
|
|
1833
|
+
|
|
1834
|
+
#### Syntax
|
|
1835
|
+
|
|
1836
|
+
```html
|
|
1837
|
+
<div class="stats {MODIFIER}">
|
|
1838
|
+
<div class="stat">{CONTENT}</div>
|
|
1839
|
+
</div>
|
|
1840
|
+
```
|
|
1841
|
+
|
|
1842
|
+
#### Rules
|
|
1843
|
+
|
|
1844
|
+
- {MODIFIER} is optional and can have one of the direction class names
|
|
1845
|
+
- It's horizontal by default but you can make it vertical with the `stats-vertical` class
|
|
1846
|
+
- Content includes `stat-title`, `stat-value`, `stat-desc` inside a `stat`
|
|
1847
|
+
|
|
1848
|
+
### status
|
|
1849
|
+
|
|
1850
|
+
Status is a really small icon to visually show the current status of an element, like online, offline, error, etc
|
|
1851
|
+
|
|
1852
|
+
[status docs](https://daisyui.com/components/status/)
|
|
1853
|
+
|
|
1854
|
+
#### Class Names:
|
|
1855
|
+
|
|
1856
|
+
- Component: `status`
|
|
1857
|
+
- Color: `status-neutral`, `status-primary`, `status-secondary`, `status-accent`, `status-info`, `status-success`, `status-warning`, `status-error`
|
|
1858
|
+
- Size: `status-xs`, `status-sm`, `status-md`, `status-lg`, `status-xl`
|
|
1859
|
+
|
|
1860
|
+
#### Syntax
|
|
1861
|
+
|
|
1862
|
+
```html
|
|
1863
|
+
<span class="status {MODIFIER}"></span>
|
|
1864
|
+
```
|
|
1865
|
+
|
|
1866
|
+
#### Rules
|
|
1867
|
+
|
|
1868
|
+
- {MODIFIER} is optional and can have one of the color/size class names
|
|
1869
|
+
- This component does not render anything visible
|
|
1870
|
+
|
|
1871
|
+
### steps
|
|
1872
|
+
|
|
1873
|
+
Steps can be used to show a list of steps in a process
|
|
1874
|
+
|
|
1875
|
+
[steps docs](https://daisyui.com/components/steps/)
|
|
1876
|
+
|
|
1877
|
+
#### Class Names:
|
|
1878
|
+
|
|
1879
|
+
- Component: `steps`
|
|
1880
|
+
- Part: `step`, `step-icon`
|
|
1881
|
+
- Color: `step-neutral`, `step-primary`, `step-secondary`, `step-accent`, `step-info`, `step-success`, `step-warning`, `step-error`
|
|
1882
|
+
- Direction: `steps-vertical`, `steps-horizontal`
|
|
1883
|
+
|
|
1884
|
+
#### Syntax
|
|
1885
|
+
|
|
1886
|
+
```html
|
|
1887
|
+
<ul class="steps {MODIFIER}">
|
|
1888
|
+
<li class="step">{step content}</li>
|
|
1889
|
+
</ul>
|
|
1890
|
+
```
|
|
1891
|
+
|
|
1892
|
+
#### Rules
|
|
1893
|
+
|
|
1894
|
+
- {MODIFIER} is optional and can have one of each direction/color class names
|
|
1895
|
+
- To make a step active, add the `step-primary` class
|
|
1896
|
+
- You can add an icon in each step using `step-icon` class
|
|
1897
|
+
- To display data in `data-content` ,use `data-content="{value}"` at the `<li>`
|
|
1898
|
+
|
|
1899
|
+
### swap
|
|
1900
|
+
|
|
1901
|
+
Swap allows you to toggle the visibility of two elements using a checkbox or a class name
|
|
1902
|
+
|
|
1903
|
+
[swap docs](https://daisyui.com/components/swap/)
|
|
1904
|
+
|
|
1905
|
+
#### Class Names:
|
|
1906
|
+
|
|
1907
|
+
- Component: `swap`
|
|
1908
|
+
- Part: `swap-on`, `swap-off`, `swap-indeterminate`
|
|
1909
|
+
- Modifier: `swap-active`
|
|
1910
|
+
- Style: `swap-rotate`, `swap-flip`
|
|
1911
|
+
|
|
1912
|
+
#### Syntax
|
|
1913
|
+
|
|
1914
|
+
Using checkbox
|
|
1915
|
+
|
|
1916
|
+
```html
|
|
1917
|
+
<label class="swap {MODIFIER}">
|
|
1918
|
+
<input type="checkbox" />
|
|
1919
|
+
<div class="swap-on">{content when active}</div>
|
|
1920
|
+
<div class="swap-off">{content when inactive}</div>
|
|
1921
|
+
</label>
|
|
1922
|
+
```
|
|
1923
|
+
|
|
1924
|
+
Using class name
|
|
1925
|
+
|
|
1926
|
+
```html
|
|
1927
|
+
<div class="swap {MODIFIER}">
|
|
1928
|
+
<div class="swap-on">{content when active}</div>
|
|
1929
|
+
<div class="swap-off">{content when inactive}</div>
|
|
1930
|
+
</div>
|
|
1931
|
+
```
|
|
1932
|
+
|
|
1933
|
+
#### Rules
|
|
1934
|
+
|
|
1935
|
+
- {MODIFIER} is optional and can have one of the modifier/style class names
|
|
1936
|
+
- Use only a hidden checkbox to control swap state or add/remove the `swap-active` class using JS to control state
|
|
1937
|
+
- To show something when the checkbox is indeterminate, use `swap-indeterminate` class
|
|
1938
|
+
|
|
1939
|
+
### tab
|
|
1940
|
+
|
|
1941
|
+
Tabs can be used to show a list of links in a tabbed format
|
|
1942
|
+
|
|
1943
|
+
[tab docs](https://daisyui.com/components/tab/)
|
|
1944
|
+
|
|
1945
|
+
#### Class Names:
|
|
1946
|
+
|
|
1947
|
+
- Component: `tabs`
|
|
1948
|
+
- Part: `tab`, `tab-content`
|
|
1949
|
+
- Style: `tabs-box`, `tabs-border`, `tabs-lift`
|
|
1950
|
+
- Modifier: `tab-active`, `tab-disabled`
|
|
1951
|
+
- Placement: `tabs-top`, `tabs-bottom`
|
|
1952
|
+
|
|
1953
|
+
#### Syntax
|
|
1954
|
+
|
|
1955
|
+
Using buttons:
|
|
1956
|
+
|
|
1957
|
+
```html
|
|
1958
|
+
<div role="tablist" class="tabs {MODIFIER}">
|
|
1959
|
+
<button role="tab" class="tab">Tab</button>
|
|
1960
|
+
</div>
|
|
1961
|
+
```
|
|
1962
|
+
|
|
1963
|
+
Using radio inputs:
|
|
1964
|
+
|
|
1965
|
+
```html
|
|
1966
|
+
<div role="tablist" class="tabs tabs-box">
|
|
1967
|
+
<input type="radio" name="my_tabs" class="tab" aria-label="Tab" />
|
|
1968
|
+
</div>
|
|
1969
|
+
```
|
|
1970
|
+
|
|
1971
|
+
#### Rules
|
|
1972
|
+
|
|
1973
|
+
- {MODIFIER} is optional and can have one of the style/size class names
|
|
1974
|
+
- Radio inputs are needed for tab content to work with tab click
|
|
1975
|
+
- If tabs gets a background then every tab inside it becomes rounded from both top corners
|
|
1976
|
+
|
|
1977
|
+
### table
|
|
1978
|
+
|
|
1979
|
+
Table can be used to show a list of data in a table format
|
|
1980
|
+
|
|
1981
|
+
[table docs](https://daisyui.com/components/table/)
|
|
1982
|
+
|
|
1983
|
+
#### Class Names:
|
|
1984
|
+
|
|
1985
|
+
- Component: `table`
|
|
1986
|
+
- Modifier: `table-zebra`, `table-pin-rows`, `table-pin-cols`
|
|
1987
|
+
- Size: `table-xs`, `table-sm`, `table-md`, `table-lg`, `table-xl`
|
|
1988
|
+
|
|
1989
|
+
#### Syntax
|
|
1990
|
+
|
|
1991
|
+
```html
|
|
1992
|
+
<div class="overflow-x-auto">
|
|
1993
|
+
<table class="table {MODIFIER}">
|
|
1994
|
+
<thead>
|
|
1995
|
+
<tr>
|
|
1996
|
+
<th></th>
|
|
1997
|
+
</tr>
|
|
1998
|
+
</thead>
|
|
1999
|
+
<tbody>
|
|
2000
|
+
<tr>
|
|
2001
|
+
<th></th>
|
|
2002
|
+
</tr>
|
|
2003
|
+
</tbody>
|
|
2004
|
+
</table>
|
|
2005
|
+
</div>
|
|
2006
|
+
```
|
|
2007
|
+
|
|
2008
|
+
#### Rules
|
|
2009
|
+
|
|
2010
|
+
- {MODIFIER} is optional and can have one of each modifier/size class names
|
|
2011
|
+
- The `overflow-x-auto` class is added to the wrapper div to make the table horizontally scrollable on smaller screens
|
|
2012
|
+
|
|
2013
|
+
### text-rotate
|
|
2014
|
+
|
|
2015
|
+
Text Rotate can show up to 6 lines of text, one at a time, with a an infinite loop animation. Duration is 10 seconds by default. The animation will pause on hover.
|
|
2016
|
+
|
|
2017
|
+
[textarea docs](https://daisyui.com/components/text-rotate/)
|
|
2018
|
+
|
|
2019
|
+
#### Class Names:
|
|
2020
|
+
|
|
2021
|
+
- Component: `text-rotate`
|
|
2022
|
+
|
|
2023
|
+
#### Syntax
|
|
2024
|
+
|
|
2025
|
+
```html
|
|
2026
|
+
<span class="text-rotate">
|
|
2027
|
+
<span>
|
|
2028
|
+
<span>Word 1</span>
|
|
2029
|
+
<span>Word 2</span>
|
|
2030
|
+
<span>Word 3</span>
|
|
2031
|
+
<span>Word 4</span>
|
|
2032
|
+
<span>Word 5</span>
|
|
2033
|
+
<span>Word 6</span>
|
|
2034
|
+
</span>
|
|
2035
|
+
</span>
|
|
2036
|
+
```
|
|
2037
|
+
|
|
2038
|
+
Example:
|
|
2039
|
+
Big font size, horizontally centered
|
|
2040
|
+
|
|
2041
|
+
```html
|
|
2042
|
+
<span class="text-rotate max-md:text-3xl text-7xl font-title">
|
|
2043
|
+
<span class="justify-items-center">
|
|
2044
|
+
<span>DESIGN</span>
|
|
2045
|
+
<span>DEVELOP</span>
|
|
2046
|
+
<span>DEPLOY</span>
|
|
2047
|
+
<span>SCALE</span>
|
|
2048
|
+
<span>MAINTAIN</span>
|
|
2049
|
+
<span>REPEAT</span>
|
|
2050
|
+
</span>
|
|
2051
|
+
</span>
|
|
2052
|
+
```
|
|
2053
|
+
|
|
2054
|
+
Rotating words in a sentence, different colors for each word
|
|
2055
|
+
|
|
2056
|
+
```html
|
|
2057
|
+
<span>
|
|
2058
|
+
Providing AI Agents for
|
|
2059
|
+
<span class="text-rotate">
|
|
2060
|
+
<span>
|
|
2061
|
+
<span class="bg-teal-400 text-teal-800 px-2">Designers</span>
|
|
2062
|
+
<span class="bg-red-400 text-red-800 px-2">Developers</span>
|
|
2063
|
+
<span class="bg-blue-400 text-blue-800 px-2">Managers</span>
|
|
2064
|
+
</span>
|
|
2065
|
+
</span>
|
|
2066
|
+
</span>
|
|
2067
|
+
```
|
|
2068
|
+
|
|
2069
|
+
Custom line height in case you have a tall font or need more vertical spacing between lines
|
|
2070
|
+
|
|
2071
|
+
```html
|
|
2072
|
+
<span class="text-rotate max-md:text-3xl text-7xl font-title leading-[2]">
|
|
2073
|
+
<span class="justify-items-center">
|
|
2074
|
+
<span>📐 DESIGN</span>
|
|
2075
|
+
<span>⌨️ DEVELOP</span>
|
|
2076
|
+
<span>🌎 DEPLOY</span>
|
|
2077
|
+
<span>🌱 SCALE</span>
|
|
2078
|
+
<span>🔧 MAINTAIN</span>
|
|
2079
|
+
<span>♻️ REPEAT</span>
|
|
2080
|
+
</span>
|
|
2081
|
+
</span>
|
|
2082
|
+
```
|
|
2083
|
+
|
|
2084
|
+
#### Rules
|
|
2085
|
+
|
|
2086
|
+
- `text-rotate` must have one span or div inside it that contains 2 to 6 spans/divs for each line of text
|
|
2087
|
+
- Total duration of the loop is 10000 milliseconds by default
|
|
2088
|
+
- You can set custom duration using `duration-{value}` utility class, where value is in milliseconds (e.g. `duration-12000` for 12 seconds)
|
|
2089
|
+
|
|
2090
|
+
### textarea
|
|
2091
|
+
|
|
2092
|
+
Textarea allows users to enter text in multiple lines
|
|
2093
|
+
|
|
2094
|
+
[textarea docs](https://daisyui.com/components/textarea/)
|
|
2095
|
+
|
|
2096
|
+
#### Class Names:
|
|
2097
|
+
|
|
2098
|
+
- Component: `textarea`
|
|
2099
|
+
- Style: `textarea-ghost`
|
|
2100
|
+
- Color: `textarea-neutral`, `textarea-primary`, `textarea-secondary`, `textarea-accent`, `textarea-info`, `textarea-success`, `textarea-warning`, `textarea-error`
|
|
2101
|
+
- Size: `textarea-xs`, `textarea-sm`, `textarea-md`, `textarea-lg`, `textarea-xl`
|
|
2102
|
+
|
|
2103
|
+
#### Syntax
|
|
2104
|
+
|
|
2105
|
+
```html
|
|
2106
|
+
<textarea class="textarea {MODIFIER}" placeholder="Bio"></textarea>
|
|
2107
|
+
```
|
|
2108
|
+
|
|
2109
|
+
#### Rules
|
|
2110
|
+
|
|
2111
|
+
- {MODIFIER} is optional and can have one of each style/color/size class names
|
|
2112
|
+
|
|
2113
|
+
### theme-controller
|
|
2114
|
+
|
|
2115
|
+
If a checked checkbox input or a checked radio input with theme-controller class exists in the page, The page will have the same theme as that input's value
|
|
2116
|
+
|
|
2117
|
+
[theme-controller docs](https://daisyui.com/components/theme-controller/)
|
|
2118
|
+
|
|
2119
|
+
#### Class names
|
|
2120
|
+
|
|
2121
|
+
- component: `theme-controller`
|
|
2122
|
+
|
|
2123
|
+
#### Syntax
|
|
2124
|
+
|
|
2125
|
+
```html
|
|
2126
|
+
<input type="checkbox" value="{theme-name}" class="theme-controller" />
|
|
2127
|
+
```
|
|
2128
|
+
|
|
2129
|
+
#### Rules
|
|
2130
|
+
|
|
2131
|
+
- The value attribute of the input element should be a valid daisyUI theme name
|
|
2132
|
+
|
|
2133
|
+
### timeline
|
|
2134
|
+
|
|
2135
|
+
Timeline component shows a list of events in chronological order
|
|
2136
|
+
|
|
2137
|
+
[timeline docs](https://daisyui.com/components/timeline/)
|
|
2138
|
+
|
|
2139
|
+
#### Class Names:
|
|
2140
|
+
|
|
2141
|
+
- Component: `timeline`
|
|
2142
|
+
- Part: `timeline-start`, `timeline-middle`, `timeline-end`
|
|
2143
|
+
- Modifier: `timeline-snap-icon`, `timeline-box`, `timeline-compact`
|
|
2144
|
+
- Direction: `timeline-vertical`, `timeline-horizontal`
|
|
2145
|
+
|
|
2146
|
+
#### Syntax
|
|
2147
|
+
|
|
2148
|
+
```html
|
|
2149
|
+
<ul class="timeline {MODIFIER}">
|
|
2150
|
+
<li>
|
|
2151
|
+
<div class="timeline-start">{start}</div>
|
|
2152
|
+
<div class="timeline-middle">{icon}</div>
|
|
2153
|
+
<div class="timeline-end">{end}</div>
|
|
2154
|
+
</li>
|
|
2155
|
+
</ul>
|
|
2156
|
+
```
|
|
2157
|
+
|
|
2158
|
+
#### Rules
|
|
2159
|
+
|
|
2160
|
+
- {MODIFIER} is optional and can have one of the modifier/direction class names
|
|
2161
|
+
- To make a vertical timeline, add the `timeline-vertical` class to the `ul` element or just do nothing (because its the default style.)
|
|
2162
|
+
- Add `timeline-snap-icon` to snap the icon to the start instead of middle
|
|
2163
|
+
- Add the `timeline-compact` class to force all items on one side
|
|
2164
|
+
|
|
2165
|
+
### toast
|
|
2166
|
+
|
|
2167
|
+
Toast is a wrapper to stack elements, positioned on the corner of page
|
|
2168
|
+
|
|
2169
|
+
[toast docs](https://daisyui.com/components/toast/)
|
|
2170
|
+
|
|
2171
|
+
#### Class Names:
|
|
2172
|
+
|
|
2173
|
+
- Component: `toast`
|
|
2174
|
+
- Placement: `toast-start`, `toast-center`, `toast-end`, `toast-top`, `toast-middle`, `toast-bottom`
|
|
2175
|
+
|
|
2176
|
+
#### Syntax
|
|
2177
|
+
|
|
2178
|
+
```html
|
|
2179
|
+
<div class="toast {MODIFIER}">{CONTENT}</div>
|
|
2180
|
+
```
|
|
2181
|
+
|
|
2182
|
+
#### Rules
|
|
2183
|
+
|
|
2184
|
+
- {MODIFIER} is optional and can have one of the placement class names
|
|
2185
|
+
|
|
2186
|
+
### toggle
|
|
2187
|
+
|
|
2188
|
+
Toggle is a checkbox that is styled to look like a switch button
|
|
2189
|
+
|
|
2190
|
+
[toggle docs](https://daisyui.com/components/toggle/)
|
|
2191
|
+
|
|
2192
|
+
#### Class Names:
|
|
2193
|
+
|
|
2194
|
+
- Component: `toggle`
|
|
2195
|
+
- Color: `toggle-primary`, `toggle-secondary`, `toggle-accent`, `toggle-neutral`, `toggle-success`, `toggle-warning`, `toggle-info`, `toggle-error`
|
|
2196
|
+
- Size: `toggle-xs`, `toggle-sm`, `toggle-md`, `toggle-lg`, `toggle-xl`
|
|
2197
|
+
|
|
2198
|
+
#### Syntax
|
|
2199
|
+
|
|
2200
|
+
```html
|
|
2201
|
+
<input type="checkbox" class="toggle {MODIFIER}" />
|
|
2202
|
+
```
|
|
2203
|
+
|
|
2204
|
+
#### Rules
|
|
2205
|
+
|
|
2206
|
+
- {MODIFIER} is optional and can have one of each color/size class names
|
|
2207
|
+
|
|
2208
|
+
### validator
|
|
2209
|
+
|
|
2210
|
+
Validator class changes the color of form elements to error or success based on input's validation rules
|
|
2211
|
+
|
|
2212
|
+
[validator docs](https://daisyui.com/components/validator/)
|
|
2213
|
+
|
|
2214
|
+
#### Class names
|
|
2215
|
+
|
|
2216
|
+
- component: `validator`
|
|
2217
|
+
- part: `validator-hint`
|
|
2218
|
+
|
|
2219
|
+
#### Syntax
|
|
2220
|
+
|
|
2221
|
+
```html
|
|
2222
|
+
<input type="{type}" class="input validator" required />
|
|
2223
|
+
<p class="validator-hint">Error message</p>
|
|
2224
|
+
```
|
|
2225
|
+
|
|
2226
|
+
#### Rules
|
|
2227
|
+
|
|
2228
|
+
- Use with `input`, `select`, `textarea`
|