Getting Started with DaisyUI
Prerequisites
Before continuing, make sure you're familiar with: SignalX Core basics, Components
SignalX DaisyUI provides pre-built, accessible UI components powered by DaisyUI and Tailwind CSS.
Installation
pnpm add @sigx/daisyui
Make sure you also have Tailwind CSS and DaisyUI configured in your project.
Setup
1. Configure Tailwind
Add DaisyUI to your Tailwind config:
// tailwind.config.js
module.exports = {
content: ['./src/**/*.{tsx,ts,jsx,js}'],
plugins: [require('daisyui')],
daisyui: {
themes: ['light', 'dark', 'cupcake', 'forest'],
},
};
2. Initialize Theme
Initialize the theme system in your app:
import { component, onMounted } from 'sigx';
import { initializeTheme } from '@sigx/daisyui';
const App = component(() => {
onMounted(() => {
initializeTheme({ defaultTheme: 'dark' });
});
return () => <div>...</div>;
});
Using Components
Import and use components directly:
Loading preview...
Theme Toggle
Add a theme toggle to your app:
import { ThemeToggle } from '@sigx/daisyui';
// Simple toggle between light and dark
<ThemeToggle />
// Or with custom themes
<ThemeToggle themes={['light', 'dark', 'cupcake']} />
Next Steps
- Components - Browse all available components
- Theming - Customize themes and colors
- API Reference - Complete API documentation