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#

Terminal
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:

JavaScript
// 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:

TSX
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:

TSX
Loading preview...

Theme Toggle#

Add a theme toggle to your app:

TSX
import { ThemeToggle } from '@sigx/daisyui';

// Simple toggle between light and dark
<ThemeToggle />

// Or with custom themes
<ThemeToggle themes={['light', 'dark', 'cupcake']} />

Next Steps#