What is daisyui?
DaisyUI is a plugin for Tailwind CSS that provides a set of pre-designed components and utilities to help developers quickly build modern and responsive user interfaces. It extends Tailwind CSS with additional classes and components, making it easier to create consistent and visually appealing designs.
What are daisyui's main functionalities?
Pre-designed Components
DaisyUI offers a variety of pre-designed components such as buttons, cards, modals, and more. These components come with default styles that can be easily customized using Tailwind CSS classes.
<button class="btn btn-primary">Primary Button</button>
Utility Classes
In addition to components, DaisyUI provides utility classes that extend Tailwind CSS. These utilities help in quickly applying common styles like padding, margin, background colors, and more.
<div class="bg-base-200 p-4 rounded-lg">Content goes here</div>
Theming
DaisyUI supports theming, allowing developers to switch between different themes easily. This is useful for creating dark mode or other custom themes for your application.
<html data-theme="dark"><body>...</body></html>
Responsive Design
DaisyUI components are designed to be responsive out of the box. This means they adapt to different screen sizes, making it easier to build mobile-friendly applications.
<div class="card lg:card-side bg-base-100 shadow-xl">...</div>
Other packages similar to daisyui
tailwindcss
Tailwind CSS is a utility-first CSS framework that provides low-level utility classes to build custom designs. While DaisyUI extends Tailwind CSS with pre-designed components, Tailwind CSS itself focuses on providing the building blocks for custom designs.
bootstrap
Bootstrap is a popular CSS framework that provides a set of pre-designed components and a grid system. Unlike DaisyUI, which is a plugin for Tailwind CSS, Bootstrap is a standalone framework with its own set of design principles and utilities.
material-ui
Material-UI is a React component library that implements Google's Material Design. It offers a wide range of pre-designed components and theming capabilities. While DaisyUI is built on top of Tailwind CSS, Material-UI is a standalone library specifically for React applications.
ant-design
Ant Design is a comprehensive design system and React UI library. It provides a wide range of high-quality components and design guidelines. Similar to DaisyUI, it aims to help developers build consistent and visually appealing user interfaces, but it is specifically tailored for React applications.
Tailwind CSS Components
Adds component classes like btn
, card
and more to Tailwind CSS
[ See all components ]
daisyUI
š¼ Features
show / hide
- Tailwind CSS plugin
daisyUI is a Tailwind CSS plugin. Install it and add it to your tailwind.config.js
file. - Component classes
Adds component classes to Tailwind. Classes like btn
, card
,ā¦ So you will end up with a cleaner HTML. - Semantic color names
Adds color names like primary
, secondary
, accent
,ā¦. - Customizable
You can customize the design of components with Tailwind utility classes and CSS variables. - Themeable
Add multiple themes and customize colors. You can even set a theme for a specific section of your page. - RTL supported
Enable rtl
config for right to left layouts. - Pure CSS
No script file, no dependencies. Works on all frameworks and environments!
š Install now!
npm i daisyui
Then add daisyUI to your tailwind.config.js
[ Read more ]
module.exports = {
plugins: [
require('daisyui'),
],
}
Or use a CDN
Loading CSS files from CDN is not recommended for production. It's better to install Tailwind and daisyUI as Nodejs dependencies so you can config/customize everything, and purge unused styles.*
<link href="https://cdn.jsdelivr.net/npm/daisyui@1.25.3/dist/full.css" rel="stylesheet" type="text/css" />
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2/dist/tailwind.min.css" rel="stylesheet" type="text/css" />
š Use
Use component classes to build your UI.
<a class="btn">Hello!</a>
<input type="checkbox" class="checkbox"/>
<input type="checkbox" class="toggle"/>
<div class="alert alert-success">
Message sent successfully
</div>
š See all components
š² Try it online
š Documents + Examples
See the official site:
[ daisyui.com āļø ]
š¤ Contributing
Read the documents for more info:
[ Read contribution guide ]
List of Components
show / hide
Featured on:
show / hide
- Blogs
- Youtube videos
- Courses
ą¼¼ ć¤ ā_ā ą¼½ć¤ Please share