Skip to content
↑↓ to navigate↵ to openesc to close

Menu

Theme Toggle

Preview

Rectangle
Circle
Circle blur
Blinds

Install

Add it with your package manager, or copy the source manually.

Run it in a project set up with shadcn-vue. The source is copied to components/beui and its dependencies are added to your package.json. Read the shadcn-vue guide

bunx --bun shadcn-vue@latest add @beui-vue/theme-toggle

Import the shared styles once in your application.

TSUsage
import ThemeToggle from '@/components/beui/actions/ThemeToggle.vue'
import '@/components/beui/styles.css'

API Reference

variant?
ThemeVariant

Animation variant. Default: "rectangle".

Defaultrectangle
start?
RectStart

Origin direction for the reveal. Default: "bottom-up".

Defaultbottom-up
iconClassName?
string
Default—
labels?
Partial<ThemeToggleMessages>

Override any built-in string.

Default—
className?
string
Default—
v-model:theme?
"light" | "dark"

Controlled mode: `v-model:theme` ("light" | "dark").

Default—
@theme-change?
(value: 'light' | 'dark') => void
Default—
#icon?
{ dark: boolean }

Replaces the sun/moon swap; receives the current mode.

Default—

Updated