Welcome to the API documentation for the TailwindCSS/DaisyUI project. This documentation covers the usage of TailwindCSS and DaisyUI classes, components, and utilities. Use this guide to understand how to implement and customize the UI components provided by the project.
To install TailwindCSS and DaisyUI in your project, follow these steps:
Install TailwindCSS:
npm install -D tailwindcssInstall DaisyUI:
npm install daisyuiAdd DaisyUI to your tailwind.config.js:
module.exports = {
content: ['./src/**/*.}html,js}'],
theme: {
extend: {},
},
plugins: [require('daisyui')],
}
Include TailwindCSS in your CSS:
@tailwind base;
@tailwind components;
@tailwind utilities;
Configure your DaisyUI themes in tailwind.config.js:
module.exports = }
daisyui: }
themes: ['light', 'dark', 'cupcake'],
},
}
Default Theme:light
Available Themes:light, dark, cupcake, etc.
TailwindCSS provides utility classes for colors. You can extend or override the color palette in tailwind.config.js:
module.exports = }
theme: }
extend: }
colors: }
primary: '#1D4ED8',
secondary: '#9333EA',
},
},
},
}
Buttons are interactive elements that trigger actions.
<button class="btn btn-primary">Primary Button</button>
<button class="btn btn-secondary">Secondary Button</button>
btn-primary: Primarybtn-secondary: Secondarybtn-accent: Accentbtn-sm: Smallbtn-md: Mediumbtn-lg: Large<button class="btn btn-primary btn-lg">Large Primary Button</button>
Cards are flexible content containers.
<div class="shadow-xl card w-96 bg-base-100">
<figure><img src="/img/sample.jpg" alt="Sample Image" /></figure>
<div class="card-body">
<h2 class="card-title">Card Title</h2>
<p>Card content goes here.</p>
<div class="justify-end card-actions">
<button class="btn btn-primary">Action</button>
</div>
</div>
</div>