You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "dosubot[bot] (via GitHub)" <gi...@apache.org> on 2026/05/02 02:50:17 UTC
Re: [D] Question: How to apply per-user theme to embedded dashboards without modifying global dashboard configuration? [superset]
GitHub user dosubot[bot] edited a comment on the discussion: Question: How to apply per-user theme to embedded dashboards without modifying global dashboard configuration?
<!-- Answer -->
Yes! Superset's Embedded SDK supports per-user/session theming without modifying global dashboard configuration. Since you're on **v6.1.0rc1**, you should have access to both methods.
**Two SDK methods for per-user theming:**
1. **`setThemeConfig()`** — Configure complete light/dark themes with custom branding
2. **`setThemeMode()`** — Dynamically switch between themes at runtime
Here's how to implement it:
```javascript
const dashboard = await embedDashboard({
id: "your-dashboard-id",
supersetDomain: "https://your-superset.com",
mountPoint: document.getElementById("dashboard"),
fetchGuestToken: () => fetchToken(),
});
// Configure your brand themes upfront
dashboard.setThemeConfig({
theme_default: {
token: {
colorPrimary: '#your-light-brand-color',
fontFamily: "'Your Font', sans-serif",
},
},
theme_dark: {
token: {
colorPrimary: '#your-dark-brand-color',
colorBgBase: '#121212',
colorTextBase: '#ffffff',
},
algorithm: 'dark',
},
});
// React to user theme changes
userThemeSelector.on('change', (theme) => {
dashboard.setThemeMode(theme === 'dark' ? 'dark' : 'default');
});
```
**Important caveat:** These SDK methods only affect **UI theming** (backgrounds, text colors, Ant Design components). They do **NOT** affect chart color palettes (bar chart colors, pie slices, etc.). Chart colors require updating `json_metadata.color_scheme` in the database — [there's no runtime API for per-user chart colors](https://github.com/apache/superset/discussions/34255#discussioncomment-13836584).
**Known issues to be aware of:**
- There's a [theme flash on initial load](https://github.com/apache/superset/issues/38336) where the server default renders first, then switches after receiving your theme config
- A [recent issue](https://github.com/apache/superset/issues/37989) documents that `setThemeMode()` didn't work in v6.0.0 because the server-side handler wasn't cherry-picked — this should be resolved in v6.1.0rc1, but verify it works in your environment
Make sure you're using `@superset-ui/embedded-sdk@0.3.0` or later.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).*
---
Docs are dead. Just use [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-tagline&utm_term=apache%2Fsuperset).
[](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-feedback&utm_term=apache%2Fsuperset&message_id=80f4a96c-4f59-4fa6-bd7d-c0e3d30af1d5) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-ask-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-share-team&utm_term=apache%2Fsuperset)
GitHub link: https://github.com/apache/superset/discussions/38900#discussioncomment-16336333
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org