Color Theme Selector
Choose a color palette without changing the appearance.
Preview
Examples
Theme transition
A slide transition declared on this control. Duration is 500 milliseconds. Other controls keep their own settings.
Shadow borders
Use a prominent ambient shadow and inset edge in place of a solid border.
When to use
-
Let people choose an app palette without changing light or dark appearance.
-
Show readable labels for the palette keys configured on the provider.
-
Use the floating menu in headers, toolbars, and compact layouts.
When not to use
- People are choosing light, dark, or system. Use Theme Selector.
- You need a free-form color picker. This control selects registered palette keys.
Installation
Set up uitheme-web in an existing Tailwind app. Then install the component.
To install with shadcn, first add the UI-Theme registry
to components.json. The style in components.json selects Radix or Base UI.
Usage
Use the component inside your theme provider. Use import paths that match your app’s component directory.
For inline choices, install Color Theme Disclosure. The floating selector does not install disclosure code.
API reference
These props belong to the installed local control. Configure theme options on the provider.
| Prop | Type | Behavior |
|---|---|---|
label | string | Override the readable accessible label. |
borderStyle | 'solid' | 'shadow' | Use the default solid border or prominent shadow borders. Both use the same space and theme tokens. |
className | string | Extend the root styles. Your classes replace default classes through the local merge helper. |
classes | object | Style root, trigger, content, item, and label parts. |
disabled | boolean | Disable interaction. Preference controls also wait for the provider to mount. |
animationType | ThemeAnimationType | Override the UI theme transition for this control. Defaults to the provider setting. |
duration | number | UI theme transition duration in milliseconds. Defaults to the provider setting. |
slideDirection | SlideDirection | Valid only with animationType set to ThemeAnimationType.SLIDE. Other animation types do not accept this prop. |
options | { value, label }[] | Change palette labels. Values must already exist in the provider’s colorThemes. |
Keyboard
| Key | Action |
|---|---|
Enter / Space | Open the selector or confirm the focused palette. |
Arrow keys | Move between palette options. |
Escape | Close the menu and return focus to the trigger. |
Accessibility
- Use readable option labels instead of relying on color swatches alone.
- Use option values from
colorThemes. Custom labels do not register new palettes.
Theme behavior
- The control calls
switchColorTheme. The appearance preference does not change. - Register each palette key on the provider. Define its light and dark CSS variables. Selecting a key does not create its colors.
AI Agent notes
Use this checklist when a coding agent adds the control.
- Use
uitheme-web/reactfor the runtime. Import the control from its installed local file. The runtime does not export styled controls. - For Next.js, use
NextUIThemeProviderfromuitheme-web/next. For TanStack Start, follow the server bootstrap guide. Create server state for each request.
- Before installation, select the framework, primitive base, Tailwind major version, and language. Run the CLI inside the app or pass
--cwd. - Preview changes with
--dry-run. Keep edited local files. Review the differences before using--overwrite. - Keep appearance and
colorThemeseparate. Use the palette action to change colors. - Check that the selected palette changes the computed semantic colors in light and dark appearance. A changed label alone does not confirm this.
- Check keyboard controls in the running app. Check that appearance and palette choices survive a reload. Check reduced motion.
Source
The CLI reuses your shared cn utility. If it is missing, installation creates it
at the configured utils path. Existing utilities are checked before a replacement
is offered.
These are the files the CLI installs. The component source stays in your app.
Dependencies: @base-ui/react, lucide-react
Customization
Use borderStyle="shadow" in React or border-style="shadow" in Vue for prominent shadow borders. The default is solid.
Use slideDirection only when animationType is ThemeAnimationType.SLIDE. Set both props on the control when you need a slide direction override.
Pass animationType, duration, and slideDirection to set this control's palette transition.
These props override the provider settings for this action only.
Keyboard focus shows the theme’s focus ring.
Edit the installed source. Use className in React or class in Vue to style
the root. Use the classes prop to style individual parts. Use label props to change the
visible text.

