Skip to content

Vue 3

@theme-kit/vue

Vue 3Composables7 exports

Vue 3 provider, composables and scopes over the shared runtime.

Install the integration alongside @theme-kit/core.

bash
pnpm add @theme-kit/vue

Quick Start

Complete copy-paste usage for this package.

main.ts
ts
1import { createApp } from "vue";
2import { ThemeProvider } from "@theme-kit/vue";
3
4const app = createApp(App);
5app.use(ThemeProvider, {
6  themes,
7  defaultTheme: "light",
8  transition: { enabled: true },
9});
10app.mount("#app");

More Examples

Additional patterns for Vue 3.

App.vue
vue
1<script setup lang="ts">
2import { useTheme } from "@theme-kit/vue";
3
4const { theme, mode, setMode, toggleTheme } = useTheme();
5</script>
6
7<template>
8  <button @click="toggleTheme">
9    {{ theme.name }} · {{ mode }}
10  </button>
11</template>

API Reference

Curated highlights below. The complete generated reference — every signature, parameter and type — is at /api-reference/vue.

Provider

ExportDescription
ThemeProviderComponent with all runtime options; auto-registered via app.use (`.install`).
provideThemeRuntime / useThemeRuntimeProvide / inject API.

Composables

ExportDescription
useTheme`{ theme, mode, family, setMode, setFamily, toggleTheme }` as refs.
useThemeHistory / useThemeBatchHistory and atomic batching.
useThemeSnapshot / useThemeRestoreSerialize / restore state.
useThemeLifecycle / useThemePacksEvents and runtime theme packs.

Components

ExportDescription
ThemeScopeScoped theming component.
@theme-kit/vue — Theme Kit