@tokiforge/vue
Vue adapter for TokiForge theming
2,251
29
| Install | |
|---|---|
npm install @tokiforge/vue |
|
| Latest Version: | 2.4.0 |
| Vue: | 3 |
| License: | AGPL-3.0 |
| Last Updated: | Sep 26, 2026 |
| Links: | GitHub · npm |
Maintainer: sachin97317
@tokiforge/vue
Vue 3 adapter for TokiForge design token and theming engine. Provides Vue composables and provide/inject for easy theme management in Vue applications.
Vue adapter for TokiForge theming (v2.4.0).
Installation
npm install @tokiforge/vue@^2.4.0 @tokiforge/core@^2.4.0
Usage
<template>
<div :style="{ backgroundColor: 'var(--hf-color-background-default)' }">
<button @click="toggleTheme">Switch Theme</button>
</div>
</template>
<script setup lang="ts">
import { provideTheme, useTheme } from "@tokiforge/vue";
const themeConfig = {
themes: [
{ name: "light", tokens: lightTokens },
{ name: "dark", tokens: darkTokens },
],
defaultTheme: "light",
};
provideTheme(themeConfig);
const { theme, tokens, setTheme } = useTheme();
const toggleTheme = () => {
setTheme(theme.value === "light" ? "dark" : "light");
};
</script>
API
provideTheme(config, selector?, prefix?, defaultTheme?)
Provides theme context to Vue components.
useTheme()
Composable to access theme context.
Returns:
theme: Reactive ref with current theme nametokens: Computed ref with current theme tokenssetTheme(name): Switch to a themenextTheme(): Cycle to next themeavailableThemes: Computed ref with available theme namesruntime: ThemeRuntime instance
Related Packages
@bythid/jin
Jin (锦) — a token-driven Vue 3 control library. Style axes: data-jin-style + da...
917
0
@eos-ui/tokens
eos design tokens: CSS custom properties, typed values and a theme generator wit...
364
0
@bysages/nuxt
Nuxt module for By Sages Elements — auto-imports the paper-and-ink Vue component...
191
1
@bysages/charts
Token-themed charts for By Sages Elements — TanStack Charts dressed in the paper...
2,402
1
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 2.4.0 | >=3.0.0 | AGPL-3.0 | |
| 2.3.0 | >=3.0.0 | AGPL-3.0 | |
| 2.2.4 | >=3.0.0 | AGPL-3.0 | |
| 2.2.3 | >=3.0.0 | AGPL-3.0 | |
| 2.0.1 | >=3.0.0 | AGPL-3.0 | |
| 2.0.0 | >=3.0.0 | AGPL-3.0 | |
| 1.2.0 | >=3.0.0 | AGPL-3.0 | |
| 1.1.2 | >=3.0.0 | MIT | |
| 1.1.1 | >=3.0.0 | MIT | |
| 1.1.0 | >=3.0.0 | MIT | |
| 1.0.0 | >=3.0.0 | MIT | |
| 0.2.1 | >=3.0.0 | MIT | |
| 0.2.0 | >=3.0.0 | MIT | |
| 0.1.0 | >=3.0.0 | MIT |