SukiUI Documentation

repository·main·Indexed 25 days ago

https://github.com/kikipoulet/sukiui

A comprehensive desktop UI library and theme for AvaloniaUI. SukiUI provides customizable light and dark themes, animated controls, and a built-in toolkit featuring toast and dialog systems. It includes a wide array of controls such as BusyArea, Expander, GroupBox, various date and time pickers, AutoCompleteBox, and specialized button styles.

Tokens
12.9K
Snippets
65
Records
93
Agent score
82%

What's inside SukiUI

  1. Overview of SukiUI for Avalonia

    main

    SukiUI is a UI theme and toolkit for AvaloniaUI designed to modernize applications. It provides a comprehensive set of features including:

    • Theming: Support for Light/Dark modes and various color themes.
    • Customization: Options to change application background styles.
    • Animated Controls: A collection of richly animated UI components.
    • UI Toolkit: Includes specialized systems like a Toast (Notification) system and Dialogs (MessageBox).
  2. Overview of SukiUI

    main

    SukiUI is a desktop-focused UI library and theme for AvaloniaUI. It provides a complete UI toolkit designed to maintain a consistent design style through:

    • UI Themes: Support for Light/Dark modes and various color themes, including customizable background styles.
    • Animated Controls: A collection of fully animated UI controls.
    • UI Toolkit: Built-in systems for common interactions, such as a Toast system for notifications and a Dialog/MessageBox system.
  3. Use SettingsLayout to present settings views

    main

    The SettingsLayout control is used to present settings interfaces. It is designed to automatically update its layout based on the width of the window. It expects a collection of SettingsLayoutItem objects assigned to its Items property.

    <suki:SettingsLayout>
        <suki:SettingsLayout.Items>
            <objectModel:ObservableCollection x:TypeArguments="suki:SettingsLayoutItem">
                <suki:SettingsLayoutItem Header="Settings Part1">
                    <suki:SettingsLayoutItem.Content>
                        <Border Background="LightGray" Height="300" />
                    </suki:SettingsLayoutItem.Content>
                </suki:SettingsLayoutItem>
    
                <suki:SettingsLayoutItem Header="Settings Part 2">
                    <suki:SettingsLayoutItem.Content>
                        <Border Background="LightGray" Height="300" />
                    </suki:SettingsLayoutItem.Content>
                </suki:SettingsLayoutItem>
    
                <suki:SettingsLayoutItem Header="Settings Part 3">
                    <suki:SettingsLayoutItem.Content>
                        <Border Background="LightGray" Height="300" />
                    </suki:SettingsLayoutItem.Content>
                </suki:SettingsLayoutItem>
            </objectModel:ObservableCollection>
        </suki:SettingsLayout.Items>
    </suki:SettingsLayout>
  4. Configure background transitions and animations

    main

    SukiUI supports smooth transitions and animations for background effects:

    • Transitions: Enable BackgroundTransitionsEnabled to fade between background styles using opacity. Control the duration using BackgroundTransitionTime (in seconds, default is 1).
    • Animations: Enable BackgroundAnimationEnabled to run animations at native framerates. Most default styles support this, except for Flat.

    Performance Warning: Enabling animations requires invalidating and repainting the entire visual tree. This can lead to significant performance impacts (e.g., ~5% CPU and ~20% GPU increase). Use only when necessary.

  5. Include SukiUI styles in App.axaml

    main

    To use SukiUI, you must include the SukiTheme in your App.axaml file. You need to add the sukiUi namespace mapping to the Application tag and then add the sukiUi:SukiTheme style.

    Important: You must set a ThemeColor (e.g., ThemeColor="Blue"). If no ThemeColor is set and no other theme is applied, your windows and many controls will appear completely transparent.

    <Application
        ...
        xmlns:sukiUi="clr-namespace:SukiUI;assembly=SukiUI"
        >
        <Application.Styles>
            <sukiUi:SukiTheme ThemeColor="Blue"  />
        </Application.Styles>
    </Application>
  6. Use the AutoCompleteBox control

    main

    The AutoCompleteBox provides autocomplete functionality for a TextBox. It is useful for providing suggestions or help text to users as they type. You can populate the suggestions by setting the ItemsSource property, typically using an ObservableCollection of strings or other objects.

    <AutoCompleteBox>
        <AutoCompleteBox.ItemsSource>
            <!-- Suggested strings -->
            <objectModel:ObservableCollection x:TypeArguments="system:String">
                <system:String>USA 1</system:String>
                <system:String>USA 2</system:String>
                <system:String>USA 3</system:String>
                <system:String>France</system:String>
                <system:String>England</system:String>
                <system:String>Germany</system:String>
                <system:String>Belgium</system:String>
                <system:String>China</system:String>
            </objectModel:ObservableCollection>
        </AutoCompleteBox.ItemsSource>
    </AutoCompleteBox>