Light, dark or match your site
Pick whether the widget draws light, dark, as your page does, or as each visitor's system does, and keep it in step with your site's own theme switch.
Last updated Tuesday, November 24th, 2026
View as MarkdownOn this page
The widget draws light or dark. theme in the snippet's init call says which, and the default, "page", makes it match your site without any code: a light page gets a light widget, a dark page a dark one, and your site's own light and dark switch moves the widget with it.
Here Brightline's widget sits on its own pricing page with theme: "page". Switch this site between light and dark and the picture follows, as the widget does on Brightline's page.
The four themes
theme | Draws | Install guide | Use it when |
|---|---|---|---|
"page" | Light or dark as your page does, following your site's switch. The default. | Match site | Almost always: your site has a dark mode, or might one day. |
"light" | Always light. | Light | Your site is only ever light and you never want a dark widget. |
"dark" | Always dark. | Dark | Your site is only ever dark. |
"auto" | As each visitor's system is set, whatever your page draws, and follows it live. | none | You want the visitor's own setting, even on a page that's always light. |
On a site that only draws a light page, "auto" gives a visitor whose system is dark a dark widget on your light page, where "page" gives them a light one.
<script>
window.$notert=window.$notert||[];window.notert=window.notert||new Proxy({},{get:(_,p)=>typeof p=="string"&&p!="then"&&/^[a-z]/i.test(p)?(...a)=>window.$notert.push([p,...a]):void 0});
window.notert.init("YOUR_WORKSPACE_ID", { widget: true, theme: "page" });
</script>
<script type="module" async src="https://app.notert.io/embed/v1.js"></script>With the npm package, theme is typed as NotertTheme:
import { loadNotert } from "@notert/widget";
loadNotert({ workspaceId: "YOUR_WORKSPACE_ID", theme: "page" });In init, any other value, or none, is read as "page", without a warning.
Your team's Mode comes first
On the Professional plan, your team sets the widget's Mode on the Widget design page in Notert:
- Light or Dark draws that one for every visitor, whatever
themesays, so your page'sthemechanges nothing. Its otherappearancevalues still apply. - System leaves it to your page, as this page describes. It's the mode of every template but Midnight, which is Dark.
On another plan there's no mode, and theme alone decides. Which colors each one draws in is the design's; see design your widget and colors and readability.
How "page" reads your page
The widget looks at your page's <html>, then its <body>, and takes the first of these it finds:
-
A theme class or attribute: a
darkorlightclass, or one of these attributes set to"dark"or"light", as most theme switchers write them:Attribute Written by, for instance data-themenext-themes, daisyUI data-modemany theme switchers data-color-modeGitHub's Primer data-color-schememany theme switchers data-bs-themeBootstrap data-mui-color-schemeMUI -
The background
<html>or<body>paints, dark or light. Where neither paints one, as in an app that paints its background on an element inside<body>, the background drawn behind your content 8px in from the middle of the window's right edge, then at its middle. The right edge comes first, since a sidebar usually sits on the left. -
Your page's
color-scheme:darkdraws dark, andlight darkfollows the visitor's system, as your page's own canvas does.
With none of these, it draws light.
A few things follow from this:
- The class must be exactly
darkorlight. A class such astheme-darkoris-darkisn't read; an attribute's value is read in any case, sodata-theme="Dark"counts. - Only
<html>and<body>are watched. A theme class on#rootor#appisn't seen, though the background it paints usually is. - A background is a color. A background picture or gradient paints no color, so the widget looks past it. A color counts as dark below half lightness, and only where it's at least half opaque.
- It follows at once. When your switch changes a class, a style or one of these attributes on
<html>or<body>, or your framework swaps the<body>, the widget reads the page again at once, and again 400ms later, once a fade on your background has settled. - A style written every frame is read every 400ms. If your page writes an inline style on
<html>or<body>many times a second, as a scroll or pointer effect does, the widget reads the page once every 400ms while that goes on, so it costs your animation nothing. A switch made by a class or attribute is still read at once; one made by an inline style alone is followed within 400ms.
Matching your site's own theme switch
With "page", a switch that sets a class or attribute on <html> or <body> needs nothing more. That covers next-themes, Tailwind's dark class, Bootstrap's data-bs-theme and MUI's color schemes as they ship.
If your switch marks nothing there and paints its background further in, tell the widget yourself each time a visitor flips it:
// Wherever your switch changes the theme:
window.notert.appearance({ theme: nowDark ? "dark" : "light" });In React, with the npm package, call it from an effect on your own theme state:
import { notert } from "@notert/widget";
import { useEffect } from "react";
export function useWidgetTheme(dark: boolean) {
useEffect(() => {
notert.appearance({ theme: dark ? "dark" : "light" });
}, [dark]);
}The widget follows at once, open or shut. appearance takes the same four themes as init, so "page" hands the choice back to your page and "auto" to the visitor's system setting. Unlike init, any other value is left out with a warning in the browser's console, Notert: appearance.theme was ignored., and the widget keeps the theme it had.
You can also set theme inside init's appearance, which goes over the theme beside it, as each later appearance call does.
If it draws the wrong one
- It's always light, or always dark. Check Mode on the Widget design page: Light or Dark overrides your page. Then check your snippet's
theme. - It draws light on your dark page. Your switch probably marks nothing on
<html>or<body>, and the background behind your content is a picture or gradient, or not dark enough. Add adarkclass ordata-theme="dark"to<html>, or callappearancefrom your switch as shown above. - It's a step behind your switch. A page that fades its background over more than 400ms can be read mid-fade. Mark the theme on
<html>, which is read before the background, or callappearancefrom your switch. - It's dark for some visitors on your light site. That's
"auto", which follows each visitor's system. Use"page"to match your site instead.