Skip to content
This repository has been archived by the owner on Oct 23, 2021. It is now read-only.

sp component base.themeprovider

John Nguyen edited this page Apr 22, 2021 · 2 revisions

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.
Clone this wiki locally