Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
yagizhanNY committed Sep 28, 2023
1 parent 5b29dfd commit 72717c5
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,43 @@ Add required `CSS` and `Javascript` packages into the `index.html` file.
</html>
```

### Theme Switching

Add `Theme` component to the page that you want to manipulate the theme.

```html
<Theme @ref="themeProvider"></Theme>
```

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)
Expand Down

0 comments on commit 72717c5

Please sign in to comment.