From 72717c5aa2965f62f2574cc72950f9befb9955f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C4=9F=C4=B1zhan=20Necat=20Yakal=C4=B1?= Date: Thu, 28 Sep 2023 18:31:59 +0300 Subject: [PATCH] update README --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/README.md b/README.md index 283c2ab..439fd6e 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,43 @@ Add required `CSS` and `Javascript` packages into the `index.html` file. ``` +### Theme Switching + +Add `Theme` component to the page that you want to manipulate the theme. + +```html + +``` + +Then use this methods to change theme. + +```csharp +Theme themeProvider; +protected override async Task OnAfterRenderAsync(bool firstRender) +{ + if(firstRender) + { + await themeProvider.SetTheme("theme-classic-light"); + } + +} + +private async Task CheckboxChanged() +{ + await themeProvider.ToggleTheme(); +} + +private async Task SetDarkTheme() +{ + await themeProvider.SetTheme("theme-classic-dark"); +} + +private async Task ToggleSystemTheme() +{ + await themeProvider.ToggleSystemTheme(true); +} +``` + ### Supported Components - [Basic Navigation](#basic-navigation)