Use the automated CLI to set up Dreamy UI in your project:
pnpm dlx @dreamy-ui/cli initUse --yes to accept all defaults without prompts:
pnpm dlx @dreamy-ui/cli init --yesThe CLI will automatically:
- Detect your framework (React Router v7, Next.js, TanStack Start, or Vite)
- Install required dependencies:
- Dev:
@pandacss/dev,@pandacss/postcss,@dreamy-ui/cli - Prod:
@dreamy-ui/react,@dreamy-ui/panda-preset,motion
- Dev:
- Create and configure
panda.config.tswith the Dreamy preset, patterns, and recipes - Add a
preparescript (panda codegen) topackage.json - Configure PostCSS (
postcss.config.mjs) — Next.js only - Update
vite.configwith the Panda CSS PostCSS plugin — Vite, React Router, and TanStack Start (removes Tailwind if present) - Remove the default Tailwind CSS setup when detected
- Set up your CSS file with Panda layers and import it in your app entry
- Update
tsconfig.json— addstyled-system/**/*toincludeand an@/uipath alias (Next.js also getsstyled-system/*) - Create a
components/dreamy-provider.tsxwrapper component - Wire up
DreamyProviderin your app root (with SSR color mode for React Router, Next.js, and TanStack Start) - Add recommended starter components (
button,flex,text,heading) - Run Panda CSS codegen to generate
styled-system
Options:
--yes, -y— Skip all prompts and use defaults--skip-install— Skip dependency installation--skip-components— Skip adding recommended components
If you prefer manual installation or need more control, follow the framework-specific guides:
Install Panda CSS dev dependencies and Dreamy UI packages:
pnpm add -D @pandacss/dev @pandacss/postcss @dreamy-ui/cliConfigure your Panda config with the Dreamy preset. The patterns and recipes imports are created automatically when you add components with the CLI — for a fresh manual setup, add at least one component first (npx dreamy add button) or create the components/patterns and components/recipes index files yourself.
import createDreamyPreset, { dreamyPlugin } from "@dreamy-ui/panda-preset";
import { patterns } from "./components/patterns";
import { recipes } from "./components/recipes";
export default defineConfig({
// ...
jsxFactory: "dreamy",
include: [
"./app/**/*.{js,jsx,ts,tsx}" // Adjust for your framework — see guides below
],
presets: [createDreamyPreset()],
plugins: [dreamyPlugin()],
patterns,
theme: {
extend: {
recipes
}
}
});The include path and build-tool setup (Vite PostCSS plugin, PostCSS config, CSS layers) differ per framework — see the linked guides above.
Add Panda codegen to your package.json so types are generated after install:
{
"scripts": {
"prepare": "panda codegen"
}
}Add styled-system/**/* to the include array and an @/ui path alias in tsconfig.json:
{
"compilerOptions": {
"paths": {
"@/ui": ["./components/ui"]
}
},
"include": ["**/*.ts", "**/*.tsx", "styled-system/**/*"]
}Next.js projects also need a styled-system/* path alias — see the Next.js guide .
Create components/dreamy-provider.tsx and wrap your app root. The exact setup depends on your framework (SSR color mode for React Router and Next.js, client-only for Vite). See the framework guides for copy-paste examples.
Add the components you need, then generate the styled-system:
pnpm dlx dreamy add button flex text headingImport components from @/ui — they are copied into your project by the CLI:
import { Button } from "@/ui";
export default function Index() {
return <Button variant="primary">I am a Dream Button 🚀</Button>;
}