docs/admin_docs/configuration/theming.mdx
:::note
apache-superset>=6.0
:::
Superset now rides on Ant Design v5's token-based theming. Every Antd token works, plus a handful of Superset-specific ones for charts and dashboard chrome.
Superset includes a built-in Theme Management interface accessible from the admin menu under Settings > Themes.
CONFIG modal and copy the JSON configurationYou can also extend with Superset-specific tokens (documented in the default theme object) before you import.
When ENABLE_UI_THEME_ADMINISTRATION = True is configured, administrators can manage system-wide themes directly from the UI:
Once created, themes can be applied to individual dashboards:
Configure theme behavior via superset_config.py:
# Enable UI-based theme administration for admins
ENABLE_UI_THEME_ADMINISTRATION = True
# Optional: Set initial default themes via configuration
# These can be overridden via the UI when ENABLE_UI_THEME_ADMINISTRATION = True
THEME_DEFAULT = {
"token": {
"colorPrimary": "#2893B3",
"colorSuccess": "#5ac189",
# ... your theme JSON configuration
}
}
# Optional: Dark theme configuration
THEME_DARK = {
"algorithm": "dark",
"token": {
"colorPrimary": "#2893B3",
# ... your dark theme overrides
}
}
# To force a single theme on all users, set THEME_DARK = None
# When both themes are defined (via UI or config):
# - Users can manually switch between themes
# - OS preference detection is automatically enabled
When ENABLE_UI_THEME_ADMINISTRATION = True:
To export a theme for use in configuration files or another instance:
superset_config.py or import it into another Superset instanceSuperset supports custom fonts through the theme configuration, allowing you to use branded or custom typefaces without rebuilding the application.
By default, Superset uses Inter and Fira Code fonts which are bundled with the application via @fontsource packages. These fonts work offline and require no external network calls.
To use custom fonts, add font URLs to your theme configuration using the fontUrls token:
THEME_DEFAULT = {
"token": {
# Load fonts from external sources (e.g., Google Fonts, Adobe Fonts)
"fontUrls": [
"https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700&display=swap",
"https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap",
],
# Reference the loaded fonts
"fontFamily": "Roboto, -apple-system, BlinkMacSystemFont, sans-serif",
"fontFamilyCode": "JetBrains Mono, Monaco, monospace",
# ... other theme tokens
}
}
# Update CSP to allow font sources
TALISMAN_CONFIG = {
"content_security_policy": {
"font-src": ["'self'", "https://fonts.googleapis.com", "https://fonts.gstatic.com"],
"style-src": ["'self'", "'unsafe-inline'", "https://fonts.googleapis.com"],
}
}
Or in the CRUD interface theme JSON:
{
"token": {
"fontUrls": [
"https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700&display=swap"
],
"fontFamily": "Roboto, -apple-system, BlinkMacSystemFont, sans-serif",
"fontFamilyCode": "JetBrains Mono, Monaco, monospace"
}
}
:::note
Font URLs are validated against a configurable allowlist. By default, fonts from fonts.googleapis.com, fonts.gstatic.com, and use.typekit.net are allowed. Configure THEME_FONT_URL_ALLOWED_DOMAINS to customize the allowed domains.
:::
/static/assets/fonts/ and reference via CSSThis feature works with the stock Docker image - no custom build required!
:::note Available since Superset 6.0 :::
Superset provides fine-grained control over ECharts visualizations through theme-level configuration overrides. This allows you to customize the appearance and behavior of all ECharts-based charts without modifying individual chart configurations.
Apply settings to all ECharts visualizations using echartsOptionsOverrides:
THEME_DEFAULT = {
"token": {
"colorPrimary": "#2893B3",
# ... other Ant Design tokens
},
"echartsOptionsOverrides": {
"grid": {
"left": "10%",
"right": "10%",
"top": "15%",
"bottom": "15%"
},
"tooltip": {
"backgroundColor": "rgba(0, 0, 0, 0.8)",
"borderColor": "#ccc",
"textStyle": {
"color": "#fff"
}
},
"legend": {
"textStyle": {
"fontSize": 14,
"fontWeight": "bold"
}
}
}
}
Target specific chart types using echartsOptionsOverridesByChartType:
THEME_DEFAULT = {
"token": {
"colorPrimary": "#2893B3",
# ... other tokens
},
"echartsOptionsOverridesByChartType": {
"echarts_pie": {
"legend": {
"orient": "vertical",
"right": 10,
"top": "center"
}
},
"echarts_timeseries": {
"xAxis": {
"axisLabel": {
"rotate": 45,
"fontSize": 12
}
},
"dataZoom": [{
"type": "slider",
"show": True,
"start": 0,
"end": 100
}]
},
"echarts_bubble": {
"grid": {
"left": "15%",
"bottom": "20%"
}
}
}
}
You can also configure ECharts overrides through the theme CRUD interface:
{
"token": {
"colorPrimary": "#2893B3"
},
"echartsOptionsOverrides": {
"grid": {
"left": "10%",
"right": "10%"
},
"tooltip": {
"backgroundColor": "rgba(0, 0, 0, 0.8)"
}
},
"echartsOptionsOverridesByChartType": {
"echarts_pie": {
"legend": {
"orient": "vertical",
"right": 10
}
}
}
}
The system applies overrides in the following order (last wins):
echartsOptionsOverridesechartsOptionsOverridesByChartType[chartType]This ensures chart-specific overrides take precedence over global ones.
Available chart types for echartsOptionsOverridesByChartType:
echarts_timeseries - Time series/line chartsecharts_pie - Pie and donut chartsecharts_bubble - Bubble/scatter chartsecharts_funnel - Funnel chartsecharts_gauge - Gauge chartsecharts_radar - Radar chartsecharts_boxplot - Box plot chartsecharts_treemap - Treemap chartsecharts_sunburst - Sunburst chartsecharts_graph - Network/graph chartsecharts_sankey - Sankey diagramsecharts_heatmap - Heatmapsecharts_mixed_timeseries - Mixed time series# Complete corporate theme with ECharts customization
THEME_DEFAULT = {
"token": {
"colorPrimary": "#1B4D3E",
"fontFamily": "Corporate Sans, Arial, sans-serif"
},
"echartsOptionsOverrides": {
"grid": {
"left": "8%",
"right": "8%",
"top": "12%",
"bottom": "12%"
},
"textStyle": {
"fontFamily": "Corporate Sans, Arial, sans-serif"
},
"title": {
"textStyle": {
"color": "#1B4D3E",
"fontSize": 18,
"fontWeight": "bold"
}
}
},
"echartsOptionsOverridesByChartType": {
"echarts_timeseries": {
"xAxis": {
"axisLabel": {
"color": "#666",
"fontSize": 11
}
}
},
"echarts_pie": {
"legend": {
"textStyle": {
"fontSize": 12
},
"itemGap": 20
}
}
}
}
This feature provides powerful theming capabilities while maintaining the flexibility of ECharts' extensive configuration options.
For programmatic theme management, Superset provides REST endpoints:
GET /api/v1/theme/ - List all themesPOST /api/v1/theme/ - Create a new themePUT /api/v1/theme/{id} - Update a themeDELETE /api/v1/theme/{id} - Delete a themePUT /api/v1/theme/{id}/set_system_default - Set as system default theme (admin only)PUT /api/v1/theme/{id}/set_system_dark - Set as system dark theme (admin only)DELETE /api/v1/theme/unset_system_default - Remove system default designationDELETE /api/v1/theme/unset_system_dark - Remove system dark designationGET /api/v1/theme/export/ - Export themes as YAMLPOST /api/v1/theme/import/ - Import themes from YAMLThese endpoints require appropriate permissions and are subject to RBAC controls.
:::resources