Skip to main content

Quickstart

This guide walks you through creating a simple Flowery.Uno application with themed controls, icons, and runtime theme switching.

Prerequisites

Create Your First App

1
Set Up Your Window
2
Create a main window with the Daisy base background:
3
<Window
    x:Class="MyApp.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:daisy="using:Flowery.Controls">

    <Grid Background="{ThemeResource DaisyBase100Brush}">
        <!-- Your content goes here -->
    </Grid>
</Window>
4
Key Points:
  • Always use xmlns:daisy="using:Flowery.Controls" to access Flowery controls
  • Use {ThemeResource DaisyBase100Brush} for page backgrounds to support theme switching
5
Add Basic Controls
6
Let’s create a simple form with various Flowery controls:
7
<Window
    x:Class="MyApp.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:daisy="using:Flowery.Controls">

    <Grid Background="{ThemeResource DaisyBase100Brush}" Padding="40">
        <StackPanel Spacing="20" MaxWidth="400" HorizontalAlignment="Center" VerticalAlignment="Center">
            
            <!-- Header -->
            <TextBlock 
                Text="Welcome to Flowery.Uno" 
                FontSize="32" 
                FontWeight="Bold"
                Foreground="{ThemeResource DaisyBaseContentBrush}" />
            
            <!-- Theme Switcher -->
            <daisy:DaisyThemeDropdown MinWidth="220" />
            
            <!-- Buttons -->
            <StackPanel Spacing="12">
                <daisy:DaisyButton 
                    Content="Primary Button" 
                    Variant="Primary" 
                    HorizontalAlignment="Stretch" />
                
                <daisy:DaisyButton 
                    Content="Secondary Button" 
                    Variant="Secondary" 
                    HorizontalAlignment="Stretch" />
                
                <daisy:DaisyButton 
                    Content="Outline Button" 
                    Variant="Accent" 
                    ButtonStyle="Outline"
                    HorizontalAlignment="Stretch" />
            </StackPanel>
            
            <!-- Input Fields -->
            <daisy:DaisyInput 
                PlaceholderText="Enter your name"
                Label="Name"
                Variant="Bordered" />
            
            <daisy:DaisyInput 
                PlaceholderText="Type something..."
                Label="Message"
                Variant="Filled"
                AcceptsReturn="True"
                MinHeight="100" />
            
            <!-- Card -->
            <daisy:DaisyCard Padding="20">
                <StackPanel Spacing="8">
                    <TextBlock 
                        Text="Info Card" 
                        FontSize="18" 
                        FontWeight="SemiBold"
                        Foreground="{ThemeResource DaisyBaseContentBrush}" />
                    <TextBlock 
                        Text="This is a themed card component that automatically updates when you change themes."
                        TextWrapping="Wrap"
                        Foreground="{ThemeResource DaisyBaseContentBrush}"
                        Opacity="0.8" />
                </StackPanel>
            </daisy:DaisyCard>
            
        </StackPanel>
    </Grid>
</Window>
8
Add Theme Switching Logic (Optional)
9
If you want to programmatically control themes, add this to your code-behind:
10
using Flowery.Controls;
using Microsoft.UI.Xaml;

namespace MyApp;

public sealed partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
        
        // Optional: Set initial theme
        DaisyThemeManager.ApplyTheme("Dark");
        
        // Optional: Listen for theme changes
        DaisyThemeManager.ThemeChanged += OnThemeChanged;
    }
    
    private void OnThemeChanged(object? sender, string themeName)
    {
        // React to theme changes
        System.Diagnostics.Debug.WriteLine($"Theme changed to: {themeName}");
    }
}
12
For best results, initialize design tokens early in your App.xaml.cs:
13
using Flowery.Theming;
using Microsoft.UI.Xaml;

namespace MyApp;

public partial class App : Application
{
    public App()
    {
        InitializeComponent();
    }
    
    protected override void OnLaunched(LaunchActivatedEventArgs args)
    {
        // Seed design tokens before creating windows
        DaisyResourceLookup.EnsureTokens();
        
        // Optional: Apply saved theme preference
        DaisyThemeManager.ApplyTheme("Synthwave");
        
        MainWindow = new MainWindow();
        MainWindow.Activate();
    }
}
14
When to use EnsureTokens():
  • If you’re doing layout calculations before any Daisy control renders
  • If you’re setting theme before creating the main window
  • Most simple apps don’t need this, but it’s a good practice for complex layouts

