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.
![](https://raw.githubusercontent.com/saadeghi/files/main/daisyui/logo.svg)
UI Components for Tailwind CSS
Themeable, Scalable and Designer-Friendly
[ See all components ]
![](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2Fsaadeghi%2Fdaisyui)
DaisyUI
![](https://badgen.net/badgesize/normal/https/unpkg.com/daisyui/dist/styled.css?label=styled.css%20size&color=purple)
![](https://badgen.net/github/license/saadeghi/daisyui?color=purple)
đ Links
đŧ Features
- CSS components: Use classes like
btn
, card
, ... - Designer-friendly: DaisyUI has 2 versions:
- Styled: Beatiful UI library, no need to design elements (but still customizable).
- Base: Only skeleton of components. No style, no colors.
- Scalable: All your components will use the same style based on a design system.
- Customizable: Customize the style of elements with Tailwind utility classes.
- Themeable: Add multiple themes or change colors with a CSS variable.
- Semantic color names: Use color names like
primary
, secondary
, accent
, ... just like your design system defines.
[ read more ]
đŠâđģ Install
npm i daisyui
Then add plugin and preset to tailwind.config.js
module.exports = {
plugins: [
require('daisyui/styled'),
],
presets: [
require('daisyui/preset')
],
}
Or use a CDN
(Not recommended for production)
Version | Description | URL |
---|
Base ![](https://badgen.net/badgesize/normal/https/unpkg.com/daisyui/dist/base.css?label=base.css%20size&color=purple) | Unstyled UI components (Basic layout, no color, no visual style) | https://unpkg.com/daisyui@latest/dist/base.css |
Styled ![](https://badgen.net/badgesize/normal/https/unpkg.com/daisyui/dist/styled.css?label=styled.css%20size&color=purple) | DaisyUI Styled UI components (But you can't use DaisyUI colors on other elements) | https://unpkg.com/daisyui@latest/dist/styled.css |
Full ![](https://badgen.net/badgesize/normal/https/unpkg.com/daisyui/dist/full.css?label=full.css%20size&color=purple) | Tailwind default style + DaisyUI styled UI components (But it's a large file for production) | https://unpkg.com/daisyui@latest/dist/full.css |
đ¨ Customize theme and colors (optional)
Add your custom colors in CSS file
[ Theming guide and examples âī¸ ]
Quick example
:root {
--d: 0 0% 100%;
--p1: 340 82% 62%;
--p2: 340 82% 52%;
--p3: 340 82% 42%;
--s1: 262 52% 56%;
--s2: 262 52% 46%;
--s3: 262 52% 36%;
--a1: 199 98% 58%;
--a2: 199 98% 48%;
--a3: 199 98% 38%;
--c1: 220 14% 96%;
--c2: 228 14% 93%;
--c3: 220 15% 84%;
--c4: 218 14% 65%;
--c5: 220 14% 46%;
--c6: 220 14% 37%;
--c7: 219 14% 28%;
--c8: 222 13% 19%;
--c9: 223 14% 10%;
--cp: 0 0% 100%;
--cs: 0 0% 100%;
--ca: 0 0% 100%;
--in: 207 90% 54%;
--su: 174 100% 29%;
--wa: 36 100% 50%;
--er: 14 100% 57%;
}
Please share
![](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2Fsaadeghi%2Fdaisyui)