Skip to content

AndrDm/SukiUI

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SukiUI

Suki is the name of my dog :-)


UI Theme and Controls for AvaloniaUI

Planning - Ideas :

  • Cleaner code (because the library is very young)
  • More Controls (and make actual richer)
  • Dark Theme
  • out of the box Mobile Theme !

Installation

  • Install SukiUI Nuget Package
  • Reference SukiUI in your App.axaml file
<Application ...>
     <Application.Styles>
        ...
        <StyleInclude Source="avares://SukiUI/Theme/Index.xaml"/>
        ...
    </Application.Styles>
</Application>

Mobile (Testing Preview)

Screen video of an empty android app in debug mode with avalonia mobile, trying to use Suki UI on mobile. Controls need lots of small modifications (mostly sizing) but can look great on mobile.

---> The goal is to make asap a style file that adapt every control to mobile to be used out of the box

screen-20220411-112413.mp4

Usage

Desktop Page

<Window 
  ...
  Classes="NakedWindow" 
  xmlns:suki="clr-namespace:SukiUI.Controls;assembly=SukiUI"
>

  <suki:DesktopPage LogoColor="#2f54eb" LogoKind="Xaml">
    <suki:DesktopPage.MenuItems>
      <MenuItem Header="File">
        <MenuItem Header="File" />
        <MenuItem Header="Edit" />
        <MenuItem Header="Help" />
      </MenuItem>
      <MenuItem Header="Edit" />
      <MenuItem Header="Help" />
    </suki:DesktopPage.MenuItems>
    
    <Grid>
          <TextBlock>Content<TextBlock/>
    <Grid/>
    <suki:DesktopPage/>
<Window/>

Mobile Page

Menu for a mobile app to switch between pages and go back

<UserControl 
  ...
  xmlns:suki="clr-namespace:SukiUI.Controls;assembly=SukiUI"
>

  <suki:MobilePage  Header="Test" Name="MobileMenu" >
    <Grid >
      <Button Click="AddPage" VerticalAlignment="Center" HorizontalAlignment="Center">
        <TextBlock>Go To A Next Page</TextBlock>
      </Button>
    </Grid>
  </suki:MobilePage>
<UserControl/>


public void NavigateToNewPage(){
     
     var menu = this.FindControl<MobilePage>("MobileMenu");
     menu.NewPage("Header", new RecursivePage());
     
}

ToggleSwitch

 <ToggleSwitch OffContent="No" OnContent="Yes" />

Stepper

xmlns:suki="clr-namespace:SukiUI.Controls;assembly=SukiUI"
...

<suki:Stepper Name="myStep" />
this.FindControl<Stepper>("myStep").Steps = new List<string>() { "one", "two", "thre", "four", "five" };
this.FindControl<Stepper>("myStep").Index = 2;

CircleProgressBar

xmlns:suki="clr-namespace:SukiUI.Controls;assembly=SukiUI"
...

<suki:CircleProgressBar Height="150" StrokeWidth="12" Value="50" Width="150">
             <TextBlock Classes="h3">50 %</TextBlock>
</suki:CircleProgressBar>

Loading

xmlns:suki="clr-namespace:SukiUI.Controls;assembly=SukiUI"
...

<suki:Loading></suki:Loading>

PropertyGrid

xmlns:suki="clr-namespace:SukiUI.Controls;assembly=SukiUI"
...

<suki:PropertyGrid Name="propertyGrid" />

...

this.FindControl<PropertyGrid>("propertyGrid").Item = new Person()
{
    Name = "Billy",
    Partner = new Person()
    {
         Name = "Charles"
    }
};

Buttons

<Button Classes="Primary">
    <TextBlock>Primary</TextBlock>
</Button>
<Button Classes="Secondary">
    <TextBlock>Secondary</TextBlock>
</Button>
<Button>
    <TextBlock>Neutral</TextBlock>
</Button>
<Button Classes="Success">
    <TextBlock>Success</TextBlock>
</Button>
<Button Classes="Danger">
    <TextBlock>Danger</TextBlock>
</Button>

Notification

 WindowNotificationManager notificationManager;

public MainWindow()
{
    InitializeComponent();
    notificationManager = new WindowNotificationManager(this); 
}