Control Variants

Flowery.Uno controls support multiple variants matching DaisyUI’s semantic color system:

Button Variants

<StackPanel Spacing="8">
    <daisy:DaisyButton Content="Default" />
    <daisy:DaisyButton Content="Primary" Variant="Primary" />
    <daisy:DaisyButton Content="Secondary" Variant="Secondary" />
    <daisy:DaisyButton Content="Accent" Variant="Accent" />
    <daisy:DaisyButton Content="Ghost" Variant="Ghost" />
    <daisy:DaisyButton Content="Link" Variant="Link" />
    <daisy:DaisyButton Content="Info" Variant="Info" />
    <daisy:DaisyButton Content="Success" Variant="Success" />
    <daisy:DaisyButton Content="Warning" Variant="Warning" />
    <daisy:DaisyButton Content="Error" Variant="Error" />
</StackPanel>

Button Styles

<StackPanel Spacing="8" Orientation="Horizontal">
    <daisy:DaisyButton Content="Default" Variant="Primary" />
    <daisy:DaisyButton Content="Outline" Variant="Primary" ButtonStyle="Outline" />
    <daisy:DaisyButton Content="Soft" Variant="Primary" ButtonStyle="Soft" />
    <daisy:DaisyButton Content="Dash" Variant="Primary" ButtonStyle="Dash" />
</StackPanel>

Button Sizes

<StackPanel Spacing="8" Orientation="Horizontal" VerticalAlignment="Center">
    <daisy:DaisyButton Content="Tiny" Size="Tiny" Variant="Primary" />
    <daisy:DaisyButton Content="Small" Size="Small" Variant="Primary" />
    <daisy:DaisyButton Content="Medium" Size="Medium" Variant="Primary" />
    <daisy:DaisyButton Content="Large" Size="Large" Variant="Primary" />
    <daisy:DaisyButton Content="Extra Large" Size="ExtraLarge" Variant="Primary" />
</StackPanel>

Input Variants

<StackPanel Spacing="12">
    <daisy:DaisyInput PlaceholderText="Bordered input" Variant="Bordered" />
    <daisy:DaisyInput PlaceholderText="Ghost input" Variant="Ghost" />
    <daisy:DaisyInput PlaceholderText="Filled input" Variant="Filled" />
    <daisy:DaisyInput PlaceholderText="Primary input" Variant="Primary" />
    <daisy:DaisyInput PlaceholderText="Secondary input" Variant="Secondary" />
    <daisy:DaisyInput PlaceholderText="Accent input" Variant="Accent" />
</StackPanel>

Available Themes

Flowery.Uno includes all 35+ official DaisyUI themes: Light Themes: Light, Acid, Autumn, Bumblebee, Caramellatte, CMYK, Corporate, Cupcake, Cyberpunk, Emerald, Fantasy, Garden, Lemonade, Lofi, Nord, Pastel, Retro, Silk, Valentine, Winter, Wireframe Dark Themes: Dark, Abyss, Aqua, Black, Business, Coffee, Dim, Dracula, Forest, Halloween, Luxury, Night, Smooth, Sunset, Synthwave

Theme Switching Options

<!-- Full theme picker with color previews -->
<daisy:DaisyThemeDropdown MinWidth="220" />

Key Concepts

Using ThemeResource

Always use {ThemeResource} for Daisy palette brushes, not {StaticResource}. This ensures colors update when themes change.
<!-- ✅ Correct: Updates when theme changes -->
<Border Background="{ThemeResource DaisyBase200Brush}" />

<!-- ❌ Wrong: Won't update when theme changes -->
<Border Background="{StaticResource DaisyBase200Brush}" />

Common Palette Resources

ResourceUsage
DaisyBase100BrushPage/window background
DaisyBase200BrushElevated surfaces (cards, sidebar)
DaisyBase300BrushBorders
DaisyBaseContentBrushDefault text/icon color
DaisyPrimaryBrushPrimary accent color
DaisySecondaryBrushSecondary accent
DaisyAccentBrushTertiary accent
DaisySuccessBrushSuccess status color
DaisyErrorBrushError status color

