--- name: daisy-ui description: A Tailwind CSS component library that provides a set of pre-designed UI components. Use for accessible, themed components that match Williamstown SC brand. --- # daisy-ui ## Instructions Follow documentation from [./llms.txt](./llms.txt) to produce code that uses DaisyUI components and themes according to the project's tech stack and coding standards outlined in the main [CLAUDE.md](../../CLAUDE.md) file. ## Theme Customization Configure DaisyUI theme in `tailwind.config.js` for Williamstown SC brand identity: ### Primary Colors - `primary`: #062174 (Club blue - traditional, trustworthy) - `secondary`: #DEB100 (Club yellow/gold - energy, visibility) - `accent`: #10B981 (Green - soccer field aesthetic) - `neutral`: #1F2937 (Dark gray for text) - `base-100`: #FFFFFF (White backgrounds) - `base-200`: #F3F4F6 (Light gray backgrounds) - `base-300`: #E5E7EB (Medium gray borders) ### Typography Guidelines - Use `font-sans` with system fonts or Inter - Ensure minimum 16px base font size for accessibility - Apply proper line-height (1.5+ for body text) - Use font-weight variations: 400 (regular), 500 (medium), 600 (semibold), 700 (bold) ### Theme Configuration Example ```js // tailwind.config.js module.exports = { plugins: [require('daisyui')], daisyui: { themes: [ { williamstown: { primary: '#062174', // Club blue 'primary-content': '#FFFFFF', secondary: '#DEB100', // Club gold 'secondary-content': '#000000', accent: '#10B981', // Soccer green 'accent-content': '#FFFFFF', neutral: '#1F2937', 'neutral-content': '#FFFFFF', 'base-100': '#FFFFFF', // White 'base-200': '#F3F4F6', // Light gray 'base-300': '#E5E7EB', // Medium gray 'base-content': '#1F2937', info: '#3ABFF8', 'info-content': '#000000', success: '#36D399', 'success-content': '#000000', warning: '#FBBD23', 'warning-content': '#000000', error: '#F87272', 'error-content': '#000000' } } ] } }; ``` ## Component Selection ### Use DaisyUI Components For **Navigation & Menus:** - `navbar` - Top navigation bar - `menu` - Vertical/horizontal menu lists - `dropdown` - Dropdown menus - `drawer` - Mobile slide-out navigation - `breadcrumbs` - Page navigation trail **Actions:** - `btn` - Buttons with variants (btn-primary, btn-secondary, btn-ghost, btn-outline) - `btn-group` - Grouped button sets - `swap` - Toggle/swap icons (menu hamburger) - `link` - Styled links **Data Display:** - `card` - Content cards for news, fixtures, players - `badge` - Labels and tags - `avatar` - Profile pictures - `stat` - Statistics display (goals, wins, etc.) - `table` - Data tables for fixtures/results - `timeline` - Match history timeline **Forms:** - `input` - Text inputs with validation states - `textarea` - Multi-line text - `select` - Dropdown select - `checkbox` - Checkboxes - `radio` - Radio buttons - `toggle` - Toggle switches - `range` - Range sliders - `file-input` - File upload **Feedback:** - `alert` - Notifications and messages - `modal` - Modal dialogs - `toast` - Toast notifications - `loading` - Loading spinners - `skeleton` - Loading skeletons - `progress` - Progress bars **Layout:** - `divider` - Section dividers - `stack` - Vertical stacking - `join` - Join elements together - `indicator` - Notification indicators ### Use Custom Tailwind For - Hero sections with glassmorphism effects - Complex asymmetric layouts - Custom animations and transitions - Grid-breaking designs from frontend-design skill - Unique spacing patterns - Advanced visual effects (backdrop-blur, gradients) ## Accessibility Patterns ### WCAG AA Compliance 1. **Color Contrast:** - DaisyUI automatically ensures contrast for text/background combinations - Verify custom colors meet 4.5:1 ratio for normal text - Verify custom colors meet 3:1 ratio for large text (18px+) 2. **Touch Targets:** - Use `btn-lg` for primary CTAs (ensures 44x44px minimum) - Default `btn` is 48px height (meets requirements) - Use `btn-sm` sparingly, only for secondary actions 3. **Form Accessibility:** ```jsx ``` 4. **Focus States:** - DaisyUI includes visible focus indicators by default - Test all interactive elements with keyboard navigation - Use `focus:` variants for custom styling 5. **Semantic HTML:** - DaisyUI components use proper semantic HTML - Add ARIA labels where needed: `aria-label`, `aria-describedby` - Use `role` attribute for custom components ## Common Patterns for Sports Clubs ### Match/Fixture Card ```jsx

