Use the automated CLI to set up Dreamy UI in your project:
pnpm dlx @dreamy-ui/cli initThe CLI will automatically:
- Detect your framework (React Router v7, Next.js, or Vite)
- Install all required dependencies (Panda CSS + Dreamy UI)
- Create and configure
panda.config.ts - Update
vite.config.tsorpostcss.config.mjswith Panda CSS PostCSS plugin - Remove default Tailwind CSS (React Router v7 and Next.js only)
- Set up CSS files with proper imports
- Create a
DreamyProvidercomponent - Update your
tsconfig.jsonwith@/*path alias and styled-system (if using TypeScript) - Next.js also gets
styled-system/*path alias for proper type resolution - Run Panda CSS codegen to generate the styled-system
- Add recommended components (button, flex, text, heading) to get you started
- Prints out code to add to the root of your application
If you prefer manual installation or need more control, follow the framework-specific guides:
Install panda by following the panda CSS installation for your framework.
pnpm install @dreamy-ui/react @dreamy-ui/panda-preset @dreamy-ui/cli motionAfter installing, you should configure your panda config with Dream preset. Copy and paste the following code into your panda.config.ts file:
import createDreamyPreset, { dreamyPlugin } from "@dreamy-ui/panda-preset";
import { defineConfig } from "@pandacss/dev";
import { patterns } from "./app/components/patterns";
import { recipes } from "./app/components/recipes";
export default defineConfig({
preflight: true,
watch: true,
jsxFramework: "react",
jsxStyleProps: "all",
outExtension: "js",
jsxFactory: "dreamy",
include: [
"./app/**/*.{js,jsx,ts,tsx}" // Replace with your app source directory
],
presets: [createDreamyPreset()],
plugins: [dreamyPlugin()],
patterns: {
extend: patterns
},
theme: {
extend: {
recipes
}
},
globalCss: {
extend: {}
},
staticCss: {
extend: {}
},
});Note: The patterns and recipes imports are automatically configured by the CLI based on your framework. The paths will be adjusted for Next.js (./src/components or ./components) or Vite (./src/components).
Add DreamyProvider to the root of your app. It is a wrapper for your app, which provides Dreamy UI with all the necessary context.
import { DreamyProvider } from "@dreamy-ui/react";
import domMax from "motion/react";
export default function App() {
return (
<DreamyProvider motionFeatures={domMax}>
<YourApp />
</DreamyProvider>
);
}Create a new component and use some Dreamy UI components!
import { Button } from "@dreamy-ui/react";
export default function Index() {
return <Button variant="primary">I am a Dream Button 🚀</Button>;
}