apps/eclipse/content/design-system/components/badge.mdx
import { Badge, badgeVariants } from "@prisma/eclipse";
Basic Badge
import { Badge } from "@prisma/eclipse";
export function StatusBadge() {
return <Badge color="success" label="Active" />;
}
Live Example:
<div className="flex flex-wrap gap-2 my-4"> <Badge color="neutral" label="Neutral" /> <Badge color="ppg" label="PPG" /> <Badge color="orm" label="ORM" /> <Badge color="success" label="Success" /> <Badge color="error" label="Error" /> <Badge color="warning" label="Warning" /> </div>Color Variants
import { Badge } from "@prisma/eclipse";
export function ColoredBadges() {
return (
<div className="flex flex-wrap gap-2">
<Badge color="neutral" label="Neutral" />
<Badge color="ppg" label="New Feature" />
<Badge color="orm" label="Deprecated" />
<Badge color="error" label="Error" />
<Badge color="success" label="Active" />
<Badge color="warning" label="Beta" />
</div>
);
}
Live Example:
<div className="flex flex-wrap gap-2 my-4"> <Badge color="neutral" label="Draft" /> <Badge color="ppg" label="Pulse Feature" /> <Badge color="orm" label="ORM Only" /> <Badge color="error" label="Deprecated" /> <Badge color="success" label="Stable" /> <Badge color="warning" label="Experimental" /> </div>Status Indicators
Use badges to show status in lists or cards:
import { Badge } from "@prisma/eclipse";
export function UserList() {
return (
<div className="space-y-2">
<div className="flex items-center justify-between">
<span>John Doe</span>
<Badge color="success" label="Online" />
</div>
<div className="flex items-center justify-between">
<span>Jane Smith</span>
<Badge color="neutral" label="Away" />
</div>
<div className="flex items-center justify-between">
<span>Bob Johnson</span>
<Badge color="error" label="Offline" />
</div>
</div>
);
}
Category Labels
import { Badge } from "@prisma/eclipse";
export function ArticleCategories() {
return (
<div className="flex flex-wrap gap-2">
<Badge color="ppg" label="Tutorial" />
<Badge color="orm" label="Guide" />
<Badge color="neutral" label="Reference" />
</div>
);
}
Live Example:
<div className="flex flex-wrap gap-2 my-4"> <Badge color="ppg" label="Tutorial" /> <Badge color="orm" label="Guide" /> <Badge color="neutral" label="Reference" /> <Badge color="success" label="Best Practice" /> </div>Badge Sizes
import { Badge } from "@prisma/eclipse";
export function BadgeSizes() {
return (
<div className="flex flex-wrap items-center gap-2">
<Badge size="md" color="neutral" label="Medium (default)" />
<Badge size="lg" color="neutral" label="Large" />
</div>
);
}
Live Example:
<div className="flex flex-wrap items-center gap-2 my-4"> <Badge size="md" color="neutral" label="Medium (default)" /> <Badge size="lg" color="neutral" label="Large" /> </div>color - The color variant: "neutral", "ppg", "orm", "error", "success", "warning" (default: "neutral")size - The size variant: "md", "lg" (default: "md")label - The text to display inside the badge (required)className - Additional CSS classes (optional)Default badge style for general-purpose labels.
<Badge color="neutral" label="Neutral" />
Use for Prisma Pulse and Accelerate related features or content.
<Badge color="ppg" label="PPG Feature" />
Use for Prisma ORM specific features or content.
<Badge color="orm" label="ORM Only" />
Indicates successful states, active status, or positive information.
<Badge color="success" label="Active" />
Indicates errors, deprecated features, or critical issues.
<Badge color="error" label="Deprecated" />
Indicates warnings, beta features, or items requiring attention.
<Badge color="warning" label="Beta" />
API Status
<Badge color="success" label="Stable" />
<Badge color="warning" label="Beta" />
<Badge color="error" label="Deprecated" />
Feature Availability
<Badge color="ppg" label="Pulse" />
<Badge color="orm" label="ORM" />
<Badge color="neutral" label="All Products" />
Content Types
<Badge color="neutral" label="Guide" />
<Badge color="neutral" label="Tutorial" />
<Badge color="neutral" label="Reference" />
Version Status
<Badge color="success" label="Latest" />
<Badge color="warning" label="Preview" />
<Badge color="neutral" label="Legacy" />