format project
This commit is contained in:
parent
7651afaa0b
commit
a6d4064af8
83 changed files with 942 additions and 536 deletions
|
|
@ -7,6 +7,7 @@ metadata:
|
||||||
---
|
---
|
||||||
|
|
||||||
# daisyUI 5
|
# daisyUI 5
|
||||||
|
|
||||||
daisyUI 5 is a CSS library for Tailwind CSS 4.
|
daisyUI 5 is a CSS library for Tailwind CSS 4.
|
||||||
daisyUI 5 provides class names for common UI components, semantic color names and themes.
|
daisyUI 5 provides class names for common UI components, semantic color names and themes.
|
||||||
|
|
||||||
|
|
@ -21,12 +22,12 @@ daisyUI 5 provides class names for common UI components, semantic color names an
|
||||||
## Mandatory reference
|
## Mandatory reference
|
||||||
|
|
||||||
| Task | Guide | Note |
|
| Task | Guide | Note |
|
||||||
|------|-------|------|
|
| ------------------------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
Installing daisyUI | [./install/SKILL.md](./install/SKILL.md) | Use only if daisyUI is not already installed in the project.
|
| Installing daisyUI | [./install/SKILL.md](./install/SKILL.md) | Use only if daisyUI is not already installed in the project. |
|
||||||
Using daisyUI class names | [./usage/SKILL.md](./usage/SKILL.md) | MANDATORY. Read this before using any daisyUI class names in the code.
|
| Using daisyUI class names | [./usage/SKILL.md](./usage/SKILL.md) | MANDATORY. Read this before using any daisyUI class names in the code. |
|
||||||
Configuring daisyUI | [./config/SKILL.md](./config/SKILL.md) | Use this if you need to configure daisyUI themes, prefix, logs, or other options. Not required for basic usage but important for advanced customization.
|
| Configuring daisyUI | [./config/SKILL.md](./config/SKILL.md) | Use this if you need to configure daisyUI themes, prefix, logs, or other options. Not required for basic usage but important for advanced customization. |
|
||||||
daisyUI colors and themes | [./colors/SKILL.md](./colors/SKILL.md) | MANDATORY. Read this to understand daisyUI color usage rules and how to use daisyUI colors in the code.
|
| daisyUI colors and themes | [./colors/SKILL.md](./colors/SKILL.md) | MANDATORY. Read this to understand daisyUI color usage rules and how to use daisyUI colors in the code. |
|
||||||
daisyUI components | [./components/](./components/) | MANDATORY. Read the relevant component docs when using daisyUI components in the code. Always read multiple candidate component docs before deciding which one to use.
|
| daisyUI components | [./components/](./components/) | MANDATORY. Read the relevant component docs when using daisyUI components in the code. Always read multiple candidate component docs before deciding which one to use. |
|
||||||
|
|
||||||
## List of components
|
## List of components
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ description: MANDATORY color usage rules for daisyUI 5
|
||||||
## daisyUI 5 colors
|
## daisyUI 5 colors
|
||||||
|
|
||||||
### daisyUI color names
|
### daisyUI color names
|
||||||
|
|
||||||
- `primary`: Primary brand color, The main color of your brand
|
- `primary`: Primary brand color, The main color of your brand
|
||||||
- `primary-content`: Foreground content color to use on primary color
|
- `primary-content`: Foreground content color to use on primary color
|
||||||
- `secondary`: Secondary brand color, The optional, secondary color of your brand
|
- `secondary`: Secondary brand color, The optional, secondary color of your brand
|
||||||
|
|
@ -28,6 +29,7 @@ description: MANDATORY color usage rules for daisyUI 5
|
||||||
- `error-content`: Foreground content color to use on error color
|
- `error-content`: Foreground content color to use on error color
|
||||||
|
|
||||||
### daisyUI color rules
|
### daisyUI color rules
|
||||||
|
|
||||||
1. daisyUI adds semantic color names to Tailwind CSS colors
|
1. daisyUI adds semantic color names to Tailwind CSS colors
|
||||||
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
|
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
|
||||||
3. daisyUI color names include variables as value so they can change based on the theme
|
3. daisyUI color names include variables as value so they can change based on the theme
|
||||||
|
|
@ -46,7 +48,10 @@ The default configuration enables `light` and `dark`. Choose specific themes, ev
|
||||||
|
|
||||||
```css
|
```css
|
||||||
@plugin "daisyui" {
|
@plugin "daisyui" {
|
||||||
themes: light --default, dark --prefersdark, cupcake;
|
themes:
|
||||||
|
light --default,
|
||||||
|
dark --prefersdark,
|
||||||
|
cupcake;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -63,12 +68,14 @@ The default configuration enables `light` and `dark`. Choose specific themes, ev
|
||||||
```
|
```
|
||||||
|
|
||||||
### daisyUI custom theme with custom colors
|
### daisyUI custom theme with custom colors
|
||||||
|
|
||||||
A CSS file with Tailwind CSS, daisyUI and a custom daisyUI theme looks like this:
|
A CSS file with Tailwind CSS, daisyUI and a custom daisyUI theme looks like this:
|
||||||
|
|
||||||
```css
|
```css
|
||||||
@import "tailwindcss";
|
@import 'tailwindcss';
|
||||||
@plugin "daisyui";
|
@plugin "daisyui";
|
||||||
@plugin "daisyui/theme" {
|
@plugin "daisyui/theme" {
|
||||||
name: "mytheme";
|
name: 'mytheme';
|
||||||
default: true; /* set as default */
|
default: true; /* set as default */
|
||||||
prefersdark: false; /* set as default dark mode (prefers-color-scheme:dark) */
|
prefersdark: false; /* set as default dark mode (prefers-color-scheme:dark) */
|
||||||
color-scheme: light; /* color of browser-provided UI */
|
color-scheme: light; /* color of browser-provided UI */
|
||||||
|
|
@ -108,7 +115,9 @@ A CSS file with Tailwind CSS, daisyUI and a custom daisyUI theme looks like this
|
||||||
--noise: 0; /* only 0 or 1 - Adds a subtle noise (grain) effect to components */
|
--noise: 0; /* only 0 or 1 - Adds a subtle noise (grain) effect to components */
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- All CSS variables above are required
|
- All CSS variables above are required
|
||||||
- Colors can be OKLCH or hex or other formats
|
- Colors can be OKLCH or hex or other formats
|
||||||
- If you're generating a custom theme, do not include the comments from the example above. Just provide the code.
|
- If you're generating a custom theme, do not include the comments from the example above. Just provide the code.
|
||||||
|
|
@ -121,7 +130,7 @@ Use the built-in theme's name and override only the values that need to change.
|
||||||
|
|
||||||
```css
|
```css
|
||||||
@plugin "daisyui/theme" {
|
@plugin "daisyui/theme" {
|
||||||
name: "light";
|
name: 'light';
|
||||||
default: true;
|
default: true;
|
||||||
--color-primary: blue;
|
--color-primary: blue;
|
||||||
--color-secondary: teal;
|
--color-secondary: teal;
|
||||||
|
|
@ -131,8 +140,8 @@ Use the built-in theme's name and override only the values that need to change.
|
||||||
For a custom CDN theme, define the same variables under a selector that matches the chosen `data-theme` and checked theme controller:
|
For a custom CDN theme, define the same variables under a selector that matches the chosen `data-theme` and checked theme controller:
|
||||||
|
|
||||||
```css
|
```css
|
||||||
:root:has(input.theme-controller[value=mytheme]:checked),
|
:root:has(input.theme-controller[value='mytheme']:checked),
|
||||||
[data-theme="mytheme"] {
|
[data-theme='mytheme'] {
|
||||||
color-scheme: light;
|
color-scheme: light;
|
||||||
--color-primary: oklch(55% 0.3 240);
|
--color-primary: oklch(55% 0.3 240);
|
||||||
/* define the remaining custom-theme variables */
|
/* define the remaining custom-theme variables */
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,23 @@
|
||||||
### accordion
|
### accordion
|
||||||
|
|
||||||
Accordion is used for showing and hiding content but only one item can stay open at a time
|
Accordion is used for showing and hiding content but only one item can stay open at a time
|
||||||
|
|
||||||
[accordion docs](https://daisyui.com/components/accordion/)
|
[accordion docs](https://daisyui.com/components/accordion/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `collapse`
|
- component: `collapse`
|
||||||
- part: `collapse-title`, `collapse-content`
|
- part: `collapse-title`, `collapse-content`
|
||||||
- modifier: `collapse-arrow`, `collapse-plus`, `collapse-open`, `collapse-close`
|
- modifier: `collapse-arrow`, `collapse-plus`, `collapse-open`, `collapse-close`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="collapse {MODIFIER}">{CONTENT}</div>
|
<div class="{MODIFIER} collapse">{CONTENT}</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
where content is:
|
where content is:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<input type="radio" name="{name}" checked="{checked}" />
|
<input type="radio" name="{name}" checked="{checked}" />
|
||||||
<div class="collapse-title">{title}</div>
|
<div class="collapse-title">{title}</div>
|
||||||
|
|
@ -20,6 +25,7 @@ where content is:
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of the modifier class names
|
- {MODIFIER} is optional and can have one of the modifier class names
|
||||||
- Accordion uses radio inputs. All radio inputs with the same name work together and only one of them can be open at a time
|
- Accordion uses radio inputs. All radio inputs with the same name work together and only one of them can be open at a time
|
||||||
- If you have more than one set of accordion items on a page, use different names for the radio inputs on each set
|
- If you have more than one set of accordion items on a page, use different names for the radio inputs on each set
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,23 @@
|
||||||
### alert
|
### alert
|
||||||
|
|
||||||
Alert informs users about important events
|
Alert informs users about important events
|
||||||
|
|
||||||
[alert docs](https://daisyui.com/components/alert/)
|
[alert docs](https://daisyui.com/components/alert/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `alert`
|
- component: `alert`
|
||||||
- style: `alert-outline`, `alert-dash`, `alert-soft`
|
- style: `alert-outline`, `alert-dash`, `alert-soft`
|
||||||
- color: `alert-info`, `alert-success`, `alert-warning`, `alert-error`
|
- color: `alert-info`, `alert-success`, `alert-warning`, `alert-error`
|
||||||
- direction: `alert-vertical`, `alert-horizontal`
|
- direction: `alert-vertical`, `alert-horizontal`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div role="alert" class="alert {MODIFIER}">{CONTENT}</div>
|
<div role="alert" class="alert {MODIFIER}">{CONTENT}</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of each style/color/direction class names
|
- {MODIFIER} is optional and can have one of each style/color/direction class names
|
||||||
- Add `sm:alert-horizontal` for responsive layouts
|
- Add `sm:alert-horizontal` for responsive layouts
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,22 @@
|
||||||
### aura
|
### aura
|
||||||
|
|
||||||
Aura is a border light effect that can wrap around any component. It is a great way to add a cool, eye-catching visual effect to your components. Aura is useful for the most important button, card, or div that you want to highlight.
|
Aura is a border light effect that can wrap around any component. It is a great way to add a cool, eye-catching visual effect to your components. Aura is useful for the most important button, card, or div that you want to highlight.
|
||||||
[aura docs](https://daisyui.com/components/aura/)
|
[aura docs](https://daisyui.com/components/aura/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `aura`
|
- component: `aura`
|
||||||
- style: `aura-dual`, `aura-rainbow`, `aura-holo`, `aura-gold`, `aura-silver`, `aura-glow`
|
- style: `aura-dual`, `aura-rainbow`, `aura-holo`, `aura-gold`, `aura-silver`, `aura-glow`
|
||||||
- size: `aura-xs`, `aura-sm`, `aura-md`, `aura-lg`, `aura-xl`
|
- size: `aura-xs`, `aura-sm`, `aura-md`, `aura-lg`, `aura-xl`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="aura {MODIFIER}">{CONTENT}</div>
|
<div class="aura {MODIFIER}">{CONTENT}</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of each style/size class names
|
- {MODIFIER} is optional and can have one of each style/size class names
|
||||||
- you can set custom colors using `text-*` color classes. For example, `text-primary` will use the primary color for the aura
|
- you can set custom colors using `text-*` color classes. For example, `text-primary` will use the primary color for the aura
|
||||||
- you can set custom background color using `bg-*` color classes. For example, `bg-secondary` will use the secondary color for the background of the aura
|
- you can set custom background color using `bg-*` color classes. For example, `bg-secondary` will use the secondary color for the background of the aura
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,16 @@
|
||||||
### avatar
|
### avatar
|
||||||
|
|
||||||
Avatars are used to show a thumbnail
|
Avatars are used to show a thumbnail
|
||||||
|
|
||||||
[avatar docs](https://daisyui.com/components/avatar/)
|
[avatar docs](https://daisyui.com/components/avatar/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `avatar`, `avatar-group`
|
- component: `avatar`, `avatar-group`
|
||||||
- modifier: `avatar-online`, `avatar-offline`, `avatar-placeholder`
|
- modifier: `avatar-online`, `avatar-offline`, `avatar-placeholder`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="avatar {MODIFIER}">
|
<div class="avatar {MODIFIER}">
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -17,6 +20,7 @@ Avatars are used to show a thumbnail
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of the modifier class names
|
- {MODIFIER} is optional and can have one of the modifier class names
|
||||||
- Use `avatar-group` for containing multiple avatars
|
- Use `avatar-group` for containing multiple avatars
|
||||||
- You can set custom sizes using `w-*` and `h-*`
|
- You can set custom sizes using `w-*` and `h-*`
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,24 @@
|
||||||
### badge
|
### badge
|
||||||
|
|
||||||
Badges are used to inform the user of the status of specific data
|
Badges are used to inform the user of the status of specific data
|
||||||
|
|
||||||
[badge docs](https://daisyui.com/components/badge/)
|
[badge docs](https://daisyui.com/components/badge/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `badge`
|
- component: `badge`
|
||||||
- style: `badge-outline`, `badge-dash`, `badge-soft`, `badge-ghost`
|
- style: `badge-outline`, `badge-dash`, `badge-soft`, `badge-ghost`
|
||||||
- color: `badge-neutral`, `badge-primary`, `badge-secondary`, `badge-accent`, `badge-info`, `badge-success`, `badge-warning`, `badge-error`
|
- color: `badge-neutral`, `badge-primary`, `badge-secondary`, `badge-accent`, `badge-info`, `badge-success`, `badge-warning`, `badge-error`
|
||||||
- size: `badge-xs`, `badge-sm`, `badge-md`, `badge-lg`, `badge-xl`
|
- size: `badge-xs`, `badge-sm`, `badge-md`, `badge-lg`, `badge-xl`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<span class="badge {MODIFIER}">Badge</span>
|
<span class="badge {MODIFIER}">Badge</span>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of each style/color/size class names
|
- {MODIFIER} is optional and can have one of each style/color/size class names
|
||||||
- Can be used inside text or buttons
|
- Can be used inside text or buttons
|
||||||
- To create an empty badge, just remove the text between the span tags
|
- To create an empty badge, just remove the text between the span tags
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,25 @@
|
||||||
### breadcrumbs
|
### breadcrumbs
|
||||||
|
|
||||||
Breadcrumbs helps users to navigate
|
Breadcrumbs helps users to navigate
|
||||||
|
|
||||||
[breadcrumbs docs](https://daisyui.com/components/breadcrumbs/)
|
[breadcrumbs docs](https://daisyui.com/components/breadcrumbs/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `breadcrumbs`
|
- component: `breadcrumbs`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="breadcrumbs">
|
<div class="breadcrumbs">
|
||||||
<ul><li><a>Link</a></li></ul>
|
<ul>
|
||||||
|
<li><a>Link</a></li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- breadcrumbs only has one main class name
|
- breadcrumbs only has one main class name
|
||||||
- Can contain icons inside the links
|
- Can contain icons inside the links
|
||||||
- If you set `max-width` or the list gets larger than the container it will scroll
|
- If you set `max-width` or the list gets larger than the container it will scroll
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
### button
|
### button
|
||||||
|
|
||||||
Buttons allow the user to take actions
|
Buttons allow the user to take actions
|
||||||
|
|
||||||
[button docs](https://daisyui.com/components/button/)
|
[button docs](https://daisyui.com/components/button/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `btn`
|
- component: `btn`
|
||||||
- color: `btn-neutral`, `btn-primary`, `btn-secondary`, `btn-accent`, `btn-info`, `btn-success`, `btn-warning`, `btn-error`
|
- color: `btn-neutral`, `btn-primary`, `btn-secondary`, `btn-accent`, `btn-info`, `btn-success`, `btn-warning`, `btn-error`
|
||||||
- style: `btn-outline`, `btn-dash`, `btn-soft`, `btn-ghost`, `btn-link`
|
- style: `btn-outline`, `btn-dash`, `btn-soft`, `btn-ghost`, `btn-link`
|
||||||
|
|
@ -12,10 +14,13 @@ Buttons allow the user to take actions
|
||||||
- modifier: `btn-wide`, `btn-block`, `btn-square`, `btn-circle`
|
- modifier: `btn-wide`, `btn-block`, `btn-square`, `btn-circle`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<button class="btn {MODIFIER}">Button</button>
|
<button class="btn {MODIFIER}">Button</button>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of each color/style/behavior/size/modifier class names
|
- {MODIFIER} is optional and can have one of each color/style/behavior/size/modifier class names
|
||||||
- btn can be used on any html tags such as `<button>`, `<a>`, `<input>`
|
- btn can be used on any html tags such as `<button>`, `<a>`, `<input>`
|
||||||
- btn can have an icon before or after the text
|
- btn can have an icon before or after the text
|
||||||
|
|
|
||||||
|
|
@ -32,10 +32,10 @@ For Vanilla Calendar Pro:
|
||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { Calendar } from "vanilla-calendar-pro"
|
import { Calendar } from 'vanilla-calendar-pro';
|
||||||
|
|
||||||
const calendar = new Calendar("#calendar")
|
const calendar = new Calendar('#calendar');
|
||||||
calendar.init()
|
calendar.init();
|
||||||
```
|
```
|
||||||
|
|
||||||
Or using CDN:
|
Or using CDN:
|
||||||
|
|
@ -44,11 +44,11 @@ Or using CDN:
|
||||||
<script src="https://cdn.jsdelivr.net/npm/vanilla-calendar-pro/index.js" defer></script>
|
<script src="https://cdn.jsdelivr.net/npm/vanilla-calendar-pro/index.js" defer></script>
|
||||||
<div id="calendar" class="vc"></div>
|
<div id="calendar" class="vc"></div>
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener("DOMContentLoaded", () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
const { Calendar } = window.VanillaCalendarPro
|
const { Calendar } = window.VanillaCalendarPro;
|
||||||
const calendar = new Calendar("#calendar")
|
const calendar = new Calendar('#calendar');
|
||||||
calendar.init()
|
calendar.init();
|
||||||
})
|
});
|
||||||
</script>
|
</script>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
### card
|
### card
|
||||||
|
|
||||||
Cards are used to group and display content
|
Cards are used to group and display content
|
||||||
|
|
||||||
[card docs](https://daisyui.com/components/card/)
|
[card docs](https://daisyui.com/components/card/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `card`
|
- component: `card`
|
||||||
- part: `card-title`, `card-body`, `card-actions`
|
- part: `card-title`, `card-body`, `card-actions`
|
||||||
- style: `card-border`, `card-dash`
|
- style: `card-border`, `card-dash`
|
||||||
|
|
@ -11,6 +13,7 @@ Cards are used to group and display content
|
||||||
- size: `card-xs`, `card-sm`, `card-md`, `card-lg`, `card-xl`
|
- size: `card-xs`, `card-sm`, `card-md`, `card-lg`, `card-xl`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="card {MODIFIER}">
|
<div class="card {MODIFIER}">
|
||||||
<figure><img src="{image-url}" alt="{alt-text}" /></figure>
|
<figure><img src="{image-url}" alt="{alt-text}" /></figure>
|
||||||
|
|
@ -23,6 +26,7 @@ Cards are used to group and display content
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of the modifier class names and one of the size class names
|
- {MODIFIER} is optional and can have one of the modifier class names and one of the size class names
|
||||||
- `<figure>` and `<div class="card-body">` are optional
|
- `<figure>` and `<div class="card-body">` are optional
|
||||||
- can use `sm:card-side` for responsive layouts
|
- can use `sm:card-side` for responsive layouts
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,24 @@
|
||||||
### carousel
|
### carousel
|
||||||
|
|
||||||
Carousel show images or content in a scrollable area
|
Carousel show images or content in a scrollable area
|
||||||
|
|
||||||
[carousel docs](https://daisyui.com/components/carousel/)
|
[carousel docs](https://daisyui.com/components/carousel/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `carousel`
|
- component: `carousel`
|
||||||
- part: `carousel-item`
|
- part: `carousel-item`
|
||||||
- modifier: `carousel-start`, `carousel-center`, `carousel-end`
|
- modifier: `carousel-start`, `carousel-center`, `carousel-end`
|
||||||
- direction: `carousel-horizontal`, `carousel-vertical`
|
- direction: `carousel-horizontal`, `carousel-vertical`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="carousel {MODIFIER}">{CONTENT}</div>
|
<div class="carousel {MODIFIER}">{CONTENT}</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of the modifier/direction class names
|
- {MODIFIER} is optional and can have one of the modifier/direction class names
|
||||||
- Content is a list of `carousel-item` divs: `<div class="carousel-item"></div>`
|
- Content is a list of `carousel-item` divs: `<div class="carousel-item"></div>`
|
||||||
- To create a full-width carousel, add `w-full` to each carousel item
|
- To create a full-width carousel, add `w-full` to each carousel item
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,18 @@
|
||||||
### chat
|
### chat
|
||||||
|
|
||||||
Chat bubbles are used to show one line of conversation and all its data, including the author image, author name, time, etc
|
Chat bubbles are used to show one line of conversation and all its data, including the author image, author name, time, etc
|
||||||
|
|
||||||
[chat docs](https://daisyui.com/components/chat/)
|
[chat docs](https://daisyui.com/components/chat/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `chat`
|
- component: `chat`
|
||||||
- part: `chat-image`, `chat-header`, `chat-footer`, `chat-bubble`
|
- part: `chat-image`, `chat-header`, `chat-footer`, `chat-bubble`
|
||||||
- placement: `chat-start`, `chat-end`
|
- placement: `chat-start`, `chat-end`
|
||||||
- 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`
|
- 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`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="chat {PLACEMENT}">
|
<div class="chat {PLACEMENT}">
|
||||||
<div class="chat-image"></div>
|
<div class="chat-image"></div>
|
||||||
|
|
@ -20,6 +23,7 @@ Chat bubbles are used to show one line of conversation and all its data, includi
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {PLACEMENT} is required and must be either `chat-start` or `chat-end`
|
- {PLACEMENT} is required and must be either `chat-start` or `chat-end`
|
||||||
- {COLOR} is optional and can have one of the color class names
|
- {COLOR} is optional and can have one of the color class names
|
||||||
- To add an avatar, use `<div class="chat-image avatar">` and nest the avatar content inside
|
- To add an avatar, use `<div class="chat-image avatar">` and nest the avatar content inside
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,21 @@
|
||||||
### checkbox
|
### checkbox
|
||||||
|
|
||||||
Checkboxes are used to select or deselect a value
|
Checkboxes are used to select or deselect a value
|
||||||
|
|
||||||
[checkbox docs](https://daisyui.com/components/checkbox/)
|
[checkbox docs](https://daisyui.com/components/checkbox/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `checkbox`
|
- component: `checkbox`
|
||||||
- color: `checkbox-primary`, `checkbox-secondary`, `checkbox-accent`, `checkbox-neutral`, `checkbox-success`, `checkbox-warning`, `checkbox-info`, `checkbox-error`
|
- color: `checkbox-primary`, `checkbox-secondary`, `checkbox-accent`, `checkbox-neutral`, `checkbox-success`, `checkbox-warning`, `checkbox-info`, `checkbox-error`
|
||||||
- size: `checkbox-xs`, `checkbox-sm`, `checkbox-md`, `checkbox-lg`, `checkbox-xl`
|
- size: `checkbox-xs`, `checkbox-sm`, `checkbox-md`, `checkbox-lg`, `checkbox-xl`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<input type="checkbox" class="checkbox {MODIFIER}" />
|
<input type="checkbox" class="checkbox {MODIFIER}" />
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of each color/size class names
|
- {MODIFIER} is optional and can have one of each color/size class names
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,26 @@
|
||||||
### collapse
|
### collapse
|
||||||
|
|
||||||
Collapse is used for showing and hiding content
|
Collapse is used for showing and hiding content
|
||||||
|
|
||||||
[collapse docs](https://daisyui.com/components/collapse/)
|
[collapse docs](https://daisyui.com/components/collapse/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `collapse`
|
- component: `collapse`
|
||||||
- part: `collapse-title`, `collapse-content`
|
- part: `collapse-title`, `collapse-content`
|
||||||
- modifier: `collapse-arrow`, `collapse-plus`, `collapse-open`, `collapse-close`
|
- modifier: `collapse-arrow`, `collapse-plus`, `collapse-open`, `collapse-close`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div tabindex="0" class="collapse {MODIFIER}">
|
<div tabindex="0" class="{MODIFIER} collapse">
|
||||||
<div class="collapse-title">{title}</div>
|
<div class="collapse-title">{title}</div>
|
||||||
<div class="collapse-content">{CONTENT}</div>
|
<div class="collapse-content">{CONTENT}</div>
|
||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of the modifier class names
|
- {MODIFIER} is optional and can have one of the modifier class names
|
||||||
- instead of `tabindex="0"`, you can use `<input type="checkbox">` as a first child
|
- instead of `tabindex="0"`, you can use `<input type="checkbox">` as a first child
|
||||||
- Can also be a details/summary tag
|
- Can also be a details/summary tag
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,15 @@
|
||||||
### countdown
|
### countdown
|
||||||
|
|
||||||
Countdown gives you a transition effect when you change a number between 0 to 999
|
Countdown gives you a transition effect when you change a number between 0 to 999
|
||||||
|
|
||||||
[countdown docs](https://daisyui.com/components/countdown/)
|
[countdown docs](https://daisyui.com/components/countdown/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `countdown`
|
- component: `countdown`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<span class="countdown">
|
<span class="countdown">
|
||||||
<span style="--value:{number};">number</span>
|
<span style="--value:{number};">number</span>
|
||||||
|
|
@ -14,6 +17,7 @@ Countdown gives you a transition effect when you change a number between 0 to 99
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- The `--value` CSS variable and text must be a number between 0 and 999
|
- The `--value` CSS variable and text must be a number between 0 and 999
|
||||||
- you need to change the span text and the `--value` CSS variable using JS
|
- you need to change the span text and the `--value` CSS variable using JS
|
||||||
- you need to add `aria-live="polite"` and `aria-label="{number}"` so screen readers can properly read changes
|
- you need to add `aria-live="polite"` and `aria-label="{number}"` so screen readers can properly read changes
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,16 @@
|
||||||
### diff
|
### diff
|
||||||
|
|
||||||
Diff component shows a side-by-side comparison of two items
|
Diff component shows a side-by-side comparison of two items
|
||||||
|
|
||||||
[diff docs](https://daisyui.com/components/diff/)
|
[diff docs](https://daisyui.com/components/diff/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `diff`
|
- component: `diff`
|
||||||
- part: `diff-item-1`, `diff-item-2`, `diff-resizer`
|
- part: `diff-item-1`, `diff-item-2`, `diff-resizer`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<figure class="diff">
|
<figure class="diff">
|
||||||
<div class="diff-item-1">{item1}</div>
|
<div class="diff-item-1">{item1}</div>
|
||||||
|
|
@ -17,4 +20,5 @@ Diff component shows a side-by-side comparison of two items
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- To maintain aspect ratio, add `aspect-16/9` or other aspect ratio classes to `<figure class="diff">` element
|
- To maintain aspect ratio, add `aspect-16/9` or other aspect ratio classes to `<figure class="diff">` element
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,23 @@
|
||||||
### divider
|
### divider
|
||||||
|
|
||||||
Divider will be used to separate content vertically or horizontally
|
Divider will be used to separate content vertically or horizontally
|
||||||
|
|
||||||
[divider docs](https://daisyui.com/components/divider/)
|
[divider docs](https://daisyui.com/components/divider/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `divider`
|
- component: `divider`
|
||||||
- color: `divider-neutral`, `divider-primary`, `divider-secondary`, `divider-accent`, `divider-success`, `divider-warning`, `divider-info`, `divider-error`
|
- color: `divider-neutral`, `divider-primary`, `divider-secondary`, `divider-accent`, `divider-success`, `divider-warning`, `divider-info`, `divider-error`
|
||||||
- direction: `divider-vertical`, `divider-horizontal`
|
- direction: `divider-vertical`, `divider-horizontal`
|
||||||
- placement: `divider-start`, `divider-end`
|
- placement: `divider-start`, `divider-end`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="divider {MODIFIER}">{text}</div>
|
<div class="divider {MODIFIER}">{text}</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of each direction/color/placement class names
|
- {MODIFIER} is optional and can have one of each direction/color/placement class names
|
||||||
- Omit text for a blank divider
|
- Omit text for a blank divider
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,24 @@
|
||||||
### dock
|
### dock
|
||||||
|
|
||||||
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
|
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
|
||||||
|
|
||||||
[dock docs](https://daisyui.com/components/dock/)
|
[dock docs](https://daisyui.com/components/dock/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `dock`
|
- component: `dock`
|
||||||
- part: `dock-label`
|
- part: `dock-label`
|
||||||
- modifier: `dock-active`
|
- modifier: `dock-active`
|
||||||
- size: `dock-xs`, `dock-sm`, `dock-md`, `dock-lg`, `dock-xl`
|
- size: `dock-xs`, `dock-sm`, `dock-md`, `dock-lg`, `dock-xl`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="dock {MODIFIER}">{CONTENT}</div>
|
<div class="dock {MODIFIER}">{CONTENT}</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
where content is a list of buttons:
|
where content is a list of buttons:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<button>
|
<button>
|
||||||
<svg>{icon}</svg>
|
<svg>{icon}</svg>
|
||||||
|
|
@ -22,6 +27,7 @@ where content is a list of buttons:
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of the size class names
|
- {MODIFIER} is optional and can have one of the size class names
|
||||||
- To make a button active, add `dock-active` class to the button
|
- To make a button active, add `dock-active` class to the button
|
||||||
- add `<meta name="viewport" content="viewport-fit=cover">` is required for responsiveness of the dock in iOS
|
- add `<meta name="viewport" content="viewport-fit=cover">` is required for responsiveness of the dock in iOS
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
### drawer
|
### drawer
|
||||||
|
|
||||||
Drawer is a grid layout that can show/hide a sidebar on the left or right side of the page
|
Drawer is a grid layout that can show/hide a sidebar on the left or right side of the page
|
||||||
|
|
||||||
[drawer docs](https://daisyui.com/components/drawer/)
|
[drawer docs](https://daisyui.com/components/drawer/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `drawer`
|
- component: `drawer`
|
||||||
- part: `drawer-toggle`, `drawer-content`, `drawer-side`, `drawer-overlay`, `drawer-button`
|
- part: `drawer-toggle`, `drawer-content`, `drawer-side`, `drawer-overlay`, `drawer-button`
|
||||||
- placement: `drawer-end`
|
- placement: `drawer-end`
|
||||||
|
|
@ -11,6 +13,7 @@ Drawer is a grid layout that can show/hide a sidebar on the left or right side o
|
||||||
- variant: `is-drawer-open:`, `is-drawer-close:`
|
- variant: `is-drawer-open:`, `is-drawer-close:`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="drawer {MODIFIER}">
|
<div class="drawer {MODIFIER}">
|
||||||
<input id="my-drawer" type="checkbox" class="drawer-toggle" />
|
<input id="my-drawer" type="checkbox" class="drawer-toggle" />
|
||||||
|
|
@ -18,27 +21,31 @@ Drawer is a grid layout that can show/hide a sidebar on the left or right side o
|
||||||
<div class="drawer-side">{SIDEBAR}</div>
|
<div class="drawer-side">{SIDEBAR}</div>
|
||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
where {CONTENT} can be navbar, site content, footer, etc
|
where {CONTENT} can be navbar, site content, footer, etc
|
||||||
and {SIDEBAR} can be a menu like:
|
and {SIDEBAR} can be a menu like:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<ul class="menu p-4 w-80 min-h-full bg-base-100 text-base-content">
|
<ul class="menu bg-base-100 text-base-content min-h-full w-80 p-4">
|
||||||
<li><a>Item 1</a></li>
|
<li><a>Item 1</a></li>
|
||||||
<li><a>Item 2</a></li>
|
<li><a>Item 2</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
```
|
```
|
||||||
|
|
||||||
To open/close the drawer, use a label that points to the `drawer-toggle` input:
|
To open/close the drawer, use a label that points to the `drawer-toggle` input:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<label for="my-drawer" class="btn drawer-button">Open/close drawer</label>
|
<label for="my-drawer" class="btn drawer-button">Open/close drawer</label>
|
||||||
```
|
```
|
||||||
|
|
||||||
Example: This sidebar is always visible on large screen, can be toggled on small screen:
|
Example: This sidebar is always visible on large screen, can be toggled on small screen:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="drawer lg:drawer-open">
|
<div class="drawer lg:drawer-open">
|
||||||
<input id="my-drawer-3" type="checkbox" class="drawer-toggle" />
|
<input id="my-drawer-3" type="checkbox" class="drawer-toggle" />
|
||||||
<div class="drawer-content flex flex-col items-center justify-center">
|
<div class="drawer-content flex flex-col items-center justify-center">
|
||||||
<!-- Page content here -->
|
<!-- Page content here -->
|
||||||
<label for="my-drawer-3" class="btn drawer-button lg:hidden">
|
<label for="my-drawer-3" class="btn drawer-button lg:hidden"> Open drawer </label>
|
||||||
Open drawer
|
|
||||||
</label>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="drawer-side">
|
<div class="drawer-side">
|
||||||
<label for="my-drawer-3" aria-label="close sidebar" class="drawer-overlay"></label>
|
<label for="my-drawer-3" aria-label="close sidebar" class="drawer-overlay"></label>
|
||||||
|
|
@ -52,6 +59,7 @@ Example: This sidebar is always visible on large screen, can be toggled on small
|
||||||
```
|
```
|
||||||
|
|
||||||
Example: This sidebar is always visible. When it's close we only see icons, when it's open we see icons and text
|
Example: This sidebar is always visible. When it's close we only see icons, when it's open we see icons and text
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="drawer lg:drawer-open">
|
<div class="drawer lg:drawer-open">
|
||||||
<input id="my-drawer-4" type="checkbox" class="drawer-toggle" />
|
<input id="my-drawer-4" type="checkbox" class="drawer-toggle" />
|
||||||
|
|
@ -60,7 +68,9 @@ Example: This sidebar is always visible. When it's close we only see icons, when
|
||||||
</div>
|
</div>
|
||||||
<div class="drawer-side is-drawer-close:overflow-visible">
|
<div class="drawer-side is-drawer-close:overflow-visible">
|
||||||
<label for="my-drawer-4" aria-label="close sidebar" class="drawer-overlay"></label>
|
<label for="my-drawer-4" aria-label="close sidebar" class="drawer-overlay"></label>
|
||||||
<div class="is-drawer-close:w-14 is-drawer-open:w-64 bg-base-200 flex flex-col items-start min-h-full">
|
<div
|
||||||
|
class="is-drawer-close:w-14 is-drawer-open:w-64 bg-base-200 flex min-h-full flex-col items-start"
|
||||||
|
>
|
||||||
<!-- Sidebar content here -->
|
<!-- Sidebar content here -->
|
||||||
<ul class="menu w-full grow">
|
<ul class="menu w-full grow">
|
||||||
<!-- list item -->
|
<!-- list item -->
|
||||||
|
|
@ -79,8 +89,11 @@ Example: This sidebar is always visible. When it's close we only see icons, when
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<!-- button to open/close drawer -->
|
<!-- button to open/close drawer -->
|
||||||
<div class="m-2 is-drawer-close:tooltip is-drawer-close:tooltip-right" data-tip="Open">
|
<div class="is-drawer-close:tooltip is-drawer-close:tooltip-right m-2" data-tip="Open">
|
||||||
<label for="my-drawer-4" class="btn btn-ghost btn-circle drawer-button is-drawer-open:rotate-y-180">
|
<label
|
||||||
|
for="my-drawer-4"
|
||||||
|
class="btn btn-ghost btn-circle drawer-button is-drawer-open:rotate-y-180"
|
||||||
|
>
|
||||||
{ICON_HERE}
|
{ICON_HERE}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -90,6 +103,7 @@ Example: This sidebar is always visible. When it's close we only see icons, when
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of the modifier/placement class names
|
- {MODIFIER} is optional and can have one of the modifier/placement class names
|
||||||
- `id` is required for the `drawer-toggle` input. change `my-drawer` to a unique id according to your needs
|
- `id` is required for the `drawer-toggle` input. change `my-drawer` to a unique id according to your needs
|
||||||
- `lg:drawer-open` can be used to make sidebar visible on larger screens
|
- `lg:drawer-open` can be used to make sidebar visible on larger screens
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
### dropdown
|
### dropdown
|
||||||
|
|
||||||
Dropdown can open a menu or any other element when the button is clicked
|
Dropdown can open a menu or any other element when the button is clicked
|
||||||
|
|
||||||
[dropdown docs](https://daisyui.com/components/dropdown/)
|
[dropdown docs](https://daisyui.com/components/dropdown/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `dropdown`
|
- component: `dropdown`
|
||||||
- part: `dropdown-content`
|
- part: `dropdown-content`
|
||||||
- placement: `dropdown-start`, `dropdown-center`, `dropdown-end`, `dropdown-top`, `dropdown-bottom`, `dropdown-left`, `dropdown-right`
|
- placement: `dropdown-start`, `dropdown-center`, `dropdown-end`, `dropdown-top`, `dropdown-bottom`, `dropdown-left`, `dropdown-right`
|
||||||
|
|
@ -12,20 +14,27 @@ Dropdown can open a menu or any other element when the button is clicked
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
Using popover API
|
Using popover API
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<button popovertarget="{id}" style="anchor-name:--{anchor}">{button}</button>
|
<button popovertarget="{id}" style="anchor-name:--{anchor}">{button}</button>
|
||||||
<ul class="dropdown" popover id="{id}" style="position-anchor:--{anchor}">{CONTENT}</ul>
|
<ul class="dropdown" popover id="{id}" style="position-anchor:--{anchor}">
|
||||||
|
{CONTENT}
|
||||||
|
</ul>
|
||||||
```
|
```
|
||||||
|
|
||||||
Using details and summary (only opens/closes on click)
|
Using details and summary (only opens/closes on click)
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<details class="dropdown">
|
<details class="dropdown">
|
||||||
<summary>Button</summary>
|
<summary>Button</summary>
|
||||||
<ul class="dropdown-content">{CONTENT}</ul>
|
<ul class="dropdown-content">
|
||||||
|
{CONTENT}
|
||||||
|
</ul>
|
||||||
</details>
|
</details>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of the modifier/placement class names
|
- {MODIFIER} is optional and can have one of the modifier/placement class names
|
||||||
- replace `{id}` and `{anchor}` with a unique name
|
- replace `{id}` and `{anchor}` with a unique name
|
||||||
- The content can be any HTML element (not just `<ul>`)
|
- The content can be any HTML element (not just `<ul>`)
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,27 @@
|
||||||
### fab
|
### fab
|
||||||
|
|
||||||
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)
|
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)
|
||||||
|
|
||||||
[fab docs](https://daisyui.com/components/fab/)
|
[fab docs](https://daisyui.com/components/fab/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `fab`
|
- component: `fab`
|
||||||
- part: `fab-close`, `fab-main-action`
|
- part: `fab-close`, `fab-main-action`
|
||||||
- modifier: `fab-flower`
|
- modifier: `fab-flower`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
A single FAB in the corner of screen
|
A single FAB in the corner of screen
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="fab">
|
<div class="fab">
|
||||||
<button class="btn btn-lg btn-circle">{IconOriginal}</button>
|
<button class="btn btn-lg btn-circle">{IconOriginal}</button>
|
||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
A FAB that opens a 3 other buttons in the corner of page vertically
|
A FAB that opens a 3 other buttons in the corner of page vertically
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="fab">
|
<div class="fab">
|
||||||
<div tabindex="0" role="button" class="btn btn-lg btn-circle btn-primary">{IconOriginal}</div>
|
<div tabindex="0" role="button" class="btn btn-lg btn-circle btn-primary">{IconOriginal}</div>
|
||||||
|
|
@ -24,7 +30,9 @@ A FAB that opens a 3 other buttons in the corner of page vertically
|
||||||
<button class="btn btn-lg btn-circle">{Icon3}</button>
|
<button class="btn btn-lg btn-circle">{Icon3}</button>
|
||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
A FAB that opens a 3 other buttons in the corner of page vertically and they have label text
|
A FAB that opens a 3 other buttons in the corner of page vertically and they have label text
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="fab">
|
<div class="fab">
|
||||||
<div tabindex="0" role="button" class="btn btn-lg btn-circle btn-primary">{IconOriginal}</div>
|
<div tabindex="0" role="button" class="btn btn-lg btn-circle btn-primary">{IconOriginal}</div>
|
||||||
|
|
@ -33,7 +41,9 @@ A FAB that opens a 3 other buttons in the corner of page vertically and they hav
|
||||||
<div>{Label3}<button class="btn btn-lg btn-circle">{Icon3}</button></div>
|
<div>{Label3}<button class="btn btn-lg btn-circle">{Icon3}</button></div>
|
||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
FAB with rectangle buttons. These are not circular buttons so they can have more content.
|
FAB with rectangle buttons. These are not circular buttons so they can have more content.
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="fab">
|
<div class="fab">
|
||||||
<div tabindex="0" role="button" class="btn btn-lg btn-circle btn-primary">{IconOriginal}</div>
|
<div tabindex="0" role="button" class="btn btn-lg btn-circle btn-primary">{IconOriginal}</div>
|
||||||
|
|
@ -42,7 +52,9 @@ FAB with rectangle buttons. These are not circular buttons so they can have more
|
||||||
<button class="btn btn-lg">{Label3}</button>
|
<button class="btn btn-lg">{Label3}</button>
|
||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
FAB with close button. When FAB is open, the original button is replaced with a close button
|
FAB with close button. When FAB is open, the original button is replaced with a close button
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="fab">
|
<div class="fab">
|
||||||
<div tabindex="0" role="button" class="btn btn-lg btn-circle btn-primary">{IconOriginal}</div>
|
<div tabindex="0" role="button" class="btn btn-lg btn-circle btn-primary">{IconOriginal}</div>
|
||||||
|
|
@ -52,7 +64,9 @@ FAB with close button. When FAB is open, the original button is replaced with a
|
||||||
<div>{Label3}<button class="btn btn-lg btn-circle">{Icon3}</button></div>
|
<div>{Label3}<button class="btn btn-lg btn-circle">{Icon3}</button></div>
|
||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
FAB with Main Action button. When FAB is open, the original button is replaced with a main action button
|
FAB with Main Action button. When FAB is open, the original button is replaced with a main action button
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="fab">
|
<div class="fab">
|
||||||
<div tabindex="0" role="button" class="btn btn-lg btn-circle btn-primary">{IconOriginal}</div>
|
<div tabindex="0" role="button" class="btn btn-lg btn-circle btn-primary">{IconOriginal}</div>
|
||||||
|
|
@ -64,7 +78,9 @@ FAB with Main Action button. When FAB is open, the original button is replaced w
|
||||||
<div>{Label3}<button class="btn btn-lg btn-circle">{Icon3}</button></div>
|
<div>{Label3}<button class="btn btn-lg btn-circle">{Icon3}</button></div>
|
||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
FAB Flower. It opens the buttons in a flower shape (quarter circle) arrangement instead of vertical
|
FAB Flower. It opens the buttons in a flower shape (quarter circle) arrangement instead of vertical
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="fab fab-flower">
|
<div class="fab fab-flower">
|
||||||
<div tabindex="0" role="button" class="btn btn-lg btn-circle btn-primary">{IconOriginal}</div>
|
<div tabindex="0" role="button" class="btn btn-lg btn-circle btn-primary">{IconOriginal}</div>
|
||||||
|
|
@ -74,7 +90,9 @@ FAB Flower. It opens the buttons in a flower shape (quarter circle) arrangement
|
||||||
<button class="btn btn-lg btn-circle">{Icon3}</button>
|
<button class="btn btn-lg btn-circle">{Icon3}</button>
|
||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
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
|
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
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="fab fab-flower">
|
<div class="fab fab-flower">
|
||||||
<div tabindex="0" role="button" class="btn btn-lg btn-circle btn-primary">{IconOriginal}</div>
|
<div tabindex="0" role="button" class="btn btn-lg btn-circle btn-primary">{IconOriginal}</div>
|
||||||
|
|
@ -90,9 +108,11 @@ FAB Flower with tooltips. There's no space for a text label in a quarter circle,
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
- {Icon*} should be replaced with the appropriate icon for each button. SVG icons are recommended
|
|
||||||
|
- {Icon\*} should be replaced with the appropriate icon for each button. SVG icons are recommended
|
||||||
- {IconOriginal} is the icon that we see before opening the FAB
|
- {IconOriginal} is the icon that we see before opening the FAB
|
||||||
- {IconMainAction} is the icon we see after opening the FAB
|
- {IconMainAction} is the icon we see after opening the FAB
|
||||||
- {Icon1}, {Icon2}, {Icon3} are the icons for the additional buttons
|
- {Icon1}, {Icon2}, {Icon3} are the icons for the additional buttons
|
||||||
- {Label*} is the label text for each button
|
- {Label\*} is the label text for each button
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,16 @@
|
||||||
### fieldset
|
### fieldset
|
||||||
|
|
||||||
Fieldset is a container for grouping related form elements. It includes fieldset-legend as a title and label as a description
|
Fieldset is a container for grouping related form elements. It includes fieldset-legend as a title and label as a description
|
||||||
|
|
||||||
[fieldset docs](https://daisyui.com/components/fieldset/)
|
[fieldset docs](https://daisyui.com/components/fieldset/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- Component: `fieldset`, `label`
|
- Component: `fieldset`, `label`
|
||||||
- Parts: `fieldset-legend`
|
- Parts: `fieldset-legend`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<fieldset class="fieldset">
|
<fieldset class="fieldset">
|
||||||
<legend class="fieldset-legend">{title}</legend>
|
<legend class="fieldset-legend">{title}</legend>
|
||||||
|
|
@ -17,4 +20,5 @@ Fieldset is a container for grouping related form elements. It includes fieldset
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- You can use any element as a direct child of fieldset to add form elements
|
- You can use any element as a direct child of fieldset to add form elements
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,22 @@
|
||||||
### file-input
|
### file-input
|
||||||
|
|
||||||
File Input is an input field for uploading files
|
File Input is an input field for uploading files
|
||||||
|
|
||||||
[file-input docs](https://daisyui.com/components/file-input/)
|
[file-input docs](https://daisyui.com/components/file-input/)
|
||||||
|
|
||||||
#### Class Names:
|
#### Class Names:
|
||||||
|
|
||||||
- Component: `file-input`
|
- Component: `file-input`
|
||||||
- Style: `file-input-ghost`
|
- Style: `file-input-ghost`
|
||||||
- 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`
|
- 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`
|
||||||
- Size: `file-input-xs`, `file-input-sm`, `file-input-md`, `file-input-lg`, `file-input-xl`
|
- Size: `file-input-xs`, `file-input-sm`, `file-input-md`, `file-input-lg`, `file-input-xl`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<input type="file" class="file-input {MODIFIER}" />
|
<input type="file" class="file-input {MODIFIER}" />
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of each style/color/size class names
|
- {MODIFIER} is optional and can have one of each style/color/size class names
|
||||||
|
|
|
||||||
|
|
@ -1,31 +1,38 @@
|
||||||
### filter
|
### filter
|
||||||
|
|
||||||
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
|
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
|
||||||
|
|
||||||
[filter docs](https://daisyui.com/components/filter/)
|
[filter docs](https://daisyui.com/components/filter/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `filter`
|
- component: `filter`
|
||||||
- part: `filter-reset`
|
- part: `filter-reset`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
Using HTML form
|
Using HTML form
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<form class="filter">
|
<form class="filter">
|
||||||
<input class="btn btn-square" type="reset" value="×"/>
|
<input class="btn btn-square" type="reset" value="×" />
|
||||||
<input class="btn" type="radio" name="{NAME}" aria-label="Tab 1 title"/>
|
<input class="btn" type="radio" name="{NAME}" aria-label="Tab 1 title" />
|
||||||
<input class="btn" type="radio" name="{NAME}" aria-label="Tab 2 title"/>
|
<input class="btn" type="radio" name="{NAME}" aria-label="Tab 2 title" />
|
||||||
</form>
|
</form>
|
||||||
```
|
```
|
||||||
|
|
||||||
Without HTML form
|
Without HTML form
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="filter">
|
<div class="filter">
|
||||||
<input class="btn filter-reset" type="radio" name="{NAME}" aria-label="×"/>
|
<input class="btn filter-reset" type="radio" name="{NAME}" aria-label="×" />
|
||||||
<input class="btn" type="radio" name="{NAME}" aria-label="Tab 1 title"/>
|
<input class="btn" type="radio" name="{NAME}" aria-label="Tab 1 title" />
|
||||||
<input class="btn" type="radio" name="{NAME}" aria-label="Tab 2 title"/>
|
<input class="btn" type="radio" name="{NAME}" aria-label="Tab 2 title" />
|
||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- replace `{NAME}` with proper value, according to the context of the filter
|
- replace `{NAME}` with proper value, according to the context of the filter
|
||||||
- Each set of radio inputs must have unique `name` attributes to avoid conflicts
|
- Each set of radio inputs must have unique `name` attributes to avoid conflicts
|
||||||
- Use `<form>` tag when possible and only use `<div>` if you can't use a HTML form for some reason
|
- Use `<form>` tag when possible and only use `<div>` if you can't use a HTML form for some reason
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,26 @@
|
||||||
### footer
|
### footer
|
||||||
|
|
||||||
Footer can contain logo, copyright notice, and links to other pages
|
Footer can contain logo, copyright notice, and links to other pages
|
||||||
|
|
||||||
[footer docs](https://daisyui.com/components/footer/)
|
[footer docs](https://daisyui.com/components/footer/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `footer`
|
- component: `footer`
|
||||||
- part: `footer-title`
|
- part: `footer-title`
|
||||||
- placement: `footer-center`
|
- placement: `footer-center`
|
||||||
- direction: `footer-horizontal`, `footer-vertical`
|
- direction: `footer-horizontal`, `footer-vertical`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<footer class="footer {MODIFIER}">{CONTENT}</footer>
|
<footer class="footer {MODIFIER}">{CONTENT}</footer>
|
||||||
```
|
```
|
||||||
|
|
||||||
where content can contain several `<nav>` tags with `footer-title` and links inside
|
where content can contain several `<nav>` tags with `footer-title` and links inside
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of each placement/direction class names
|
- {MODIFIER} is optional and can have one of each placement/direction class names
|
||||||
- try to use `sm:footer-horizontal` to make footer responsive
|
- try to use `sm:footer-horizontal` to make footer responsive
|
||||||
- suggestion - use `base-200` for background color
|
- suggestion - use `base-200` for background color
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,22 @@
|
||||||
### hero
|
### hero
|
||||||
|
|
||||||
Hero is a component for displaying a large box or image with a title and description
|
Hero is a component for displaying a large box or image with a title and description
|
||||||
|
|
||||||
[hero docs](https://daisyui.com/components/hero/)
|
[hero docs](https://daisyui.com/components/hero/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `hero`
|
- component: `hero`
|
||||||
- part: `hero-content`, `hero-overlay`
|
- part: `hero-content`, `hero-overlay`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="hero {MODIFIER}">{CONTENT}</div>
|
<div class="hero {MODIFIER}">{CONTENT}</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional
|
- {MODIFIER} is optional
|
||||||
- Use `hero-content` for the text content
|
- Use `hero-content` for the text content
|
||||||
- Use `hero-overlay` inside the hero to overlay the background image with a color
|
- Use `hero-overlay` inside the hero to overlay the background image with a color
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
### hover-3d
|
### hover-3d
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
`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.
|
`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.
|
||||||
|
|
@ -8,11 +9,13 @@ Only use non-interactive content inside the `hover-3d` wrapper. If you want to m
|
||||||
[hover-3d docs](https://daisyui.com/components/hover-3d/)
|
[hover-3d docs](https://daisyui.com/components/hover-3d/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `hover-3d`
|
- component: `hover-3d`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="hover-3d my-12 mx-2">
|
<div class="hover-3d mx-2 my-12">
|
||||||
<figure class="max-w-100 rounded-2xl">
|
<figure class="max-w-100 rounded-2xl">
|
||||||
<img src="https://img.daisyui.com/images/stock/creditcard.webp" alt="Tailwind CSS 3D card" />
|
<img src="https://img.daisyui.com/images/stock/creditcard.webp" alt="Tailwind CSS 3D card" />
|
||||||
</figure>
|
</figure>
|
||||||
|
|
@ -28,6 +31,7 @@ Only use non-interactive content inside the `hover-3d` wrapper. If you want to m
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- hover-3d can be a `<div>` or a `<a>`
|
- hover-3d can be a `<div>` or a `<a>`
|
||||||
- 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
|
- 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
|
||||||
- content inside hover-3d should be non-interactive (no buttons, links, inputs, etc)
|
- content inside hover-3d should be non-interactive (no buttons, links, inputs, etc)
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,15 @@
|
||||||
### hover-gallery
|
### hover-gallery
|
||||||
|
|
||||||
Hover Gallery is container of images. The first image is visible by default and when we hover it horizontally, other images show up. Hover Gallery is useful for product cards in ecommerce sites, portfolios or in image galleries. Hover Gallery can include up to 10 images.
|
Hover Gallery is container of images. The first image is visible by default and when we hover it horizontally, other images show up. Hover Gallery is useful for product cards in ecommerce sites, portfolios or in image galleries. Hover Gallery can include up to 10 images.
|
||||||
|
|
||||||
[hover-gallery docs](https://daisyui.com/components/hover-gallery/)
|
[hover-gallery docs](https://daisyui.com/components/hover-gallery/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `hover-gallery`
|
- component: `hover-gallery`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<figure class="hover-gallery max-w-60">
|
<figure class="hover-gallery max-w-60">
|
||||||
<img src="https://img.daisyui.com/images/stock/daisyui-hat-1.webp" />
|
<img src="https://img.daisyui.com/images/stock/daisyui-hat-1.webp" />
|
||||||
|
|
@ -17,6 +20,7 @@ Hover Gallery is container of images. The first image is visible by default and
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- hover-gallery can be a `<div>` or a `<figure>`
|
- hover-gallery can be a `<div>` or a `<figure>`
|
||||||
- hover-gallery can include up to 10 images
|
- hover-gallery can include up to 10 images
|
||||||
- hover-gallery needs a max width otherwise if fills the container width
|
- hover-gallery needs a max width otherwise if fills the container width
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,17 @@
|
||||||
### indicator
|
### indicator
|
||||||
|
|
||||||
Indicators are used to place an element on the corner of another element
|
Indicators are used to place an element on the corner of another element
|
||||||
|
|
||||||
[indicator docs](https://daisyui.com/components/indicator/)
|
[indicator docs](https://daisyui.com/components/indicator/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `indicator`
|
- component: `indicator`
|
||||||
- part: `indicator-item`
|
- part: `indicator-item`
|
||||||
- placement: `indicator-start`, `indicator-center`, `indicator-end`, `indicator-top`, `indicator-middle`, `indicator-bottom`
|
- placement: `indicator-start`, `indicator-center`, `indicator-end`, `indicator-top`, `indicator-middle`, `indicator-bottom`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="indicator">
|
<div class="indicator">
|
||||||
<span class="indicator-item">{indicator content}</span>
|
<span class="indicator-item">{indicator content}</span>
|
||||||
|
|
@ -17,5 +20,6 @@ Indicators are used to place an element on the corner of another element
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- Add all indicator elements (with `indicator-item` class) before the main content
|
- Add all indicator elements (with `indicator-item` class) before the main content
|
||||||
- {placement} is optional and can have one of each horizontal/vertical class names. default is `indicator-end indicator-top`
|
- {placement} is optional and can have one of each horizontal/vertical class names. default is `indicator-end indicator-top`
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,24 @@
|
||||||
### input
|
### input
|
||||||
|
|
||||||
Text Input is a simple input field
|
Text Input is a simple input field
|
||||||
|
|
||||||
[input docs](https://daisyui.com/components/input/)
|
[input docs](https://daisyui.com/components/input/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `input`
|
- component: `input`
|
||||||
- style: `input-ghost`
|
- style: `input-ghost`
|
||||||
- color: `input-neutral`, `input-primary`, `input-secondary`, `input-accent`, `input-info`, `input-success`, `input-warning`, `input-error`
|
- color: `input-neutral`, `input-primary`, `input-secondary`, `input-accent`, `input-info`, `input-success`, `input-warning`, `input-error`
|
||||||
- size: `input-xs`, `input-sm`, `input-md`, `input-lg`, `input-xl`
|
- size: `input-xs`, `input-sm`, `input-md`, `input-lg`, `input-xl`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<input type="{type}" placeholder="Type here" class="input {MODIFIER}" />
|
<input type="{type}" placeholder="Type here" class="input {MODIFIER}" />
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of each style/color/size class names
|
- {MODIFIER} is optional and can have one of each style/color/size class names
|
||||||
- Can be used with any input field type (text, password, email, etc.)
|
- Can be used with any input field type (text, password, email, etc.)
|
||||||
- Use `input` class for the parent when you have more than one element inside input
|
- Use `input` class for the parent when you have more than one element inside input
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,22 @@
|
||||||
### join
|
### join
|
||||||
|
|
||||||
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
|
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
|
||||||
|
|
||||||
[join docs](https://daisyui.com/components/join/)
|
[join docs](https://daisyui.com/components/join/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `join`, `join-item`
|
- component: `join`, `join-item`
|
||||||
- direction: `join-vertical`, `join-horizontal`
|
- direction: `join-vertical`, `join-horizontal`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="join {MODIFIER}">{CONTENT}</div>
|
<div class="join {MODIFIER}">{CONTENT}</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of the direction class names
|
- {MODIFIER} is optional and can have one of the direction class names
|
||||||
- Any direct child of the join element will get joined together
|
- Any direct child of the join element will get joined together
|
||||||
- Any element with `join-item` will be affected
|
- Any element with `join-item` will be affected
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,20 @@
|
||||||
### kbd
|
### kbd
|
||||||
|
|
||||||
Kbd is used to display keyboard shortcuts
|
Kbd is used to display keyboard shortcuts
|
||||||
|
|
||||||
[kbd docs](https://daisyui.com/components/kbd/)
|
[kbd docs](https://daisyui.com/components/kbd/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `kbd`
|
- component: `kbd`
|
||||||
- size: `kbd-xs`, `kbd-sm`, `kbd-md`, `kbd-lg`, `kbd-xl`
|
- size: `kbd-xs`, `kbd-sm`, `kbd-md`, `kbd-lg`, `kbd-xl`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<kbd class="kbd {MODIFIER}">K</kbd>
|
<kbd class="kbd {MODIFIER}">K</kbd>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of the size class names
|
- {MODIFIER} is optional and can have one of the size class names
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,26 @@
|
||||||
### label
|
### label
|
||||||
|
|
||||||
Label is used to provide a name or title for an input field. Label can be placed before or after the field
|
Label is used to provide a name or title for an input field. Label can be placed before or after the field
|
||||||
|
|
||||||
[label docs](https://daisyui.com/components/label/)
|
[label docs](https://daisyui.com/components/label/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `label`, `floating-label`
|
- component: `label`, `floating-label`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
For regular label:
|
For regular label:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<label class="input">
|
<label class="input">
|
||||||
<span class="label">{label text}</span>
|
<span class="label">{label text}</span>
|
||||||
<input type="text" placeholder="Type here" />
|
<input type="text" placeholder="Type here" />
|
||||||
</label>
|
</label>
|
||||||
```
|
```
|
||||||
|
|
||||||
For floating label:
|
For floating label:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<label class="floating-label">
|
<label class="floating-label">
|
||||||
<input type="text" placeholder="Type here" class="input" />
|
<input type="text" placeholder="Type here" class="input" />
|
||||||
|
|
@ -23,5 +29,6 @@ For floating label:
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- 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
|
- 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
|
||||||
- Use `floating-label` for the parent of an input field and a span that floats above the input field when the field is focused
|
- Use `floating-label` for the parent of an input field and a span that floats above the input field when the field is focused
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,21 @@
|
||||||
### link
|
### link
|
||||||
|
|
||||||
Link adds the missing underline style to links
|
Link adds the missing underline style to links
|
||||||
|
|
||||||
[link docs](https://daisyui.com/components/link/)
|
[link docs](https://daisyui.com/components/link/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `link`
|
- component: `link`
|
||||||
- style: `link-hover`
|
- style: `link-hover`
|
||||||
- color: `link-neutral`, `link-primary`, `link-secondary`, `link-accent`, `link-success`, `link-info`, `link-warning`, `link-error`
|
- color: `link-neutral`, `link-primary`, `link-secondary`, `link-accent`, `link-success`, `link-info`, `link-warning`, `link-error`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<a class="link {MODIFIER}">Click me</a>
|
<a class="link {MODIFIER}">Click me</a>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of the modifier class names
|
- {MODIFIER} is optional and can have one of the modifier class names
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,16 @@
|
||||||
### list
|
### list
|
||||||
|
|
||||||
List is a vertical layout to display information in rows
|
List is a vertical layout to display information in rows
|
||||||
|
|
||||||
[list docs](https://daisyui.com/components/list/)
|
[list docs](https://daisyui.com/components/list/)
|
||||||
|
|
||||||
#### Class Names:
|
#### Class Names:
|
||||||
|
|
||||||
- Component: `list`, `list-row`
|
- Component: `list`, `list-row`
|
||||||
- Modifier: `list-col-wrap`, `list-col-grow`
|
- Modifier: `list-col-wrap`, `list-col-grow`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<ul class="list">
|
<ul class="list">
|
||||||
<li class="list-row">{CONTENT}</li>
|
<li class="list-row">{CONTENT}</li>
|
||||||
|
|
@ -15,6 +18,7 @@ List is a vertical layout to display information in rows
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- Use `list-row` for each item inside the list
|
- Use `list-row` for each item inside the list
|
||||||
- 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
|
- 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
|
||||||
- Use `list-col-wrap` to force an item to wrap to the next line
|
- Use `list-col-wrap` to force an item to wrap to the next line
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,21 @@
|
||||||
### loading
|
### loading
|
||||||
|
|
||||||
Loading shows an animation to indicate that something is loading
|
Loading shows an animation to indicate that something is loading
|
||||||
|
|
||||||
[loading docs](https://daisyui.com/components/loading/)
|
[loading docs](https://daisyui.com/components/loading/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `loading`
|
- component: `loading`
|
||||||
- style: `loading-spinner`, `loading-dots`, `loading-ring`, `loading-ball`, `loading-bars`, `loading-infinity`
|
- style: `loading-spinner`, `loading-dots`, `loading-ring`, `loading-ball`, `loading-bars`, `loading-infinity`
|
||||||
- size: `loading-xs`, `loading-sm`, `loading-md`, `loading-lg`, `loading-xl`
|
- size: `loading-xs`, `loading-sm`, `loading-md`, `loading-lg`, `loading-xl`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<span class="loading {MODIFIER}"></span>
|
<span class="loading {MODIFIER}"></span>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of the style/size class names
|
- {MODIFIER} is optional and can have one of the style/size class names
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,23 @@
|
||||||
### mask
|
### mask
|
||||||
|
|
||||||
Mask crops the content of the element to common shapes
|
Mask crops the content of the element to common shapes
|
||||||
|
|
||||||
[mask docs](https://daisyui.com/components/mask/)
|
[mask docs](https://daisyui.com/components/mask/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `mask`
|
- component: `mask`
|
||||||
- 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`
|
- 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`
|
||||||
- modifier: `mask-half-1`, `mask-half-2`
|
- modifier: `mask-half-1`, `mask-half-2`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<img class="mask {MODIFIER}" src="{image-url}" />
|
<img class="mask {MODIFIER}" src="{image-url}" />
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is required and can have one of the style/modifier class names
|
- {MODIFIER} is required and can have one of the style/modifier class names
|
||||||
- You can change the shape of any element using `mask` class names
|
- You can change the shape of any element using `mask` class names
|
||||||
- You can set custom sizes using `w-*` and `h-*`
|
- You can set custom sizes using `w-*` and `h-*`
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
### megamenu
|
### megamenu
|
||||||
|
|
||||||
A megamenu is a large, horizontal menu where each item opens a popover to show a large block of navigation links. Megamenu must be used once, on top of the page. Inside each popover, you can use a daisyUI menu, or any custom content. Megamenu fits better on large screens only, and for small screens, you can hide the megamenu and show the content in a dropdown or a drawer.
|
A megamenu is a large, horizontal menu where each item opens a popover to show a large block of navigation links. Megamenu must be used once, on top of the page. Inside each popover, you can use a daisyUI menu, or any custom content. Megamenu fits better on large screens only, and for small screens, you can hide the megamenu and show the content in a dropdown or a drawer.
|
||||||
|
|
||||||
[megamenu docs](https://daisyui.com/components/megamenu/)
|
[megamenu docs](https://daisyui.com/components/megamenu/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `megamenu`
|
- component: `megamenu`
|
||||||
- part: `megamenu-active`
|
- part: `megamenu-active`
|
||||||
- modifier: `megamenu-wide`, `megamenu-full`
|
- modifier: `megamenu-wide`, `megamenu-full`
|
||||||
|
|
@ -11,53 +13,69 @@ A megamenu is a large, horizontal menu where each item opens a popover to show a
|
||||||
- size: `megamenu-xs`, `megamenu-sm`, `megamenu-md`, `megamenu-lg`, `megamenu-xl`
|
- size: `megamenu-xs`, `megamenu-sm`, `megamenu-md`, `megamenu-lg`, `megamenu-xl`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<button class="btn sm:hidden" popovertarget="my-megamenu-1">Menu</button>
|
<button class="btn sm:hidden" popovertarget="my-megamenu-1">Menu</button>
|
||||||
<div class="megamenu max-sm:megamenu-vertical {MODIFIER} p-2 border border-base-300" id="my-megamenu-1" popover>
|
<div
|
||||||
|
class="megamenu max-sm:megamenu-vertical {MODIFIER} border-base-300 border p-2"
|
||||||
|
id="my-megamenu-1"
|
||||||
|
popover
|
||||||
|
>
|
||||||
<span class="megamenu-active"></span>
|
<span class="megamenu-active"></span>
|
||||||
|
|
||||||
<button popovertarget="item-1">button 1</button>
|
<button popovertarget="item-1">button 1</button>
|
||||||
<div id="item-1" popover>
|
<div id="item-1" popover>{CONTENT}</div>
|
||||||
{CONTENT}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button popovertarget="item-2">button 2</button>
|
<button popovertarget="item-2">button 2</button>
|
||||||
<div id="item-2" popover>
|
<div id="item-2" popover>{CONTENT}</div>
|
||||||
{CONTENT}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
Example of megamenu-wide with lots of menu items
|
Example of megamenu-wide with lots of menu items
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<button class="btn sm:hidden" popovertarget="my-megamenu-2">Menu</button>
|
<button class="btn sm:hidden" popovertarget="my-megamenu-2">Menu</button>
|
||||||
<div class="megamenu max-sm:megamenu-vertical megamenu-wide w-full p-2 border border-base-300" id="my-megamenu-2" popover>
|
<div
|
||||||
|
class="megamenu max-sm:megamenu-vertical megamenu-wide border-base-300 w-full border p-2"
|
||||||
|
id="my-megamenu-2"
|
||||||
|
popover
|
||||||
|
>
|
||||||
<span class="megamenu-active"></span>
|
<span class="megamenu-active"></span>
|
||||||
<button popovertarget="c1">One</button>
|
<button popovertarget="c1">One</button>
|
||||||
<div id="c1" popover>
|
<div id="c1" popover>
|
||||||
<div class="flex max-sm:flex-col items-start">
|
<div class="flex items-start max-sm:flex-col">
|
||||||
<ul class="menu w-full md:menu-horizontal">
|
<ul class="menu md:menu-horizontal w-full">
|
||||||
<li>
|
<li>
|
||||||
<a>first column menu item</a>
|
<a>first column menu item</a>
|
||||||
<ul><li><a>sub menu item</a></li></ul>
|
<ul>
|
||||||
|
<li><a>sub menu item</a></li>
|
||||||
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a>second column menu item</a>
|
<a>second column menu item</a>
|
||||||
<ul><li><a>sub menu item</a></li></ul>
|
<ul>
|
||||||
|
<li><a>sub menu item</a></li>
|
||||||
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a>third column menu item</a>
|
<a>third column menu item</a>
|
||||||
<ul><li><a>sub menu item</a></li></ul>
|
<ul>
|
||||||
|
<li><a>sub menu item</a></li>
|
||||||
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<img src="{image-url}" class="md:max-w-sm max-md:w-auto" alt="sample image at the end of the megamenu">
|
<img
|
||||||
|
src="{image-url}"
|
||||||
|
class="max-md:w-auto md:max-w-sm"
|
||||||
|
alt="sample image at the end of the megamenu"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of the modifier class names and one of the size class names
|
- {MODIFIER} is optional and can have one of the modifier class names and one of the size class names
|
||||||
- `megamenu-active` span is mandatory. it's the indicator that moves under the active item
|
- `megamenu-active` span is mandatory. it's the indicator that moves under the active item
|
||||||
- Each button must have a corresponding popover with the same id as the popovertarget value. HTML IDs must be unique.
|
- Each button must have a corresponding popover with the same id as the popovertarget value. HTML IDs must be unique.
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
### menu
|
### menu
|
||||||
|
|
||||||
Menu is used to display a list of links vertically or horizontally
|
Menu is used to display a list of links vertically or horizontally
|
||||||
|
|
||||||
[menu docs](https://daisyui.com/components/menu/)
|
[menu docs](https://daisyui.com/components/menu/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `menu`
|
- component: `menu`
|
||||||
- part: `menu-title`, `menu-dropdown`, `menu-dropdown-toggle`
|
- part: `menu-title`, `menu-dropdown`, `menu-dropdown-toggle`
|
||||||
- modifier: `menu-disabled`, `menu-active`, `menu-focus`, `menu-dropdown-show`, `menu-paged`
|
- modifier: `menu-disabled`, `menu-active`, `menu-focus`, `menu-dropdown-show`, `menu-paged`
|
||||||
|
|
@ -11,13 +13,17 @@ Menu is used to display a list of links vertically or horizontally
|
||||||
- direction: `menu-vertical`, `menu-horizontal`
|
- direction: `menu-vertical`, `menu-horizontal`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
Vertical menu:
|
Vertical menu:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<ul class="menu">
|
<ul class="menu">
|
||||||
<li><button>Item</button></li>
|
<li><button>Item</button></li>
|
||||||
</ul>
|
</ul>
|
||||||
```
|
```
|
||||||
|
|
||||||
Horizontal menu:
|
Horizontal menu:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<ul class="menu menu-horizontal">
|
<ul class="menu menu-horizontal">
|
||||||
<li><button>Item</button></li>
|
<li><button>Item</button></li>
|
||||||
|
|
@ -25,6 +31,7 @@ Horizontal menu:
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of the modifier/size/direction class names
|
- {MODIFIER} is optional and can have one of the modifier/size/direction class names
|
||||||
- Use `lg:menu-horizontal` for responsive layouts
|
- Use `lg:menu-horizontal` for responsive layouts
|
||||||
- Use `menu-title` for list item title
|
- Use `menu-title` for list item title
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,24 @@
|
||||||
### mockup-browser
|
### mockup-browser
|
||||||
|
|
||||||
Browser mockup shows a box that looks like a browser window
|
Browser mockup shows a box that looks like a browser window
|
||||||
|
|
||||||
[mockup-browser docs](https://daisyui.com/components/mockup-browser/)
|
[mockup-browser docs](https://daisyui.com/components/mockup-browser/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `mockup-browser`
|
- component: `mockup-browser`
|
||||||
- part: `mockup-browser-toolbar`
|
- part: `mockup-browser-toolbar`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="mockup-browser">
|
<div class="mockup-browser">
|
||||||
<div class="mockup-browser-toolbar">
|
<div class="mockup-browser-toolbar">{toolbar content}</div>
|
||||||
{toolbar content}
|
|
||||||
</div>
|
|
||||||
<div>{CONTENT}</div>
|
<div>{CONTENT}</div>
|
||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- For a default mockup, use just `mockup-browser` class name
|
- For a default mockup, use just `mockup-browser` class name
|
||||||
- To set a URL in toolbar, add a div with `input` class
|
- To set a URL in toolbar, add a div with `input` class
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,15 @@
|
||||||
### mockup-code
|
### mockup-code
|
||||||
|
|
||||||
Code mockup is used to show a block of code in a box that looks like a code editor
|
Code mockup is used to show a block of code in a box that looks like a code editor
|
||||||
|
|
||||||
[mockup-code docs](https://daisyui.com/components/mockup-code/)
|
[mockup-code docs](https://daisyui.com/components/mockup-code/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `mockup-code`
|
- component: `mockup-code`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="mockup-code">
|
<div class="mockup-code">
|
||||||
<pre data-prefix="$"><code>npm i daisyui</code></pre>
|
<pre data-prefix="$"><code>npm i daisyui</code></pre>
|
||||||
|
|
@ -14,6 +17,7 @@ Code mockup is used to show a block of code in a box that looks like a code edit
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- Use `<pre data-prefix="{prefix}">` to show a prefix before each line
|
- Use `<pre data-prefix="{prefix}">` to show a prefix before each line
|
||||||
- Use `<code>` tag to add code syntax highlighting (requires additional library)
|
- Use `<code>` tag to add code syntax highlighting (requires additional library)
|
||||||
- To highlight a line, add background/text color
|
- To highlight a line, add background/text color
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,16 @@
|
||||||
### mockup-phone
|
### mockup-phone
|
||||||
|
|
||||||
Phone mockup shows a mockup of an iPhone
|
Phone mockup shows a mockup of an iPhone
|
||||||
|
|
||||||
[mockup-phone docs](https://daisyui.com/components/mockup-phone/)
|
[mockup-phone docs](https://daisyui.com/components/mockup-phone/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `mockup-phone`
|
- component: `mockup-phone`
|
||||||
- part: `mockup-phone-camera`, `mockup-phone-display`
|
- part: `mockup-phone-camera`, `mockup-phone-display`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="mockup-phone">
|
<div class="mockup-phone">
|
||||||
<div class="mockup-phone-camera"></div>
|
<div class="mockup-phone-camera"></div>
|
||||||
|
|
@ -16,4 +19,5 @@ Phone mockup shows a mockup of an iPhone
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- Inside `mockup-phone-display` you can add anything
|
- Inside `mockup-phone-display` you can add anything
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,15 @@
|
||||||
### mockup-window
|
### mockup-window
|
||||||
|
|
||||||
Window mockup shows a box that looks like an operating system window
|
Window mockup shows a box that looks like an operating system window
|
||||||
|
|
||||||
[mockup-window docs](https://daisyui.com/components/mockup-window/)
|
[mockup-window docs](https://daisyui.com/components/mockup-window/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `mockup-window`
|
- component: `mockup-window`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="mockup-window">
|
<div class="mockup-window">
|
||||||
<div>{CONTENT}</div>
|
<div>{CONTENT}</div>
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,20 @@
|
||||||
### modal
|
### modal
|
||||||
|
|
||||||
Modal is used to show a dialog or a box when you click a button
|
Modal is used to show a dialog or a box when you click a button
|
||||||
|
|
||||||
[modal docs](https://daisyui.com/components/modal/)
|
[modal docs](https://daisyui.com/components/modal/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `modal`
|
- component: `modal`
|
||||||
- part: `modal-box`, `modal-action`, `modal-backdrop`, `modal-toggle`
|
- part: `modal-box`, `modal-action`, `modal-backdrop`, `modal-toggle`
|
||||||
- modifier: `modal-open`
|
- modifier: `modal-open`
|
||||||
- placement: `modal-top`, `modal-middle`, `modal-bottom`, `modal-start`, `modal-end`
|
- placement: `modal-top`, `modal-middle`, `modal-bottom`, `modal-start`, `modal-end`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
Using HTML dialog element (recommended)
|
Using HTML dialog element (recommended)
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<button onclick="my_modal.showModal()">Open modal</button>
|
<button onclick="my_modal.showModal()">Open modal</button>
|
||||||
<dialog id="my_modal" class="modal">
|
<dialog id="my_modal" class="modal">
|
||||||
|
|
@ -18,7 +22,9 @@ Using HTML dialog element (recommended)
|
||||||
<form method="dialog" class="modal-backdrop"><button>close</button></form>
|
<form method="dialog" class="modal-backdrop"><button>close</button></form>
|
||||||
</dialog>
|
</dialog>
|
||||||
```
|
```
|
||||||
|
|
||||||
If we want it to close when clicking outside:
|
If we want it to close when clicking outside:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<button class="btn" onclick="my_modal.showModal()">open modal</button>
|
<button class="btn" onclick="my_modal.showModal()">open modal</button>
|
||||||
<dialog id="my_modal" class="modal">
|
<dialog id="my_modal" class="modal">
|
||||||
|
|
@ -32,8 +38,8 @@ If we want it to close when clicking outside:
|
||||||
</dialog>
|
</dialog>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
Using popover API (recommended only if we DON'T want to trap the keyboard navigation in the modal)
|
Using popover API (recommended only if we DON'T want to trap the keyboard navigation in the modal)
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<button popovertarget="my_modal" class="btn">Open modal</button>
|
<button popovertarget="my_modal" class="btn">Open modal</button>
|
||||||
<div class="modal" popover id="my_modal">
|
<div class="modal" popover id="my_modal">
|
||||||
|
|
@ -45,13 +51,15 @@ Using popover API (recommended only if we DON'T want to trap the keyboard naviga
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
If we want it to close when clicking outside:
|
If we want it to close when clicking outside:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<button class="btn" popovertarget="my_modal">Open</button>
|
<button class="btn" popovertarget="my_modal">Open</button>
|
||||||
|
|
||||||
<div class="modal" id="my_modal" popover>
|
<div class="modal" id="my_modal" popover>
|
||||||
<div class="modal-box">
|
<div class="modal-box">
|
||||||
<h3 class="font-bold text-lg">Hello!</h3>
|
<h3 class="text-lg font-bold">Hello!</h3>
|
||||||
<p class="py-4">Press ESC key or click the button below to close</p>
|
<p class="py-4">Press ESC key or click the button below to close</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-backdrop">
|
<div class="modal-backdrop">
|
||||||
|
|
@ -61,6 +69,7 @@ If we want it to close when clicking outside:
|
||||||
```
|
```
|
||||||
|
|
||||||
Using checkbox (legacy)
|
Using checkbox (legacy)
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<label for="my-modal" class="btn">Open modal</label>
|
<label for="my-modal" class="btn">Open modal</label>
|
||||||
<input type="checkbox" id="my-modal" class="modal-toggle" />
|
<input type="checkbox" id="my-modal" class="modal-toggle" />
|
||||||
|
|
@ -71,6 +80,7 @@ Using checkbox (legacy)
|
||||||
```
|
```
|
||||||
|
|
||||||
Using anchor links (legacy)
|
Using anchor links (legacy)
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<a href="#my-modal" class="btn">Open modal</a>
|
<a href="#my-modal" class="btn">Open modal</a>
|
||||||
<div class="modal" id="my-modal">
|
<div class="modal" id="my-modal">
|
||||||
|
|
@ -79,6 +89,7 @@ Using anchor links (legacy)
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of the modifier/placement class names
|
- {MODIFIER} is optional and can have one of the modifier/placement class names
|
||||||
- Use unique IDs for each modal
|
- Use unique IDs for each modal
|
||||||
- For HTML dialog element modals, add `<form method="dialog">` for closing the modal with submit
|
- For HTML dialog element modals, add `<form method="dialog">` for closing the modal with submit
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,22 @@
|
||||||
### navbar
|
### navbar
|
||||||
|
|
||||||
Navbar is used to show a navigation bar on the top of the page
|
Navbar is used to show a navigation bar on the top of the page
|
||||||
|
|
||||||
[navbar docs](https://daisyui.com/components/navbar/)
|
[navbar docs](https://daisyui.com/components/navbar/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `navbar`
|
- component: `navbar`
|
||||||
- part: `navbar-start`, `navbar-center`, `navbar-end`
|
- part: `navbar-start`, `navbar-center`, `navbar-end`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="navbar">{CONTENT}</div>
|
<div class="navbar">{CONTENT}</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- use `navbar-start`, `navbar-center`, `navbar-end` to position content horizontally
|
- use `navbar-start`, `navbar-center`, `navbar-end` to position content horizontally
|
||||||
- put anything inside each section
|
- put anything inside each section
|
||||||
- suggestion - use `base-200` for background color
|
- suggestion - use `base-200` for background color
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,37 @@
|
||||||
### OTP
|
### OTP
|
||||||
|
|
||||||
OTP (One-Time Password) component for inputting verification codes. It's usually 4 to 6 digits long and is used for two-factor authentication (2FA) or passwordless login.
|
OTP (One-Time Password) component for inputting verification codes. It's usually 4 to 6 digits long and is used for two-factor authentication (2FA) or passwordless login.
|
||||||
|
|
||||||
[OTP docs](https://daisyui.com/components/otp/)
|
[OTP docs](https://daisyui.com/components/otp/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `otp`
|
- component: `otp`
|
||||||
- size: `otp-xs`, `otp-sm`, `otp-md`, `otp-lg`, `otp-xl`
|
- size: `otp-xs`, `otp-sm`, `otp-md`, `otp-lg`, `otp-xl`
|
||||||
- modifier: `otp-joined`
|
- modifier: `otp-joined`
|
||||||
- color: `otp-neutral`, `otp-primary`, `otp-secondary`, `otp-accent`, `otp-info`, `otp-success`, `otp-warning`, `otp-error`
|
- color: `otp-neutral`, `otp-primary`, `otp-secondary`, `otp-accent`, `otp-info`, `otp-success`, `otp-warning`, `otp-error`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<label class="otp {MODIFIER}">
|
<label class="otp {MODIFIER}">
|
||||||
<span></span>
|
<span></span>
|
||||||
<span></span>
|
<span></span>
|
||||||
<span></span>
|
<span></span>
|
||||||
<span></span>
|
<span></span>
|
||||||
<input type="text" autocomplete="one-time-code" inputmode="numeric" maxlength="4" pattern="[0-9]{4}" required />
|
<input
|
||||||
|
type="text"
|
||||||
|
autocomplete="one-time-code"
|
||||||
|
inputmode="numeric"
|
||||||
|
maxlength="4"
|
||||||
|
pattern="[0-9]{4}"
|
||||||
|
required
|
||||||
|
/>
|
||||||
</label>
|
</label>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of the size/color class names
|
- {MODIFIER} is optional and can have one of the size/color class names
|
||||||
- `otp-joined` modifier connects the character boxes together
|
- `otp-joined` modifier connects the character boxes together
|
||||||
- the `otp` class is for a label. The label should have 4 to 6 empty `<span>` elements for the visual representation of each digit and an input field for entering the code
|
- the `otp` class is for a label. The label should have 4 to 6 empty `<span>` elements for the visual representation of each digit and an input field for entering the code
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,22 @@
|
||||||
### pagination
|
### pagination
|
||||||
|
|
||||||
Pagination is a group of buttons
|
Pagination is a group of buttons
|
||||||
|
|
||||||
[pagination docs](https://daisyui.com/components/pagination/)
|
[pagination docs](https://daisyui.com/components/pagination/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `join`
|
- component: `join`
|
||||||
- part: `join-item`
|
- part: `join-item`
|
||||||
- direction: `join-vertical`, `join-horizontal`
|
- direction: `join-vertical`, `join-horizontal`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="join">{CONTENT}</div>
|
<div class="join">{CONTENT}</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- Use `join-item` for each button or link inside the pagination
|
- Use `join-item` for each button or link inside the pagination
|
||||||
- Use `btn` class for styling pagination items
|
- Use `btn` class for styling pagination items
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,21 @@
|
||||||
### progress
|
### progress
|
||||||
|
|
||||||
Progress bar can be used to show the progress of a task or to show the passing of time
|
Progress bar can be used to show the progress of a task or to show the passing of time
|
||||||
|
|
||||||
[progress docs](https://daisyui.com/components/progress/)
|
[progress docs](https://daisyui.com/components/progress/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `progress`
|
- component: `progress`
|
||||||
- color: `progress-neutral`, `progress-primary`, `progress-secondary`, `progress-accent`, `progress-info`, `progress-success`, `progress-warning`, `progress-error`
|
- color: `progress-neutral`, `progress-primary`, `progress-secondary`, `progress-accent`, `progress-info`, `progress-success`, `progress-warning`, `progress-error`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<progress class="progress {MODIFIER}" value="50" max="100"></progress>
|
<progress class="progress {MODIFIER}" value="50" max="100"></progress>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of the color class names
|
- {MODIFIER} is optional and can have one of the color class names
|
||||||
- You must specify value and max attributes
|
- You must specify value and max attributes
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,21 @@
|
||||||
### radial-progress
|
### radial-progress
|
||||||
|
|
||||||
Radial progress can be used to show the progress of a task or to show the passing of time
|
Radial progress can be used to show the progress of a task or to show the passing of time
|
||||||
|
|
||||||
[radial-progress docs](https://daisyui.com/components/radial-progress/)
|
[radial-progress docs](https://daisyui.com/components/radial-progress/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `radial-progress`
|
- component: `radial-progress`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="radial-progress" style="--value:70;" aria-valuenow="70" role="progressbar">70%</div>
|
<div class="radial-progress" style="--value:70;" aria-valuenow="70" role="progressbar">70%</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- The `--value` CSS variable and text must be a number between 0 and 100
|
- The `--value` CSS variable and text must be a number between 0 and 100
|
||||||
- you need to add `aria-valuenow={value}` and `role="progressbar"` so screen readers can properly read value and also show that its a progress element to them
|
- you need to add `aria-valuenow={value}` and `role="progressbar"` so screen readers can properly read value and also show that its a progress element to them
|
||||||
- Use `div` instead of progress because browsers can't show text inside progress tag
|
- Use `div` instead of progress because browsers can't show text inside progress tag
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,23 @@
|
||||||
### radio
|
### radio
|
||||||
|
|
||||||
Radio buttons allow the user to select one option
|
Radio buttons allow the user to select one option
|
||||||
|
|
||||||
[radio docs](https://daisyui.com/components/radio/)
|
[radio docs](https://daisyui.com/components/radio/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `radio`
|
- component: `radio`
|
||||||
- color: `radio-neutral`, `radio-primary`, `radio-secondary`, `radio-accent`, `radio-success`, `radio-warning`, `radio-info`, `radio-error`
|
- color: `radio-neutral`, `radio-primary`, `radio-secondary`, `radio-accent`, `radio-success`, `radio-warning`, `radio-info`, `radio-error`
|
||||||
- size: `radio-xs`, `radio-sm`, `radio-md`, `radio-lg`, `radio-xl`
|
- size: `radio-xs`, `radio-sm`, `radio-md`, `radio-lg`, `radio-xl`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<input type="radio" name="{name}" class="radio {MODIFIER}" />
|
<input type="radio" name="{name}" class="radio {MODIFIER}" />
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of the size/color class names
|
- {MODIFIER} is optional and can have one of the size/color class names
|
||||||
- Replace {name} with a unique name for the radio group
|
- Replace {name} with a unique name for the radio group
|
||||||
- Each set of radio inputs should have unique `name` attributes to avoid conflicts with other sets of radio inputs on the same page
|
- Each set of radio inputs should have unique `name` attributes to avoid conflicts with other sets of radio inputs on the same page
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,24 @@
|
||||||
### range
|
### range
|
||||||
|
|
||||||
Range slider is used to select a value by sliding a handle
|
Range slider is used to select a value by sliding a handle
|
||||||
|
|
||||||
[range docs](https://daisyui.com/components/range/)
|
[range docs](https://daisyui.com/components/range/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `range`
|
- component: `range`
|
||||||
- color: `range-neutral`, `range-primary`, `range-secondary`, `range-accent`, `range-success`, `range-warning`, `range-info`, `range-error`
|
- color: `range-neutral`, `range-primary`, `range-secondary`, `range-accent`, `range-success`, `range-warning`, `range-info`, `range-error`
|
||||||
- size: `range-xs`, `range-sm`, `range-md`, `range-lg`, `range-xl`
|
- size: `range-xs`, `range-sm`, `range-md`, `range-lg`, `range-xl`
|
||||||
- direction: `range-vertical` (vertical slider)
|
- direction: `range-vertical` (vertical slider)
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<input type="range" min="0" max="100" value="40" class="range {MODIFIER}" />
|
<input type="range" min="0" max="100" value="40" class="range {MODIFIER}" />
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of each color/size class names
|
- {MODIFIER} is optional and can have one of each color/size class names
|
||||||
- For a vertical slider use `range-vertical`
|
- For a vertical slider use `range-vertical`
|
||||||
- You must specify `min` and `max` attributes
|
- You must specify `min` and `max` attributes
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,17 @@
|
||||||
### rating
|
### rating
|
||||||
|
|
||||||
Rating is a set of radio buttons that allow the user to rate something
|
Rating is a set of radio buttons that allow the user to rate something
|
||||||
|
|
||||||
[rating docs](https://daisyui.com/components/rating/)
|
[rating docs](https://daisyui.com/components/rating/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `rating`
|
- component: `rating`
|
||||||
- modifier: `rating-half`, `rating-hidden`
|
- modifier: `rating-half`, `rating-hidden`
|
||||||
- size: `rating-xs`, `rating-sm`, `rating-md`, `rating-lg`, `rating-xl`
|
- size: `rating-xs`, `rating-sm`, `rating-md`, `rating-lg`, `rating-xl`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="rating {MODIFIER}">
|
<div class="rating {MODIFIER}">
|
||||||
<input type="radio" name="rating-1" class="mask mask-star" />
|
<input type="radio" name="rating-1" class="mask mask-star" />
|
||||||
|
|
@ -16,6 +19,7 @@ Rating is a set of radio buttons that allow the user to rate something
|
||||||
```
|
```
|
||||||
|
|
||||||
For a read-only (non-interactive) rating, use `<div>` elements instead of radio inputs and mark the selected one with `aria-current="true"`:
|
For a read-only (non-interactive) rating, use `<div>` elements instead of radio inputs and mark the selected one with `aria-current="true"`:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="rating">
|
<div class="rating">
|
||||||
<div class="mask mask-star" aria-label="1 star"></div>
|
<div class="mask mask-star" aria-label="1 star"></div>
|
||||||
|
|
@ -25,6 +29,7 @@ For a read-only (non-interactive) rating, use `<div>` elements instead of radio
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of the modifier/size class names
|
- {MODIFIER} is optional and can have one of the modifier/size class names
|
||||||
- Each set of rating inputs should have unique `name` attributes to avoid conflicts with other ratings on the same page
|
- Each set of rating inputs should have unique `name` attributes to avoid conflicts with other ratings on the same page
|
||||||
- Add `rating-hidden` for the first radio to make it hidden so user can clear the rating
|
- Add `rating-hidden` for the first radio to make it hidden so user can clear the rating
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,18 @@
|
||||||
### select
|
### select
|
||||||
|
|
||||||
Select is used to pick a value from a list of options
|
Select is used to pick a value from a list of options
|
||||||
|
|
||||||
[select docs](https://daisyui.com/components/select/)
|
[select docs](https://daisyui.com/components/select/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `select`
|
- component: `select`
|
||||||
- style: `select-ghost`
|
- style: `select-ghost`
|
||||||
- color: `select-neutral`, `select-primary`, `select-secondary`, `select-accent`, `select-info`, `select-success`, `select-warning`, `select-error`
|
- color: `select-neutral`, `select-primary`, `select-secondary`, `select-accent`, `select-info`, `select-success`, `select-warning`, `select-error`
|
||||||
- size: `select-xs`, `select-sm`, `select-md`, `select-lg`, `select-xl`
|
- size: `select-xs`, `select-sm`, `select-md`, `select-lg`, `select-xl`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<select class="select {MODIFIER}">
|
<select class="select {MODIFIER}">
|
||||||
<option>Option</option>
|
<option>Option</option>
|
||||||
|
|
@ -17,4 +20,5 @@ Select is used to pick a value from a list of options
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of each style/color/size class names
|
- {MODIFIER} is optional and can have one of each style/color/size class names
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,26 @@
|
||||||
### skeleton
|
### skeleton
|
||||||
|
|
||||||
Skeleton is a component that can be used to show a loading state
|
Skeleton is a component that can be used to show a loading state
|
||||||
|
|
||||||
[skeleton docs](https://daisyui.com/components/skeleton/)
|
[skeleton docs](https://daisyui.com/components/skeleton/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `skeleton`
|
- component: `skeleton`
|
||||||
- modifier: `skeleton-text`
|
- modifier: `skeleton-text`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="skeleton"></div>
|
<div class="skeleton"></div>
|
||||||
```
|
```
|
||||||
|
|
||||||
Example with text skeleton:
|
Example with text skeleton:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="skeleton skeleton-text">Loading data...</div>
|
<div class="skeleton skeleton-text">Loading data...</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- Add `h-*` and `w-*` utility classes to set height and width
|
- Add `h-*` and `w-*` utility classes to set height and width
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,21 @@
|
||||||
### stack
|
### stack
|
||||||
|
|
||||||
Stack visually puts elements on top of each other
|
Stack visually puts elements on top of each other
|
||||||
|
|
||||||
[stack docs](https://daisyui.com/components/stack/)
|
[stack docs](https://daisyui.com/components/stack/)
|
||||||
|
|
||||||
#### Class Names:
|
#### Class Names:
|
||||||
|
|
||||||
- Component: `stack`
|
- Component: `stack`
|
||||||
- Modifier: `stack-top`, `stack-bottom`, `stack-start`, `stack-end`
|
- Modifier: `stack-top`, `stack-bottom`, `stack-start`, `stack-end`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="stack {MODIFIER}">{CONTENT}</div>
|
<div class="stack {MODIFIER}">{CONTENT}</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of the modifier class names
|
- {MODIFIER} is optional and can have one of the modifier class names
|
||||||
- You can use `w-*` and `h-*` classes to set the width and height of the stack, making all items the same size
|
- You can use `w-*` and `h-*` classes to set the width and height of the stack, making all items the same size
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,17 @@
|
||||||
### stat
|
### stat
|
||||||
|
|
||||||
Stat is used to show numbers and data in a block
|
Stat is used to show numbers and data in a block
|
||||||
|
|
||||||
[stat docs](https://daisyui.com/components/stat/)
|
[stat docs](https://daisyui.com/components/stat/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- Component: `stats`
|
- Component: `stats`
|
||||||
- Part: `stat`, `stat-title`, `stat-value`, `stat-desc`, `stat-figure`, `stat-actions`
|
- Part: `stat`, `stat-title`, `stat-value`, `stat-desc`, `stat-figure`, `stat-actions`
|
||||||
- Direction: `stats-horizontal`, `stats-vertical`
|
- Direction: `stats-horizontal`, `stats-vertical`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="stats {MODIFIER}">
|
<div class="stats {MODIFIER}">
|
||||||
<div class="stat">{CONTENT}</div>
|
<div class="stat">{CONTENT}</div>
|
||||||
|
|
@ -16,6 +19,7 @@ Stat is used to show numbers and data in a block
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of the direction class names
|
- {MODIFIER} is optional and can have one of the direction class names
|
||||||
- It's horizontal by default but you can make it vertical with the `stats-vertical` class
|
- It's horizontal by default but you can make it vertical with the `stats-vertical` class
|
||||||
- Content includes `stat-title`, `stat-value`, `stat-desc` inside a `stat`
|
- Content includes `stat-title`, `stat-value`, `stat-desc` inside a `stat`
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,22 @@
|
||||||
### status
|
### status
|
||||||
|
|
||||||
Status is a really small icon to visually show the current status of an element, like online, offline, error, etc
|
Status is a really small icon to visually show the current status of an element, like online, offline, error, etc
|
||||||
|
|
||||||
[status docs](https://daisyui.com/components/status/)
|
[status docs](https://daisyui.com/components/status/)
|
||||||
|
|
||||||
#### Class Names:
|
#### Class Names:
|
||||||
|
|
||||||
- Component: `status`
|
- Component: `status`
|
||||||
- Color: `status-neutral`, `status-primary`, `status-secondary`, `status-accent`, `status-info`, `status-success`, `status-warning`, `status-error`
|
- Color: `status-neutral`, `status-primary`, `status-secondary`, `status-accent`, `status-info`, `status-success`, `status-warning`, `status-error`
|
||||||
- Size: `status-xs`, `status-sm`, `status-md`, `status-lg`, `status-xl`
|
- Size: `status-xs`, `status-sm`, `status-md`, `status-lg`, `status-xl`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<span class="status {MODIFIER}"></span>
|
<span class="status {MODIFIER}"></span>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of the color/size class names
|
- {MODIFIER} is optional and can have one of the color/size class names
|
||||||
- This compnent renders a small visual indicator to draw attention
|
- This compnent renders a small visual indicator to draw attention
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,18 @@
|
||||||
### steps
|
### steps
|
||||||
|
|
||||||
Steps can be used to show a list of steps in a process
|
Steps can be used to show a list of steps in a process
|
||||||
|
|
||||||
[steps docs](https://daisyui.com/components/steps/)
|
[steps docs](https://daisyui.com/components/steps/)
|
||||||
|
|
||||||
#### Class Names:
|
#### Class Names:
|
||||||
|
|
||||||
- Component: `steps`
|
- Component: `steps`
|
||||||
- Part: `step`, `step-icon`
|
- Part: `step`, `step-icon`
|
||||||
- Color: `step-neutral`, `step-primary`, `step-secondary`, `step-accent`, `step-info`, `step-success`, `step-warning`, `step-error`
|
- Color: `step-neutral`, `step-primary`, `step-secondary`, `step-accent`, `step-info`, `step-success`, `step-warning`, `step-error`
|
||||||
- Direction: `steps-vertical`, `steps-horizontal`
|
- Direction: `steps-vertical`, `steps-horizontal`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<ul class="steps {DIRECTION}">
|
<ul class="steps {DIRECTION}">
|
||||||
<li class="step step-primary">{completed step}</li>
|
<li class="step step-primary">{completed step}</li>
|
||||||
|
|
@ -18,6 +21,7 @@ Steps can be used to show a list of steps in a process
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- Steps are horizontal by default; add `steps-vertical` to the `ul` for a vertical layout
|
- Steps are horizontal by default; add `steps-vertical` to the `ul` for a vertical layout
|
||||||
- Direction classes go on `steps`; `step-*` color classes go on individual `step` items
|
- Direction classes go on `steps`; `step-*` color classes go on individual `step` items
|
||||||
- To mark a step with the primary color, add `step-primary` to that `li`
|
- To mark a step with the primary color, add `step-primary` to that `li`
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,20 @@
|
||||||
### swap
|
### swap
|
||||||
|
|
||||||
Swap allows you to toggle the visibility of two elements using a checkbox or a class name
|
Swap allows you to toggle the visibility of two elements using a checkbox or a class name
|
||||||
|
|
||||||
[swap docs](https://daisyui.com/components/swap/)
|
[swap docs](https://daisyui.com/components/swap/)
|
||||||
|
|
||||||
#### Class Names:
|
#### Class Names:
|
||||||
|
|
||||||
- Component: `swap`
|
- Component: `swap`
|
||||||
- Part: `swap-on`, `swap-off`, `swap-indeterminate`
|
- Part: `swap-on`, `swap-off`, `swap-indeterminate`
|
||||||
- Modifier: `swap-active`
|
- Modifier: `swap-active`
|
||||||
- Style: `swap-rotate`, `swap-flip`
|
- Style: `swap-rotate`, `swap-flip`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
Using checkbox
|
Using checkbox
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<label class="swap {MODIFIER}">
|
<label class="swap {MODIFIER}">
|
||||||
<input type="checkbox" />
|
<input type="checkbox" />
|
||||||
|
|
@ -20,6 +24,7 @@ Using checkbox
|
||||||
```
|
```
|
||||||
|
|
||||||
Using class name
|
Using class name
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="swap {MODIFIER}">
|
<div class="swap {MODIFIER}">
|
||||||
<div class="swap-on">{content when active}</div>
|
<div class="swap-on">{content when active}</div>
|
||||||
|
|
@ -28,6 +33,7 @@ Using class name
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of the modifier/style class names
|
- {MODIFIER} is optional and can have one of the modifier/style class names
|
||||||
- Use only a hidden checkbox to control swap state or add/remove the `swap-active` class using JS to control state
|
- Use only a hidden checkbox to control swap state or add/remove the `swap-active` class using JS to control state
|
||||||
- To show something when the checkbox is indeterminate, use `swap-indeterminate` class
|
- To show something when the checkbox is indeterminate, use `swap-indeterminate` class
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
### tab
|
### tab
|
||||||
|
|
||||||
Tabs can be used to show a list of links in a tabbed format
|
Tabs can be used to show a list of links in a tabbed format
|
||||||
|
|
||||||
[tab docs](https://daisyui.com/components/tab/)
|
[tab docs](https://daisyui.com/components/tab/)
|
||||||
|
|
||||||
#### Class Names:
|
#### Class Names:
|
||||||
|
|
||||||
- Component: `tabs`
|
- Component: `tabs`
|
||||||
- Part: `tab`, `tab-content`
|
- Part: `tab`, `tab-content`
|
||||||
- Style: `tabs-box`, `tabs-border`, `tabs-lift`
|
- Style: `tabs-box`, `tabs-border`, `tabs-lift`
|
||||||
|
|
@ -12,7 +14,9 @@ Tabs can be used to show a list of links in a tabbed format
|
||||||
- Placement: `tabs-top`, `tabs-bottom`
|
- Placement: `tabs-top`, `tabs-bottom`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
Using buttons:
|
Using buttons:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div role="tablist" class="tabs {MODIFIER}">
|
<div role="tablist" class="tabs {MODIFIER}">
|
||||||
<button role="tab" class="tab">Tab</button>
|
<button role="tab" class="tab">Tab</button>
|
||||||
|
|
@ -20,6 +24,7 @@ Using buttons:
|
||||||
```
|
```
|
||||||
|
|
||||||
Using radio inputs:
|
Using radio inputs:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div role="tablist" class="tabs tabs-box">
|
<div role="tablist" class="tabs tabs-box">
|
||||||
<input type="radio" name="my_tabs" class="tab" aria-label="Tab" />
|
<input type="radio" name="my_tabs" class="tab" aria-label="Tab" />
|
||||||
|
|
@ -27,6 +32,7 @@ Using radio inputs:
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of the style/size class names
|
- {MODIFIER} is optional and can have one of the style/size class names
|
||||||
- Radio inputs are needed for tab content to work with tab click
|
- Radio inputs are needed for tab content to work with tab click
|
||||||
- If tabs gets a background then every tab inside it becomes rounded from both top corners
|
- If tabs gets a background then every tab inside it becomes rounded from both top corners
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,20 @@
|
||||||
### table
|
### table
|
||||||
|
|
||||||
Table can be used to show a list of data in a table format
|
Table can be used to show a list of data in a table format
|
||||||
|
|
||||||
[table docs](https://daisyui.com/components/table/)
|
[table docs](https://daisyui.com/components/table/)
|
||||||
|
|
||||||
#### Class Names:
|
#### Class Names:
|
||||||
|
|
||||||
- Component: `table`
|
- Component: `table`
|
||||||
- Modifier: `table-zebra`, `table-pin-rows`, `table-pin-cols`
|
- Modifier: `table-zebra`, `table-pin-rows`, `table-pin-cols`
|
||||||
- Size: `table-xs`, `table-sm`, `table-md`, `table-lg`, `table-xl`
|
- Size: `table-xs`, `table-sm`, `table-md`, `table-lg`, `table-xl`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="overflow-x-auto">
|
<div class="overflow-x-auto">
|
||||||
<table class="table {MODIFIER}">
|
<table class="{MODIFIER} table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th></th>
|
<th></th>
|
||||||
|
|
@ -27,5 +30,6 @@ Table can be used to show a list of data in a table format
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of each modifier/size class names
|
- {MODIFIER} is optional and can have one of each modifier/size class names
|
||||||
- The `overflow-x-auto` class is added to the wrapper div to make the table horizontally scrollable on smaller screens
|
- The `overflow-x-auto` class is added to the wrapper div to make the table horizontally scrollable on smaller screens
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,15 @@
|
||||||
### text-rotate
|
### text-rotate
|
||||||
|
|
||||||
Text Rotate can show up to 6 lines of text, one at a time, with an infinite loop animation. Duration is 10 seconds by default. The animation will pause on hover.
|
Text Rotate can show up to 6 lines of text, one at a time, with an infinite loop animation. Duration is 10 seconds by default. The animation will pause on hover.
|
||||||
|
|
||||||
[text-rotate docs](https://daisyui.com/components/text-rotate/)
|
[text-rotate docs](https://daisyui.com/components/text-rotate/)
|
||||||
|
|
||||||
#### Class Names:
|
#### Class Names:
|
||||||
|
|
||||||
- Component: `text-rotate`
|
- Component: `text-rotate`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<span class="text-rotate">
|
<span class="text-rotate">
|
||||||
<span>
|
<span>
|
||||||
|
|
@ -19,10 +22,12 @@ Text Rotate can show up to 6 lines of text, one at a time, with an infinite loop
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
```
|
```
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
Big font size, horizontally centered
|
Big font size, horizontally centered
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<span class="text-rotate max-md:text-3xl text-7xl font-title">
|
<span class="text-rotate font-title text-7xl max-md:text-3xl">
|
||||||
<span class="justify-items-center">
|
<span class="justify-items-center">
|
||||||
<span>DESIGN</span>
|
<span>DESIGN</span>
|
||||||
<span>DEVELOP</span>
|
<span>DEVELOP</span>
|
||||||
|
|
@ -33,22 +38,26 @@ Big font size, horizontally centered
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
```
|
```
|
||||||
|
|
||||||
Rotating words in a sentence, different colors for each word
|
Rotating words in a sentence, different colors for each word
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<span>
|
<span>
|
||||||
Providing AI Agents for
|
Providing AI Agents for
|
||||||
<span class="text-rotate">
|
<span class="text-rotate">
|
||||||
<span>
|
<span>
|
||||||
<span class="bg-teal-400 text-teal-800 px-2">Designers</span>
|
<span class="bg-teal-400 px-2 text-teal-800">Designers</span>
|
||||||
<span class="bg-red-400 text-red-800 px-2">Developers</span>
|
<span class="bg-red-400 px-2 text-red-800">Developers</span>
|
||||||
<span class="bg-blue-400 text-blue-800 px-2">Managers</span>
|
<span class="bg-blue-400 px-2 text-blue-800">Managers</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
```
|
```
|
||||||
|
|
||||||
Custom line height in case you have a tall font or need more vertical spacing between lines
|
Custom line height in case you have a tall font or need more vertical spacing between lines
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<span class="text-rotate max-md:text-3xl text-7xl font-title leading-[2]">
|
<span class="text-rotate font-title text-7xl leading-[2] max-md:text-3xl">
|
||||||
<span class="justify-items-center">
|
<span class="justify-items-center">
|
||||||
<span>DESIGN</span>
|
<span>DESIGN</span>
|
||||||
<span>DEVELOP</span>
|
<span>DEVELOP</span>
|
||||||
|
|
@ -61,6 +70,7 @@ Custom line height in case you have a tall font or need more vertical spacing be
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- `text-rotate` must have one span or div inside it that contains 2 to 6 spans/divs for each line of text
|
- `text-rotate` must have one span or div inside it that contains 2 to 6 spans/divs for each line of text
|
||||||
- Total duration of the loop is 10000 milliseconds by default
|
- Total duration of the loop is 10000 milliseconds by default
|
||||||
- You can set custom duration using `duration-{value}` utility class, where value is in milliseconds (e.g. `duration-12000` for 12 seconds)
|
- You can set custom duration using `duration-{value}` utility class, where value is in milliseconds (e.g. `duration-12000` for 12 seconds)
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,22 @@
|
||||||
### textarea
|
### textarea
|
||||||
|
|
||||||
Textarea allows users to enter text in multiple lines
|
Textarea allows users to enter text in multiple lines
|
||||||
|
|
||||||
[textarea docs](https://daisyui.com/components/textarea/)
|
[textarea docs](https://daisyui.com/components/textarea/)
|
||||||
|
|
||||||
#### Class Names:
|
#### Class Names:
|
||||||
|
|
||||||
- Component: `textarea`
|
- Component: `textarea`
|
||||||
- Style: `textarea-ghost`
|
- Style: `textarea-ghost`
|
||||||
- Color: `textarea-neutral`, `textarea-primary`, `textarea-secondary`, `textarea-accent`, `textarea-info`, `textarea-success`, `textarea-warning`, `textarea-error`
|
- Color: `textarea-neutral`, `textarea-primary`, `textarea-secondary`, `textarea-accent`, `textarea-info`, `textarea-success`, `textarea-warning`, `textarea-error`
|
||||||
- Size: `textarea-xs`, `textarea-sm`, `textarea-md`, `textarea-lg`, `textarea-xl`
|
- Size: `textarea-xs`, `textarea-sm`, `textarea-md`, `textarea-lg`, `textarea-xl`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<textarea class="textarea {MODIFIER}" placeholder="Bio"></textarea>
|
<textarea class="textarea {MODIFIER}" placeholder="Bio"></textarea>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of each style/color/size class names
|
- {MODIFIER} is optional and can have one of each style/color/size class names
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,19 @@
|
||||||
### theme-controller
|
### theme-controller
|
||||||
|
|
||||||
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
|
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
|
||||||
|
|
||||||
[theme-controller docs](https://daisyui.com/components/theme-controller/)
|
[theme-controller docs](https://daisyui.com/components/theme-controller/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `theme-controller`
|
- component: `theme-controller`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<input type="checkbox" value="{theme-name}" class="theme-controller" />
|
<input type="checkbox" value="{theme-name}" class="theme-controller" />
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- The value attribute of the input element should be a valid daisyUI theme name
|
- The value attribute of the input element should be a valid daisyUI theme name
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,18 @@
|
||||||
### timeline
|
### timeline
|
||||||
|
|
||||||
Timeline component shows a list of events in chronological order
|
Timeline component shows a list of events in chronological order
|
||||||
|
|
||||||
[timeline docs](https://daisyui.com/components/timeline/)
|
[timeline docs](https://daisyui.com/components/timeline/)
|
||||||
|
|
||||||
#### Class Names:
|
#### Class Names:
|
||||||
|
|
||||||
- Component: `timeline`
|
- Component: `timeline`
|
||||||
- Part: `timeline-start`, `timeline-middle`, `timeline-end`
|
- Part: `timeline-start`, `timeline-middle`, `timeline-end`
|
||||||
- Modifier: `timeline-snap-icon`, `timeline-box`, `timeline-compact`
|
- Modifier: `timeline-snap-icon`, `timeline-box`, `timeline-compact`
|
||||||
- Direction: `timeline-vertical`, `timeline-horizontal`
|
- Direction: `timeline-vertical`, `timeline-horizontal`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<ul class="timeline {MODIFIER}">
|
<ul class="timeline {MODIFIER}">
|
||||||
<li>
|
<li>
|
||||||
|
|
@ -21,6 +24,7 @@ Timeline component shows a list of events in chronological order
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of the modifier/direction class names
|
- {MODIFIER} is optional and can have one of the modifier/direction class names
|
||||||
- To make a vertical timeline, add the `timeline-vertical` class to the `ul` element or just do nothing (because its the default style.)
|
- To make a vertical timeline, add the `timeline-vertical` class to the `ul` element or just do nothing (because its the default style.)
|
||||||
- Add `timeline-snap-icon` to snap the icon to the start instead of middle
|
- Add `timeline-snap-icon` to snap the icon to the start instead of middle
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,20 @@
|
||||||
### toast
|
### toast
|
||||||
|
|
||||||
Toast is a wrapper to stack elements, positioned on the corner of page
|
Toast is a wrapper to stack elements, positioned on the corner of page
|
||||||
|
|
||||||
[toast docs](https://daisyui.com/components/toast/)
|
[toast docs](https://daisyui.com/components/toast/)
|
||||||
|
|
||||||
#### Class Names:
|
#### Class Names:
|
||||||
|
|
||||||
- Component: `toast`
|
- Component: `toast`
|
||||||
- Placement: `toast-start`, `toast-center`, `toast-end`, `toast-top`, `toast-middle`, `toast-bottom`
|
- Placement: `toast-start`, `toast-center`, `toast-end`, `toast-top`, `toast-middle`, `toast-bottom`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="toast {MODIFIER}">{CONTENT}</div>
|
<div class="toast {MODIFIER}">{CONTENT}</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of the placement class names
|
- {MODIFIER} is optional and can have one of the placement class names
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,21 @@
|
||||||
### toggle
|
### toggle
|
||||||
|
|
||||||
Toggle is a checkbox that is styled to look like a switch button
|
Toggle is a checkbox that is styled to look like a switch button
|
||||||
|
|
||||||
[toggle docs](https://daisyui.com/components/toggle/)
|
[toggle docs](https://daisyui.com/components/toggle/)
|
||||||
|
|
||||||
#### Class Names:
|
#### Class Names:
|
||||||
|
|
||||||
- Component: `toggle`
|
- Component: `toggle`
|
||||||
- Color: `toggle-primary`, `toggle-secondary`, `toggle-accent`, `toggle-neutral`, `toggle-success`, `toggle-warning`, `toggle-info`, `toggle-error`
|
- Color: `toggle-primary`, `toggle-secondary`, `toggle-accent`, `toggle-neutral`, `toggle-success`, `toggle-warning`, `toggle-info`, `toggle-error`
|
||||||
- Size: `toggle-xs`, `toggle-sm`, `toggle-md`, `toggle-lg`, `toggle-xl`
|
- Size: `toggle-xs`, `toggle-sm`, `toggle-md`, `toggle-lg`, `toggle-xl`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<input type="checkbox" class="toggle {MODIFIER}" />
|
<input type="checkbox" class="toggle {MODIFIER}" />
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of each color/size class names
|
- {MODIFIER} is optional and can have one of each color/size class names
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
### tooltip
|
### tooltip
|
||||||
|
|
||||||
Tooltip can be used to show a message when hovering over an element
|
Tooltip can be used to show a message when hovering over an element
|
||||||
|
|
||||||
[tooltip docs](https://daisyui.com/components/tooltip/)
|
[tooltip docs](https://daisyui.com/components/tooltip/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `tooltip`
|
- component: `tooltip`
|
||||||
- part: `tooltip-content`
|
- part: `tooltip-content`
|
||||||
- modifier: `tooltip-open`
|
- modifier: `tooltip-open`
|
||||||
|
|
@ -12,6 +14,7 @@ Tooltip can be used to show a message when hovering over an element
|
||||||
- color: `tooltip-primary`, `tooltip-secondary`, `tooltip-accent`, `tooltip-info`, `tooltip-success`, `tooltip-warning`, `tooltip-error`
|
- color: `tooltip-primary`, `tooltip-secondary`, `tooltip-accent`, `tooltip-info`, `tooltip-success`, `tooltip-warning`, `tooltip-error`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<div class="tooltip {MODIFIER}" data-tip="Tooltip text">
|
<div class="tooltip {MODIFIER}" data-tip="Tooltip text">
|
||||||
<button class="btn">Hover me</button>
|
<button class="btn">Hover me</button>
|
||||||
|
|
@ -19,4 +22,5 @@ Tooltip can be used to show a message when hovering over an element
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- {MODIFIER} is optional and can have one of each modifier/placement/color class names
|
- {MODIFIER} is optional and can have one of each modifier/placement/color class names
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,21 @@
|
||||||
### validator
|
### validator
|
||||||
|
|
||||||
Validator class changes the color of form elements to error or success based on input's validation rules
|
Validator class changes the color of form elements to error or success based on input's validation rules
|
||||||
|
|
||||||
[validator docs](https://daisyui.com/components/validator/)
|
[validator docs](https://daisyui.com/components/validator/)
|
||||||
|
|
||||||
#### Class names
|
#### Class names
|
||||||
|
|
||||||
- component: `validator`
|
- component: `validator`
|
||||||
- part: `validator-hint`
|
- part: `validator-hint`
|
||||||
|
|
||||||
#### Syntax
|
#### Syntax
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<input type="{type}" class="input validator" required />
|
<input type="{type}" class="input validator" required />
|
||||||
<p class="validator-hint">Error message</p>
|
<p class="validator-hint">Error message</p>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Rules
|
#### Rules
|
||||||
|
|
||||||
- Use with `input`, `select`, `textarea`
|
- Use with `input`, `select`, `textarea`
|
||||||
|
|
|
||||||
|
|
@ -25,23 +25,62 @@ daisyUI with all the default configs:
|
||||||
|
|
||||||
```css
|
```css
|
||||||
@plugin "daisyui" {
|
@plugin "daisyui" {
|
||||||
themes: light --default, dark --prefersdark;
|
themes:
|
||||||
root: ":root";
|
light --default,
|
||||||
include: ;
|
dark --prefersdark;
|
||||||
exclude: ;
|
root: ':root';
|
||||||
prefix: ;
|
include:;
|
||||||
|
exclude:;
|
||||||
|
prefix:;
|
||||||
logs: true;
|
logs: true;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
An example config:
|
An example config:
|
||||||
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)
|
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)
|
||||||
All the other themes are enabled and can be used by adding `data-theme="THEME_NAME"` to the `<html>` element
|
All the other themes are enabled and can be used by adding `data-theme="THEME_NAME"` to the `<html>` element
|
||||||
root scrollbar gutter is excluded. `daisy-` prefix is used for all daisyUI classes and console.log is disabled
|
root scrollbar gutter is excluded. `daisy-` prefix is used for all daisyUI classes and console.log is disabled
|
||||||
|
|
||||||
```css
|
```css
|
||||||
@plugin "daisyui" {
|
@plugin "daisyui" {
|
||||||
themes: light, dark, cupcake, bumblebee --default, emerald, corporate, synthwave --prefersdark, retro, cyberpunk, valentine, halloween, garden, forest, aqua, lofi, pastel, fantasy, wireframe, black, luxury, dracula, cmyk, autumn, business, acid, lemonade, night, coffee, winter, dim, nord, sunset, caramellatte, abyss, silk;
|
themes:
|
||||||
root: ":root";
|
light,
|
||||||
include: ;
|
dark,
|
||||||
|
cupcake,
|
||||||
|
bumblebee --default,
|
||||||
|
emerald,
|
||||||
|
corporate,
|
||||||
|
synthwave --prefersdark,
|
||||||
|
retro,
|
||||||
|
cyberpunk,
|
||||||
|
valentine,
|
||||||
|
halloween,
|
||||||
|
garden,
|
||||||
|
forest,
|
||||||
|
aqua,
|
||||||
|
lofi,
|
||||||
|
pastel,
|
||||||
|
fantasy,
|
||||||
|
wireframe,
|
||||||
|
black,
|
||||||
|
luxury,
|
||||||
|
dracula,
|
||||||
|
cmyk,
|
||||||
|
autumn,
|
||||||
|
business,
|
||||||
|
acid,
|
||||||
|
lemonade,
|
||||||
|
night,
|
||||||
|
coffee,
|
||||||
|
winter,
|
||||||
|
dim,
|
||||||
|
nord,
|
||||||
|
sunset,
|
||||||
|
caramellatte,
|
||||||
|
abyss,
|
||||||
|
silk;
|
||||||
|
root: ':root';
|
||||||
|
include:;
|
||||||
exclude: rootscrollgutter, checkbox;
|
exclude: rootscrollgutter, checkbox;
|
||||||
prefix: daisy-;
|
prefix: daisy-;
|
||||||
logs: false;
|
logs: false;
|
||||||
|
|
|
||||||
|
|
@ -4,18 +4,23 @@ description: Installation notes for daisyUI 5
|
||||||
---
|
---
|
||||||
|
|
||||||
## daisyUI 5 install notes
|
## daisyUI 5 install notes
|
||||||
|
|
||||||
[install guide](https://daisyui.com/docs/install/)
|
[install guide](https://daisyui.com/docs/install/)
|
||||||
|
|
||||||
1. daisyUI 5 requires Tailwind CSS 4
|
1. daisyUI 5 requires Tailwind CSS 4
|
||||||
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.
|
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.
|
||||||
3. daisyUI 5 can be installed using `npm i -D daisyui@latest` and then adding `@plugin "daisyui";` to the CSS file
|
3. daisyUI 5 can be installed using `npm i -D daisyui@latest` and then adding `@plugin "daisyui";` to the CSS file
|
||||||
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:
|
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:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<link href="https://cdn.jsdelivr.net/npm/daisyui@5" rel="stylesheet" type="text/css" />
|
<link href="https://cdn.jsdelivr.net/npm/daisyui@5" rel="stylesheet" type="text/css" />
|
||||||
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
|
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
|
||||||
```
|
```
|
||||||
|
|
||||||
5. A CSS file with Tailwind CSS and daisyUI looks like this (if it's a node dependency)
|
5. A CSS file with Tailwind CSS and daisyUI looks like this (if it's a node dependency)
|
||||||
|
|
||||||
```css
|
```css
|
||||||
@import "tailwindcss";
|
@import 'tailwindcss';
|
||||||
@plugin "daisyui";
|
@plugin "daisyui";
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ description: MANDATORY usage rules for daisyUI 5
|
||||||
---
|
---
|
||||||
|
|
||||||
## daisyUI 5 usage rules
|
## daisyUI 5 usage rules
|
||||||
|
|
||||||
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)
|
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)
|
||||||
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`
|
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`
|
||||||
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
|
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
|
||||||
|
|
@ -18,6 +19,7 @@ description: MANDATORY usage rules for daisyUI 5
|
||||||
12. Always use the default variant of daisyUI components unless the user asked for a specific variant or color. For example when you need a button, do not use `btn btn-primary`, prefer `btn`, unless the user asked for a specific variant.
|
12. Always use the default variant of daisyUI components unless the user asked for a specific variant or color. For example when you need a button, do not use `btn btn-primary`, prefer `btn`, unless the user asked for a specific variant.
|
||||||
|
|
||||||
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
|
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
|
||||||
|
|
||||||
- `component`: the required component class
|
- `component`: the required component class
|
||||||
- `part`: a child part of a component
|
- `part`: a child part of a component
|
||||||
- `style`: sets a specific style to component or part
|
- `style`: sets a specific style to component or part
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
@import "tailwindcss";
|
@import 'tailwindcss';
|
||||||
|
|
||||||
@plugin "daisyui" {
|
@plugin "daisyui" {
|
||||||
themes: nord --default, forest --prefersdark;
|
themes:
|
||||||
|
nord --default,
|
||||||
|
forest --prefersdark;
|
||||||
}
|
}
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
|
|
|
||||||
2
src/app.d.ts
vendored
2
src/app.d.ts
vendored
|
|
@ -11,4 +11,4 @@ declare global {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export { };
|
export {};
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,9 @@ import { logger } from '$lib/server/logger';
|
||||||
import type { HandleServerError } from '@sveltejs/kit';
|
import type { HandleServerError } from '@sveltejs/kit';
|
||||||
|
|
||||||
export const handleError: HandleServerError = async ({ error, event, message, status }) => {
|
export const handleError: HandleServerError = async ({ error, event, message, status }) => {
|
||||||
|
|
||||||
logger.error({ error, event, message, status });
|
logger.error({ error, event, message, status });
|
||||||
|
|
||||||
return {
|
return {
|
||||||
message: 'An Internal Error Occurred',
|
message: 'An Internal Error Occurred'
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { BicepsFlexed, Braces, Gamepad2, Globe } from "@lucide/svelte";
|
import { BicepsFlexed, Braces, Gamepad2, Globe } from '@lucide/svelte';
|
||||||
import type { Component } from "svelte";
|
import type { Component } from 'svelte';
|
||||||
|
|
||||||
type Item = {
|
type Item = {
|
||||||
icon: Component;
|
icon: Component;
|
||||||
|
|
@ -7,12 +7,9 @@ type Item = {
|
||||||
description: string;
|
description: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const name: string = "Benjamin Palko";
|
export const name: string = 'Benjamin Palko';
|
||||||
|
|
||||||
export const titles: string[] = [
|
export const titles: string[] = ['Full Stack Developer', 'Video Game Developer'];
|
||||||
"Full Stack Developer",
|
|
||||||
"Video Game Developer",
|
|
||||||
];
|
|
||||||
|
|
||||||
export const description: string =
|
export const description: string =
|
||||||
"Hi! I'm Ben, a Canadian Software Developer from Ottawa, Canada. I currently work as Full Stack Developer with a strong architectural mindsent. I enjoy learning new things and broadening my perspectives, I take pride in being a generalist which I believe gives me an edge. I enjoy working on side projects, have participated in Game Jams, fallen down the rabbit hole of Linux Ricing and Self Hosting (like this website!). I have an active life away from the desk, I do races, cycling, climbing and even wood-working! If you want to learn more about me check out my resume, my blog posts or my projects!";
|
"Hi! I'm Ben, a Canadian Software Developer from Ottawa, Canada. I currently work as Full Stack Developer with a strong architectural mindsent. I enjoy learning new things and broadening my perspectives, I take pride in being a generalist which I believe gives me an edge. I enjoy working on side projects, have participated in Game Jams, fallen down the rabbit hole of Linux Ricing and Self Hosting (like this website!). I have an active life away from the desk, I do races, cycling, climbing and even wood-working! If you want to learn more about me check out my resume, my blog posts or my projects!";
|
||||||
|
|
@ -20,26 +17,26 @@ export const description: string =
|
||||||
export const activities: Item[] = [
|
export const activities: Item[] = [
|
||||||
{
|
{
|
||||||
icon: Globe,
|
icon: Globe,
|
||||||
title: "Web Development",
|
title: 'Web Development',
|
||||||
description:
|
description:
|
||||||
"I have been doing this for a living for almost 7 years. I've worked on projects from Python, to Java EE, Spring Framework, .NET and a whole lot of the jungle of the Javascript/Typescript ecosystem.",
|
"I have been doing this for a living for almost 7 years. I've worked on projects from Python, to Java EE, Spring Framework, .NET and a whole lot of the jungle of the Javascript/Typescript ecosystem."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: Gamepad2,
|
icon: Gamepad2,
|
||||||
title: "Game Development",
|
title: 'Game Development',
|
||||||
description:
|
description:
|
||||||
"I've worked in both Unity and Godot, I hope to build my own engine and/or become a contributor! It's a hobby I do out of passion and inspiration.",
|
"I've worked in both Unity and Godot, I hope to build my own engine and/or become a contributor! It's a hobby I do out of passion and inspiration."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: BicepsFlexed,
|
icon: BicepsFlexed,
|
||||||
title: "Athletics",
|
title: 'Athletics',
|
||||||
description:
|
description:
|
||||||
"Self-proclaimed athlete, cyclist, runner and racer. I love the outdoors and I try to get out as much as I can. Excercise is important for keeping your mind sharp!",
|
'Self-proclaimed athlete, cyclist, runner and racer. I love the outdoors and I try to get out as much as I can. Excercise is important for keeping your mind sharp!'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: Braces,
|
icon: Braces,
|
||||||
title: "Linux Ricing",
|
title: 'Linux Ricing',
|
||||||
description:
|
description:
|
||||||
"Not just a hobby, it's a lifestyle. A Pandora's box of taking back control of your tech life, and be warned, it doesn't end with just your desktop.",
|
"Not just a hobby, it's a lifestyle. A Pandora's box of taking back control of your tech life, and be warned, it doesn't end with just your desktop."
|
||||||
},
|
}
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -1,35 +1,35 @@
|
||||||
export type Categories = 'development' | 'work' | 'life';
|
export type Categories = 'development' | 'work' | 'life';
|
||||||
|
|
||||||
export type Post = {
|
export type Post = {
|
||||||
title: string
|
title: string;
|
||||||
slug: string
|
slug: string;
|
||||||
description: string
|
description: string;
|
||||||
image: {
|
image: {
|
||||||
url: string;
|
url: string;
|
||||||
alt: string;
|
alt: string;
|
||||||
}
|
};
|
||||||
date: string
|
date: string;
|
||||||
categories: Categories[]
|
categories: Categories[];
|
||||||
published: boolean
|
published: boolean;
|
||||||
}
|
};
|
||||||
|
|
||||||
export async function getPosts() {
|
export async function getPosts() {
|
||||||
const posts: Post[] = []
|
const posts: Post[] = [];
|
||||||
|
|
||||||
const paths = import.meta.glob('/src/lib/posts/*.md', { eager: true })
|
const paths = import.meta.glob('/src/lib/posts/*.md', { eager: true });
|
||||||
|
|
||||||
for (const path in paths) {
|
for (const path in paths) {
|
||||||
const file = paths[path]
|
const file = paths[path];
|
||||||
const slug = path.split('/').at(-1)?.replace('.md', '')
|
const slug = path.split('/').at(-1)?.replace('.md', '');
|
||||||
|
|
||||||
if (file && typeof file === 'object' && 'metadata' in file && slug) {
|
if (file && typeof file === 'object' && 'metadata' in file && slug) {
|
||||||
const metadata = file.metadata as Omit<Post, 'slug'>
|
const metadata = file.metadata as Omit<Post, 'slug'>;
|
||||||
const post = { ...metadata, slug } satisfies Post
|
const post = { ...metadata, slug } satisfies Post;
|
||||||
if (post.published) posts.push(post)
|
if (post.published) posts.push(post);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return posts.sort((first, second) =>
|
return posts.sort(
|
||||||
new Date(second.date).getTime() - new Date(first.date).getTime()
|
(first, second) => new Date(second.date).getTime() - new Date(first.date).getTime()
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,15 +2,14 @@ import { error } from '@sveltejs/kit';
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load: PageLoad = async ({ params }) => {
|
export const load: PageLoad = async ({ params }) => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const post = await import(`../../../lib/posts/${params.slug}.md`)
|
const post = await import(`../../../lib/posts/${params.slug}.md`);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
content: post.default,
|
content: post.default,
|
||||||
meta: post.metadata
|
meta: post.metadata
|
||||||
}
|
};
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
error(404, `Could not find ${params.slug}`)
|
error(404, `Could not find ${params.slug}`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue