Skip to content
tcpsystemsui

Theme

Colour scheme
Accent
Density
Radius
Esc

ThemeSwitch

Light and dark toggle, persisted.

beta

Try it

Svelte
<ThemeSwitch />

Examples

Toggle theme

Toggle theme.svelte
<script lang="ts">
	import ThemeSwitch from '@tcpsystems/ui/foundation/ThemeSwitch';
</script>

<ThemeSwitch />

In a settings row

Studio appearance
In a settings row.svelte
<script lang="ts">
	import ThemeSwitch from '@tcpsystems/ui/foundation/ThemeSwitch';
	import Cluster from '@tcpsystems/ui/foundation/Cluster';
</script>

<Cluster>
	<span>Studio appearance</span>
	<ThemeSwitch />
</Cluster>

API

Import
import ThemeSwitch from '@tcpsystems/ui/foundation/ThemeSwitch';
HookKind
.tcp-theme-switchRoot class
data-variantData attribute