---
url: "https://vueda.dev/v3/reference/api/js/use/themeRegistry.md"
title: "use/themeRegistry"
---

# use/themeRegistry

## Overview

Stores base theme data and project overrides separately, with
registration, override, and theme-merge APIs, plus a CSS-framework-independent
class merger configured by `setClassMerger`.

Split out of `useTheme.js` so per-component `*.theme.js` modules can register
their entries through a module that test specs do not mock. Specs mock the
`useTheme` composable (`@vueda/use/useTheme.js`); they do not mock this
registry, so a themed SFC's eager `patchTheme(...)` side effect resolves to
the real function even when `useTheme` is mocked. `useTheme.js` re-exports
`setTheme` / `patchTheme` / `overrideTheme` / `clearThemeOverrides` /
`setClassMerger` / `getTheme` / `mergeTheme` so the public
`@vueda/use/useTheme.js` import path is unchanged for existing callers.

## Properties

### defaultTheme {#defaultTheme}

Reactive holder for the registered theme. `setTheme` / `patchTheme` reassign
`.value` so any `useTheme` async computeds re-resolve when new entries arrive
(e.g. a component-level loader resolved its chunk and called `patchTheme`
with real data).

Type: `ShallowRef`

Source: `client/lib/use/themeRegistry.js:28`

## Methods

- [clearThemeOverrides](/v3/reference/api/js/use/themeRegistry/functions/clearThemeOverrides.md) - Remove all project overrides without changing base entries or loaders.
- [combineThemeClasses](/v3/reference/api/js/use/themeRegistry/functions/combineThemeClasses.md) - Combine class values, then apply the active theme's conflict rules.
- [getTheme](/v3/reference/api/js/use/themeRegistry/functions/getTheme.md) - Get a cloned base theme snapshot.
- [mergeTheme](/v3/reference/api/js/use/themeRegistry/functions/mergeTheme.md) - Custom merge function for merging theme objects, ensuring classes are combined.
- [overrideTheme](/v3/reference/api/js/use/themeRegistry/functions/overrideTheme.md) - Merge project overrides above the base theme regardless of registration order.
- [patchTheme](/v3/reference/api/js/use/themeRegistry/functions/patchTheme.md) - Patch the default theme with a partial theme.
- [setClassMerger](/v3/reference/api/js/use/themeRegistry/functions/setClassMerger.md) - Register the active theme's CSS conflict rules.
- [setTheme](/v3/reference/api/js/use/themeRegistry/functions/setTheme.md) - Replace the base theme, including previous base patches.

## Source

`client/lib/use/themeRegistry.js:1`
