sp component base.themeprovider - microsoft/Viva-Connections-Extensibility-Beta GitHub Wiki

Home > @microsoft/sp-component-base > ThemeProvider

ThemeProvider class

The ThemeProvider class provides the capability to get different themes from the Framework. Themes can be provided in different contexts, e.g. Canvas sections may provide a variant of the global theme in some contexts.

Signature:

export declare class ThemeProvider

Events

Property Modifiers Type Description
themeChangedEvent SPEvent<ThemeChangedEventArgs> Raised when the theme changes with the new theme as an argument.

Constructors

Constructor Modifiers Description
(constructor)(serviceScope, theme) Construct a new instance of the ThemeProvider class.

Properties

Property Modifiers Type Description
serviceKey static ServiceKey<ThemeProvider> The service key for ThemeProvider.

Methods

Method Modifiers Description
tryGetTheme() If set, get the current scoped theme.
⚠️ **GitHub.com Fallback** ⚠️