---
title: "Theme switch"
description: "Switch between light, dark and system themes."
url: https://docscn.dev/docs/components/theme-switch
lastModified: 2026-10-08T15:14:17.000Z
---

# Theme switch (/docs/components/theme-switch)

> Switch between light, dark and system themes.

## Installation [#installation]

```npm
npx shadcn@latest add @docscn/theme-switch
```

## Usage [#usage]

The docs, notebook and home layouts show a theme switch. Configure it with the layout's `themeSwitch` option, or use it on its own inside `RootProvider`:

```tsx
import { ThemeSwitch } from "@/components/docs/layouts/shared/slots/theme-switch";

<ThemeSwitch />
<ThemeSwitch mode="light-dark-system" />
```

`mode="light-dark"` (the default) is a button that toggles between light and dark. `mode="light-dark-system"` is a shadcn/ui `toggle-group` with a system option.