Round 5

Home

Williamstown SC

2 - 1

Opposition FC

``` ### News Card ```jsx
News headline
News
Senior Men

2026 Senior Men's Coaching Team

Exciting announcement about our coaching lineup for the upcoming season...

2 days ago
``` ### Navigation Header ```jsx
WILLIAMSTOWN SC
``` ### Player Card ```jsx
Player name

John Smith

Midfielder

15
Appearances
24
Goals
8
``` ### Event Card ```jsx
15
NOV

Season Launch Event

6:00 PM - 9:00 PM

Join us for the official 2026 season launch with the new coaching team...

``` ## Responsive Utilities ### Breakpoint Classes Use DaisyUI's responsive modifiers with Tailwind breakpoints: ```jsx // Button sizes // Card layout
{/* Cards adapt to screen size */}
// Navigation drawer (mobile)
{/* Page content */}
{/* Sidebar menu */}
``` ### Mobile-First Patterns ```jsx // Hide on mobile, show on desktop
Desktop Menu
// Show on mobile, hide on desktop
Mobile Menu
// Collapse for accordion on mobile
Click to expand
Content
``` ## Form Validation States ```jsx // Success state // Error state Please enter a valid email address // Warning state // Disabled state ``` ## Loading States ```jsx // Button loading // Skeleton loader
// Card skeleton
``` ## Modal Patterns ```jsx // Basic modal

Match Report

Detailed match information goes here...

// Modal with backdrop

Confirm Action

Are you sure you want to proceed?

``` ## Performance Considerations ### Bundle Size - DaisyUI adds approximately 25KB gzipped to your bundle - Components are CSS-only (no JavaScript overhead) - Use Tailwind's JIT mode for optimal bundle size - Purge unused styles in production ### Optimization Tips ```js // tailwind.config.js - Limit DaisyUI themes for smaller bundle daisyui: { themes: ['williamstown'], // Only include what you need darkTheme: false, // Disable if not using dark mode base: true, styled: true, utils: true, } ``` ### Tree Shaking DaisyUI components are automatically tree-shaken when not used. Only include components you actually reference in your HTML/JSX. ## Combining DaisyUI with Custom Styles ### When to Mix ```jsx // DaisyUI component with custom Tailwind
{/* Glassmorphism effect added to DaisyUI card */}
// DaisyUI with custom animations ``` ### Extending DaisyUI Components ```js // tailwind.config.js module.exports = { theme: { extend: { // Add custom animations animation: { 'fade-in': 'fadeIn 0.3s ease-in' }, keyframes: { fadeIn: { '0%': { opacity: '0', transform: 'translateY(10px)' }, '100%': { opacity: '1', transform: 'translateY(0)' } } } } } }; ``` ## Component Composition ### Building Complex Components ```jsx // Fixture list with stats const FixtureList = () => (
Date Home Score Away Status
Nov 15 Williamstown SC 2 - 1 Opposition FC
Win
); ``` ## Best Practices 1. **Always use semantic HTML** - DaisyUI builds on proper semantic elements 2. **Test keyboard navigation** - Ensure all interactive elements are keyboard accessible 3. **Verify color contrast** - Use tools to check WCAG compliance 4. **Use consistent spacing** - Stick to Tailwind's spacing scale (p-4, gap-4, etc.) 5. **Leverage data-theme** - Apply theme to container elements: `
` 6. **Mobile-first design** - Start with mobile styles, add responsive modifiers 7. **Avoid !important** - Use Tailwind's specificity instead 8. **Document custom variants** - Keep track of custom component combinations ## Common Pitfalls ❌ **Don't:** - Mix inline styles with DaisyUI classes - Override DaisyUI CSS variables without understanding the system - Create custom components when DaisyUI has a solution - Ignore accessibility features built into components ✅ **Do:** - Use DaisyUI's theme system for customization - Extend with Tailwind utilities when needed - Test components across breakpoints - Maintain consistent spacing and sizing - Follow the component composition patterns above ## Quick Reference ### Component Class Patterns ``` Button: btn btn-{variant} btn-{size} Card: card card-{variant} Input: input input-{variant} input-{size} Badge: badge badge-{variant} badge-{size} Alert: alert alert-{variant} Modal: modal modal-{position} ``` ### Color Variants ``` primary, secondary, accent, neutral, info, success, warning, error, ghost ``` ### Size Modifiers ``` xs, sm, md (default), lg, xl ``` ### State Modifiers ``` disabled, loading, active, focus ```