Complete Example

Here’s a complete working example you can copy and paste:
MainWindow.xaml
<Window
    x:Class="MyApp.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:daisy="using:Flowery.Controls">

    <Grid Background="{ThemeResource DaisyBase100Brush}">
        <ScrollViewer>
            <StackPanel Padding="40" Spacing="24" MaxWidth="600">
                
                <!-- Header with theme switcher -->
                <Grid ColumnDefinitions="*,Auto">
                    <TextBlock 
                        Text="Flowery.Uno Demo" 
                        FontSize="32" 
                        FontWeight="Bold"
                        Foreground="{ThemeResource DaisyBaseContentBrush}"
                        VerticalAlignment="Center" />
                    <daisy:DaisyThemeDropdown Grid.Column="1" MinWidth="200" />
                </Grid>
                
                <!-- Button showcase -->
                <daisy:DaisyCard Padding="20">
                    <StackPanel Spacing="12">
                        <TextBlock 
                            Text="Buttons" 
                            FontSize="20" 
                            FontWeight="SemiBold"
                            Foreground="{ThemeResource DaisyBaseContentBrush}" />
                        
                        <StackPanel Spacing="8" Orientation="Horizontal">
                            <daisy:DaisyButton Content="Primary" Variant="Primary" />
                            <daisy:DaisyButton Content="Secondary" Variant="Secondary" />
                            <daisy:DaisyButton Content="Accent" Variant="Accent" />
                        </StackPanel>
                        
                        <StackPanel Spacing="8" Orientation="Horizontal">
                            <daisy:DaisyButton Content="Outline" Variant="Primary" ButtonStyle="Outline" />
                            <daisy:DaisyButton Content="Ghost" Variant="Ghost" />
                            <daisy:DaisyButton Content="Link" Variant="Link" />
                        </StackPanel>
                    </StackPanel>
                </daisy:DaisyCard>
                
                <!-- Input showcase -->
                <daisy:DaisyCard Padding="20">
                    <StackPanel Spacing="12">
                        <TextBlock 
                            Text="Inputs" 
                            FontSize="20" 
                            FontWeight="SemiBold"
                            Foreground="{ThemeResource DaisyBaseContentBrush}" />
                        
                        <daisy:DaisyInput 
                            Label="Name"
                            PlaceholderText="Enter your name"
                            Variant="Bordered" />
                        
                        <daisy:DaisyInput 
                            Label="Email"
                            PlaceholderText="[email protected]"
                            Variant="Primary" />
                        
                        <daisy:DaisyInput 
                            Label="Message"
                            PlaceholderText="Type your message..."
                            Variant="Filled"
                            AcceptsReturn="True"
                            MinHeight="100" />
                    </StackPanel>
                </daisy:DaisyCard>
                
                <!-- Status colors -->
                <daisy:DaisyCard Padding="20">
                    <StackPanel Spacing="12">
                        <TextBlock 
                            Text="Status Colors" 
                            FontSize="20" 
                            FontWeight="SemiBold"
                            Foreground="{ThemeResource DaisyBaseContentBrush}" />
                        
                        <StackPanel Spacing="8">
                            <daisy:DaisyButton Content="Info" Variant="Info" HorizontalAlignment="Stretch" />
                            <daisy:DaisyButton Content="Success" Variant="Success" HorizontalAlignment="Stretch" />
                            <daisy:DaisyButton Content="Warning" Variant="Warning" HorizontalAlignment="Stretch" />
                            <daisy:DaisyButton Content="Error" Variant="Error" HorizontalAlignment="Stretch" />
                        </StackPanel>
                    </StackPanel>
                </daisy:DaisyCard>
                
            </StackPanel>
        </ScrollViewer>
    </Grid>
</Window>

Next Steps

Browse Controls

Explore all 40+ available components

Theming Guide

Deep dive into theme customization

Sizing System

Learn about the unified sizing system

API Reference

Detailed API documentation

Build docs developers (and LLMs) love