Theme & Site Settings

Every PowerPortalsPro portal ships with a built-in side panel that lets your visitors switch themes, accent colors, text direction, and language without any custom UI work on your part. The panel is launched from the <SiteSettingsButton> — a small gear icon you place in the page header — and the rest of the framework reacts live to whatever the visitor picks.

Try it in this demo

Look in the top-right of every page in this demo for the gear icon — the same <SiteSettingsButton> wired up in this site's MainLayout.razor. Click it and a side panel opens with:

Note

Your selection persists in localStorage under the key supplied via <ThemeProvider StorageName="…">, so a refresh keeps your choice. Hit Reset settings at the bottom of the panel to clear the preference and fall back to the theme defaults.

Wiring it up in your own portal

Drop a <SiteSettingsButton> into your layout's header alongside the rest of your top-bar controls, and make sure the app is wrapped in a theme provider so the panel has a theme to drive. The Blazor and React tabs below mirror how each template wires it up:

React
Blazor

Note

The theme provider namespaces the per-user preferences in localStorage — via StorageName on Blazor's <ThemeProvider>, or storageKey on React's <PowerPortalsProThemeProvider>. Use a name unique to your portal so multiple portals on the same domain don't clash.

Which sections to show

Each section of the panel is gated by a boolean parameter on <SiteSettingsButton>. Set the ones you want hidden to false; the panel reflows around them.

If you turn all four sections off, the button hides itself — there's nothing useful for the panel to display.

API Reference

React Blazor

SiteSettingsButton Class

Parameters

Name
Type
Default
Description
AllowColorChangebool
True
Gets or sets whether the accent colour selection section is visible in the settings panel.
AllowLanguageChangebool
True
Gets or sets whether the language selection section is visible in the settings panel.
AllowRightToLeftChangebool
False
Gets or sets whether the text direction (LTR/RTL) selection section is visible in the settings panel.
AllowThemeChangebool
True
Gets or sets whether the theme (light/dark/system) selection section is visible in the settings panel.
Name: AllowColorChange
Type: bool
Default: True
Description: Gets or sets whether the accent colour selection section is visible in the settings panel.
Name: AllowLanguageChange
Type: bool
Default: True
Description: Gets or sets whether the language selection section is visible in the settings panel.
Name: AllowRightToLeftChange
Type: bool
Default: False
Description: Gets or sets whether the text direction (LTR/RTL) selection section is visible in the settings panel.
Name: AllowThemeChange
Type: bool
Default: True
Description: Gets or sets whether the theme (light/dark/system) selection section is visible in the settings panel.