apps/eclipse/content/design-system/index.mdx
import { EclipseShowcase } from '@/components/eclipse-showcase';
Built with Tailwind CSS and design tokens imported directly from Figma, it ensures design consistency and makes it easy to build beautiful, accessible interfaces.
pnpm add @prisma/eclipse
Make sure you have the Tailwind v4 PostCSS plugin installed:
pnpm add -D @tailwindcss/postcss
Create or update postcss.config.mjs:
export default {
plugins: {
'@tailwindcss/postcss': {},
},
};
Initialize Tailwind once in the consuming app, then import Eclipse styles:
@import "tailwindcss";
@import "@prisma/eclipse/styles/globals.css";
Import components from @prisma/eclipse in your app code:
import { Button } from "@prisma/eclipse";
export function App() {
return <Button variant="ppg">Get started</Button>;
}
tailwindcss once in the app entry stylesheet).@prisma/eclipse/styles/globals.css includes Eclipse tokens/utilities and @source directives for Eclipse components.import { Button } from "@prisma/eclipse";
export function MyComponent() {
return (
<div className="space-x-4">
<Button variant="default">Default</Button>
<Button variant="ppg">Prisma Pulse & Accelerate</Button>
<Button variant="orm">Prisma ORM</Button>
<Button variant="destructive">Destructive</Button>
</div>
);
}
default - Standard button styleppg - Prisma Pulse & Accelerate brand colors (teal/cyan)orm - Prisma ORM brand colors (purple/blue)destructive - Error/danger actions (red)outline - Outlined button stylesecondary - Secondary action styleghost - Minimal button stylelink - Link-styled buttonsm - Small buttondefault - Standard button sizelg - Large buttonEclipse uses a semantic color system with support for both light and dark modes.
<div className="bg-background-default">Default background</div>
<div className="bg-background-neutral">Neutral background</div>
<div className="bg-background-ppg">PPG background</div>
<div className="bg-background-orm">ORM background</div>
<div className="bg-background-error">Error background</div>
<div className="bg-background-success">Success background</div>
<div className="bg-background-warning">Warning background</div>
<span className="text-foreground-neutral">Neutral text</span>
<span className="text-foreground-ppg">PPG text</span>
<span className="text-foreground-orm">ORM text</span>
<span className="text-foreground-error">Error text</span>
<span className="text-foreground-success">Success text</span>
<span className="text-foreground-warning">Warning text</span>
Each color has multiple variants for different use cases:
default - Base colorstrong - Stronger/darker variantweak - Lighter/softer variantreverse - Contrast color for use on colored backgroundsreverse-weak - Lighter reverse colorExample:
<div className="bg-background-ppg">
<span className="text-foreground-ppg-reverse">Text on PPG background</span>
</div>
<p className="text-2xs">2XS - 11px</p>
<p className="text-xs">XS - 12px</p>
<p className="text-sm">SM - 14px</p>
<p className="text-md">MD - 16px (Base)</p>
<p className="text-lg">LG - 18px</p>
<p className="text-xl">XL - 20px</p>
<p className="text-2xl">2XL - 24px</p>
<p className="text-3xl">3XL - 30px</p>
<p className="font-normal">Normal (400)</p>
<p className="font-medium">Medium (500)</p>
<p className="font-semibold">Semibold (600)</p>
<p className="font-bold">Bold (750)</p>
<p className="font-ultra-bold">Ultra Bold (900)</p>
Eclipse provides a comprehensive spacing system for margins and padding.
<div className="m-margin-4xs">4xs - 4px</div>
<div className="m-margin-3xs">3xs - 8px</div>
<div className="m-margin-2xs">2xs - 12px</div>
<div className="m-margin-xs">xs - 16px</div>
<div className="m-margin-sm">sm - 20px</div>
<div className="m-margin-md">md - 24px</div>
<div className="m-margin-lg">lg - 28px</div>
<div className="m-margin-xl">xl - 32px</div>
<div className="m-margin-4xl">4xl - 48px</div>
<div className="p-6">Container padding</div>
<div className="p-padding-inline-element-lg">Element padding</div>
<div className="rounded-square-low">Low radius (3px)</div>
<div className="rounded-square">Square radius (6px)</div>
<div className="rounded-square-high">High radius (12px)</div>
<div className="rounded-circle">Circular</div>
Eclipse supports manual dark mode toggling. Apply the dark class to the <html> element:
import { useEffect, useState } from "react";
function App() {
const [isDark, setIsDark] = useState(false);
useEffect(() => {
document.documentElement.classList.toggle("dark", isDark);
}, [isDark]);
return (
<button onClick={() => setIsDark(!isDark)}>
Toggle {isDark ? "Light" : "Dark"} Mode
</button>
);
}
Access design tokens programmatically:
import { tokens } from "@prisma/eclipse/tokens";
console.log(tokens.borderRadius.square); // 6
console.log(tokens.typography.fontSize.md); // 16
console.log(tokens.margin.md); // 24
Eclipse includes a cn utility for merging class names with Tailwind class deduplication:
import { cn } from "@prisma/eclipse/lib/cn";
function MyComponent({ className, isActive }) {
return (
<div className={cn(
"bg-background-default",
isActive && "bg-background-ppg",
className
)}>
Content
</div>
);
}
For questions or issues with the Eclipse Design System, please reach out to the Prisma design team or open an issue on GitHub.