-
Notifications
You must be signed in to change notification settings - Fork 101
Getting started
The way to getting started with our styles library is pretty easy and similar like MDIX.
-
Create AvaloniaUI application
-
Add Material.Avalonia nuget package to your project:
dotnet add package Material.AvaloniaOr use nightly builds by following this documentation
-
Add styles using one of the methods listed below (Using different style loaders section)
-
You are ready to go!
-
For example, you can modify your
MainWindow.axamlto following:<Window ... xmlns:styles="clr-namespace:Material.Styles;assembly=Material.Styles" ...> <StackPanel> <styles:Card Margin="16"> <TextBlock Classes="Headline6" Text="Hello world with Material.Avalonia!"/> </styles:Card> </StackPanel> </Window>
-
Run your application.
Your application will appear an Window to following:

Also, community member @buzzware published a complete minimal project at this repository. You can use it as a starting point.
This guide suitable only for
3.0.0-*or higher. If you use2.5.*or lover version, read here..
-
Edit
Application.Stylessection inApp.xamlfile:<Application ... xmlns:themes="clr-namespace:Material.Styles.Themes;assembly=Material.Styles" ...> <Application.Styles> <themes:MaterialTheme PrimaryColor="Purple" SecondaryColor="Lime" /> </Application.Styles> </Application>
Base theme (
DarkorLight) can be specified inApplicationelement (viaRequestedThemeModeproperty).MaterialThemewill inherit this value. Also, you can specifyBaseThemeforMaterialThemeitself. If none of this property specified, app will use OS theme.
If you need more options for setting up the theme refer to advanced theming page.RequestedThemeModeavailable only for Avalonia11.0.0-preview*or higher⚠️ If you get the errorCannot resolve symbol MaterialTheme, make sure you have installed the correct version (3.0.0-* or higher).
Deprecated in favor of
MaterialThemewhich available from3.0.0-*.
-
Edit
Application.StylesandApplication.Resourcessection inApp.xamlfile:<Application ... xmlns:themes="clr-namespace:Material.Styles.Themes;assembly=Material.Styles" ...> <Application.Resources> <themes:BundledTheme BaseTheme="Light" PrimaryColor="Teal" SecondaryColor="Amber"/> </Application.Resources> <Application.Styles> <StyleInclude Source="avares://Material.Avalonia/Material.Avalonia.Templates.xaml" /> </Application.Styles> </Application>
Material.Avalonia Wiki pages is still WIP (work in progress), Pages could not ready for show if they unclickable.
Main section
- Main page
- Getting started
- Screenshots of Demo
- FAQ (frequently asked questions)
- Breaking changes
- Nightly builds
Widgets / Controls
- Buttons
- Inputs
- TextBox
- Switchable
- CheckBox
- RadioButton
- ToggleButton
- ToggleSwitch
- Selectable
- ListBox
- ComboBox
- Pickers
- Feedbacks
- ProgressBar
- Snackbar
- Dialogs
- AlertDialog
- TextFieldDialog
- CustomDialog
- Containers / Layouts
- ColorZone
- Card
- Expander
- DataGrid
Theming
Builders
Assist for widgets
- ButtonAssist
- SelectionControlAssist
- ShadowAssist
- SliderAssist
- TextFieldAssist
- TransitionAssist