# Theme Switcher
## Usage
Import Tailwind and one full Basecoat style bundle.
```css
@import "tailwindcss";
@import "basecoat-css/vega.css";
```
Or import only the base CSS, the component CSS files it composes, and one style pack.
```css
@import "tailwindcss";
@import "basecoat-css/base.css";
@import "basecoat-css/components/button.css";
@import "basecoat-css/components/tooltip.css";
@import "basecoat-css/styles/vega.css";
```
Theme Switcher composes Button and Tooltip component CSS.
Using CDN or bundler imports? See the [Installation page](/installation).
Copy or serve the full Basecoat JavaScript bundle.
```html
```
Or copy or serve the Basecoat runtime only.
```html
```
Using CDN or bundler imports? See the [Installation page](/installation).
Add this inline script before loading your styles so the stored mode is applied before the page renders.
```html
```
```html
```
### JavaScript API
| API | Type | Description |
| --- | --- | --- |
| `window.basecoat.theme.get()` | Method | Returns `"dark"` or `"light"`. |
| `window.basecoat.theme.set(mode)` | Method | Sets the mode to `"dark"` or `"light"` and stores it in `localStorage.themeMode`. |
| `window.basecoat.theme.toggle()` | Method | Toggles between dark and light mode. |