Skip to content

Vizel API / vue/src / useVizelTheme

Function: useVizelTheme()

ts
function useVizelTheme(): UseVizelThemeResult;

Defined in: packages/vue/src/composables/useVizelTheme.ts:47

Composable to access the editor theme and a setter.

Must be used within a VizelThemeProvider.

Returns

UseVizelThemeResult

Example

vue
<script setup>
const { theme, setTheme } = useVizelTheme();
</script>

<template>
  <button @click="setTheme(theme === 'dark' ? 'light' : 'dark')">
    Toggle theme
  </button>
</template>

Released under the MIT License.