Getting started

Installation

Install with your favorite package manager.

Setup#

Zen offers two setup options depending on whether your project uses Tailwind CSS.

If your project uses Tailwind CSS v4, use the preset for the best experience with smaller bundle sizes.

1. Configure Tailwind#

Add the preset to your tailwind.config.ts and include the package in your content paths:

2. Import styles#

Import the minimal stylesheet which includes theme CSS variables and component animations:

Option B: Without Tailwind CSS#

If your project doesn't use Tailwind, import the full stylesheet which includes all necessary utility classes:

This is a self-contained CSS file with no additional configuration needed.

Add ZenProvider#

Wrap your application with ZenProvider to enable theming and toast notifications.

ZenProvider accepts the following props:

PropTypeDefaultDescription
colorScheme'light' | 'dark' | 'system''system'Initial color scheme
toastToasterProps{ duration: 3000 }Toast notification settings

Use components#