sp component base.themeprovider - microsoft/Viva-Connections-Extensibility-Beta GitHub Wiki
Home > @microsoft/sp-component-base > ThemeProvider
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| Property | Modifiers | Type | Description |
|---|---|---|---|
| themeChangedEvent | SPEvent<ThemeChangedEventArgs> | Raised when the theme changes with the new theme as an argument. |
| Constructor | Modifiers | Description |
|---|---|---|
| (constructor)(serviceScope, theme) | Construct a new instance of the ThemeProvider class. |
| Property | Modifiers | Type | Description |
|---|---|---|---|
| serviceKey | static |
ServiceKey<ThemeProvider> | The service key for ThemeProvider. |
| Method | Modifiers | Description |
|---|---|---|
| tryGetTheme() | If set, get the current scoped theme. |