Theme API
This API is reliable and breaking changes are unlikely.
qlik.theme
The Theme API is the external interface to Qlik Sense themes. It allows customization of visualizations, including extensions, outside of Qlik Sense.
Version history
Each method and property contain information around when it was introduced, updated, deprecated or removed. A list of all relevant API changes per version release can be found in API version history.
Version state | Details |
---|---|
Introduced | Qlik Sense February 2018 |
Getting started
The Theme API is available for mashup developers as the qlik.theme namespace. You can retrieve a QTheme object with the theme.get(id) method. The QTheme object consists of a theme and helper methods. The id parameter is mandatory when theme.get is used in a global context but optional when used in an app context: app.theme.get().
Examples of use
Learn what you can do with the Theme API.
Retrieve a theme in a global context
qlik.theme.get('my-theme-id').then(function(qtheme){
alert('Theme background color: ' + qtheme.properties.backgroundColor);
});
Apply a theme to all visualizations on a web page
qlik.theme.apply('my-theme-id').then(function(result){
alert('theme applied with result: ' + result);
});
Retrieve the currently applied theme
The app.theme.getApplied() method can be used for visualization extensions so these can use styling from the current theme.
app.theme.getApplied().then(function(qtheme){
alert('Current theme background color: ' + qtheme.properties.backgroundColor);
});