The widget exposes a single visual control: a theme config field that switches between bundled light and dark themes.
Set a theme
theme accepts the WidgetTheme type: "light" | "dark".
If you omit theme, the widget reads the user’s OS preference via prefers-color-scheme and updates live when the preference changes.
Switch themes at runtime
The theme is a controlled prop. Pass a new value any time to switch.
CSS scoping
The widget is built with Tailwind v4 and scopes all CSS variables under the .velora-widget class. That means:
- The widget’s styles don’t leak into the rest of your app.
- Your app’s global styles don’t bleed into the widget either. Selectors targeting bare elements (
a, button, input) inside the widget’s DOM tree will still apply, but the widget’s own variables take precedence within its root.
Stylesheet auto-injection
The compiled stylesheet is auto-injected when you import { Widget }. No .css import required.
If your bundler strips side-effect imports aggressively (rare but possible with aggressive treeshake), force-include the stylesheet:
Related pages
Last modified on June 14, 2026