private void ShowNotification(object sender, RoutedEventArgs e)
{
    var notif = new Avalonia.Controls.Notifications.Notification("title","message");
    notificationManager.Show(notif);
}

GroupBox

xmlns:suki="clr-namespace:SukiUI.Controls;assembly=SukiUI"
...

<suki:GroupBox Header="Test Header">
   <Grid Height="100" Width="150">
         <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">Test Content</TextBlock>
   </Grid>
</suki:GroupBox>

Tabs

 <TabControl>
      <TabItem Header="Tab 1" />
      <TabItem Header="Tab 2" />
      <TabItem Header="Tab 3" />
 </TabControl>
 
 <TabControl Classes="FlatTabControl">
      <TabItem Classes="FlatTabItem" Header="Tab 1" />
      <TabItem Classes="FlatTabItem" Header="Tab 2" />
      <TabItem Classes="FlatTabItem" Header="Tab 3" />
 </TabControl>

ListBox

 <ListBox>
      <TextBlock>item 1</TextBlock>
      <TextBlock>item 2</TextBlock>
      <TextBlock>item 3</TextBlock>
 </ListBox>

MessageBox

 SukiUI.MessageBox.MessageBox.Info(this, "Title", "This is an information message that need to be read.");
 MessageBox.Success(this, "Title", "This is an Success message that need to be read.");
 MessageBox.Error(this, "Title", "This is an Success message that need to be read.");

ComboBox

 <ComboBox PlaceholderText="Select an item">
    <ComboBoxItem>
       <TextBlock>Main Item 1</TextBlock>
    </ComboBoxItem>
    <ComboBoxItem>
        <TextBlock>Main Item 2</TextBlock>
    </ComboBoxItem>
</ComboBox>

ProgressBar

<ProgressBar  Value="60" />

Card and Hoverable

<Border Classes="Card"></Border>
<Border Classes="Card Hoverable"></Border>

DataGrid

<DataGrid Name="myDataGrid" AutoGenerateColumns="True" IsReadOnly="True" />
this.FindControl<DataGrid>("myDataGrid").Items = new List<Person>();

Slider

<Slider IsSnapToTickEnabled="True" Maximum="100" Minimum="0" TickFrequency="1" Value="50"></Slider>

TextBox

<TextBox Classes="Prefix" Margin="5" Text="avaloniaui.net" Watermark="https://" />
<TextBox Classes="Suffix" Margin="5" Text="avaloniaui" Watermark="@gmail.com" />
<TextBox Margin="5" Text="Elem" />
<TextBox Classes="FlatTextBox" Text="Elem" />

TextBlock

<StackPanel>
     <TextBlock Classes="h1">h1</TextBlock>
     <TextBlock Classes="h2">h2</TextBlock>
     <TextBlock Classes="h3">h3</TextBlock>
     <TextBlock Classes="h4">h4</TextBlock>
     <TextBlock>Normal</TextBlock>
     <TextBlock Classes="Accent">Accent</TextBlock>
</StackPanel>

Calendar

<Calendar></Calendar>

Expander

<Expander Header="Click To Expand">
          <TextBlock>Expanded</TextBlock>
</Expander>

NumericUpDown

<NumericUpDown></NumericUpDown>

RadioButton

<StackPanel Orientation="Vertical">
          <RadioButton Margin="5">Item 1</RadioButton>
          <RadioButton Margin="5">Item 2</RadioButton>
          <RadioButton Margin="5">Item 3</RadioButton>
</StackPanel>

TreeView

<TreeView>
      <TreeViewItem Header="blub">
          <TreeViewItem Header="blub" />
          <TreeViewItem Header="blub" />
      </TreeViewItem>
      <TreeViewItem Header="blub" />
      <TreeViewItem Header="blub" />
</TreeView>

ContextMenu

<Border.ContextMenu>
     <ContextMenu>
           <MenuItem Header="Menu item 1" />
           <MenuItem Header="Menu item 2" />
           <Separator />
           <MenuItem Header="Menu item 3" />
     </ContextMenu>
</Border.ContextMenu>

About

UI Theme for AvaloniaUI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%