Use the automated CLI to set up Dreamy UI in your project:

pnpm dlx @dreamy-ui/cli init

The CLI will automatically:

  1. Detect your framework (React Router v7, Next.js, TanStack Start, or Vite)
  2. Install required dependencies:
    • Dev: @pandacss/dev, @pandacss/postcss, @dreamy-ui/cli
    • Prod: @dreamy-ui/react, @dreamy-ui/panda-preset, motion
  3. Create and configure panda.config.ts with the Dreamy preset, patterns, and recipes
  4. Add a prepare script (panda codegen) to package.json
  5. Update vite.config with the Panda CSS PostCSS plugin (removes Tailwind if present)
  6. Set up src/index.css with Panda layers and import it in src/main.tsx
  7. Update tsconfig.json — add styled-system/**/* to include and an @/ui path alias
  8. Create a components/dreamy-provider.tsx wrapper component
  9. Wire up DreamyProvider in src/main.tsx
  10. Add recommended starter components (button, flex, text, heading)
  11. Run Panda CSS codegen to generate styled-system
pnpm add -D @pandacss/dev @pandacss/postcss @dreamy-ui/cli

Add the Panda CSS PostCSS plugin to vite.config.ts:

import pandacss from "@pandacss/dev/postcss";
 
export default defineConfig({
	// ...
	css: {
		postcss: {
			plugins: [pandacss]
		}
	}
});
import createDreamyPreset, { dreamyPlugin } from "@dreamy-ui/panda-preset";
import { patterns } from "./components/patterns";
import { recipes } from "./components/recipes";
 
export default defineConfig({
	// ...
	jsxFactory: "dreamy",
	include: ["./src/**/*.{js,jsx,ts,tsx}"],
	presets: [createDreamyPreset()],
	plugins: [dreamyPlugin()],
	patterns,
	theme: {
		extend: {
			recipes
		}
	}
});

Add components first with npx dreamy add button so the components/patterns and components/recipes index files exist.

Add Panda layers to src/index.css:

@layer reset, base, tokens, recipes, utilities;

Make sure src/index.css is imported in src/main.tsx.

{
	"scripts": {
		"prepare": "panda codegen"
	}
}
{
	"compilerOptions": {
		"paths": {
			"@/ui": ["./components/ui"]
		}
	},
	"include": [
		// ...
		"styled-system/**/*"
	]
}

Create components/dreamy-provider.tsx:

import { DreamyProvider as BaseDreamyProvider } from "@dreamy-ui/react";
import domMax from "motion/react";
 
interface DreamyProviderProps {
	children: React.ReactNode;
}
 
export function DreamyProvider({ children }: DreamyProviderProps) {
	return <BaseDreamyProvider motionFeatures={domMax}>{children}</BaseDreamyProvider>;
}

Wrap your app in src/main.tsx:

import { DreamyProvider } from "../components/dreamy-provider";
 
ReactDOM.createRoot(document.getElementById("root")!).render(
	<DreamyProvider>
		<App />
	</DreamyProvider>
);
pnpm dlx dreamy add button flex text heading
import { Button } from "@/ui";
 
function App() {
	return <Button>Dreamy UI!</Button>;
}
 
export default App;