Skip to main content
Customize the look and feel of your ShadcnKit ShadcnKit uses a combination of Tailwind CSS and CSS variables for styling, allowing for easy customization and theme switching. This guide will walk you through the styling setup and how to customize it.

Global CSS Setup

The global CSS file is located at styles/globals.css. This file contains the base styles and CSS variables for theming.

Customizing CSS Variables

You can customize the theme by modifying the CSS variables. ShadcnKit uses a set of predefined variables for colors, spacing, and other design tokens. Here’s an example of customized CSS variables:
To apply these custom styles:
  1. Open styles/globals.css
  2. Replace the existing :root and .dark sections with your custom CSS variables

Theme Provider

ShadcnKit uses Next.js’ built-in theme support through the next-themes package. The theme provider is set up in app/theme-provider.tsx:
This provider is then used in the root layout (app/layout.tsx) to enable theme switching:

Customizing Themes

To create custom themes or modify existing ones:
  1. Use the Shadcn UI Theme Generator to generate your desired color scheme.
  2. Copy the generated CSS variables.
  3. Paste them into your styles/globals.css file, replacing or modifying the existing :root and .dark sections.

Using Themes in Components

With the theme set up, you can use the theme variables in your components:

Switching Themes

ShadcnKit provides a theme toggle component out of the box.

Best Practices

  1. Use Tailwind classes for most styling needs.
  2. Utilize the predefined CSS variables for consistent theming.
  3. Use the dark: variant in Tailwind classes for dark mode specific styles.
By following this guide, you can easily customize the look and feel of your ShadcnKit project while maintaining the benefits of Tailwind CSS and easy theme switching.