Vite

Starter kit

Use the Vite starter kit for a project with Intent UI configured.

Provider and switcher

Install @heroicons/react for the switcher icons.

npm install @heroicons/react

Create theme-provider.tsx and theme-switcher.tsx:

Loading source code...

Usage

Wrap App with ThemeProvider in your Vite entry file:

import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.tsx'
import './index.css'
import { ThemeProvider } from './components/theme-provider.tsx'

ReactDOM.createRoot(document.getElementById('root')!).render(
  <React.StrictMode>
    <ThemeProvider>
      <App />
    </ThemeProvider>
  </React.StrictMode>,
)
Design