Prologue
Getting Started
Dark Mode
Colors
Drag-and-drop
Forms
Utilities
Vite
Got a Vite project? Let's flip the switch to dark mode and get that cool, sleek look in a snap. Here’s how to do it.
If you are using Tailwind v4, please refer to the 2.x documentation. This documentation assumes you are using Tailwind v3.
Theme Provider
First, you need to create a provider called theme-provider.tsx
in your components folder.
Usage
Then you can wrap your app with the provider. For example if you are using Laravel with Inertia.js, you can put it inside your app.tsx
like so:
Theme Switcher
Then for the switcher, you can use the useTheme
hook to get the current theme.
Sometimes, using the CLI is the way to go, so make sure you install the necessary dependencies for the components you want to use.
If you spot typos or wrong implementations, feel free to contribute here.