Table of Contents

Interface IThemeJsInterop

Namespace
BlazOrbit.Components.Layout
Assembly
BlazOrbit.dll

JS interop contract for the theme module — reads/writes the active theme on the document root.

public interface IThemeJsInterop

Methods

GetPaletteAsync()

Returns the active palette as a CSS-variable dictionary.

ValueTask<Dictionary<string, string>> GetPaletteAsync()

Returns

ValueTask<Dictionary<string, string>>

GetThemeAsync()

Returns the currently active theme id.

ValueTask<string> GetThemeAsync()

Returns

ValueTask<string>

InitializeAsync(string?)

Initializes the theme module, optionally with a default theme id.

ValueTask InitializeAsync(string? defaultTheme = null)

Parameters

defaultTheme string

Returns

ValueTask

SetThemeAsync(string)

Sets the active theme id and persists it.

ValueTask SetThemeAsync(string theme)

Parameters

theme string

Returns

ValueTask

ToggleThemeAsync(string[])

Cycles to the next id in themes and returns the resulting theme.

ValueTask<string> ToggleThemeAsync(string[] themes)

Parameters

themes string[]

Returns

ValueTask<string>

Events

OnThemeChanged

Raised after a successful theme change with the new theme id.

event Action<string>? OnThemeChanged

Event Type

Action<string>