Loading...
Loading...
Create logo components with multiple variants (icon, wordmark, logo) and light/dark modes. Use when the user provides logo SVG files and wants to create a variant-based logo component following the Clerk pattern in the Elements project.
npx skill4agent add crafter-station/elements logo-with-variantspublic/test/-dark.svg-light.svgsrc/components/ui/logos/{name}.tsx{
className?: string;
variant?: "icon" | "logo" | "wordmark";
mode?: "dark" | "light";
}variantvariant="wordmark"src/components/ui/logos/clerk.tsxfill-rulefillRulestroke-widthstrokeWidthregistry/default/blocks/logos/{name}-logo/registry-item.json{
"name": "{name}-logo",
"type": "registry:block",
"title": "{DisplayName} Logo",
"description": "{Brand description}",
"categories": ["logos"],
"meta": {
"hasVariants": true,
"variants": [
"icon-dark",
"icon-light",
"logo-dark",
"logo-light",
"wordmark-dark",
"wordmark-light"
],
"variantTypes": {
"base": ["icon", "logo", "wordmark"],
"modes": ["dark", "light"]
}
},
"files": [
{
"path": "components/logos/{name}.tsx",
"type": "registry:component"
}
],
"docs": "{Brand} logo with 3 base variants (icon, logo, wordmark) and 2 modes (dark, light) = 6 total combinations. Theme-aware: automatically adapts colors when you switch themes."
}variants{base}-{mode}components/logos/{name}.tsxregistry/index.tsregistry-item.jsonregistry/index.tsmeta{
$schema: "https://ui.shadcn.com/schema/registry-item.json",
name: "{name}-logo",
type: "registry:block",
title: "{DisplayName} Logo",
description: "{Brand description}",
registryDependencies: [],
dependencies: [],
categories: ["logos"],
meta: {
hasVariants: true,
variants: [
"icon-dark",
"icon-light",
"logo-dark",
"logo-light",
"wordmark-dark",
"wordmark-light",
],
variantTypes: {
base: ["icon", "logo", "wordmark"],
modes: ["dark", "light"],
},
},
files: [
{
path: "registry/default/blocks/logos/{name}-logo/components/logos/{name}.tsx",
type: "registry:component",
},
],
docs: "{Brand} logo with 3 base variants (icon, logo, wordmark) and 2 modes (dark, light) = 6 total combinations. Theme-aware: automatically adapts colors when you switch themes.",
}registry/index.tsmetaregistry/default/blocks/logos/logos/registry-item.jsonbun run build:registryinterface LogoProps {
className?: string;
variant?: "icon" | "logo" | "wordmark";
mode?: "dark" | "light";
}
const COLORS = {
dark: "#HEX_VALUE",
light: "#HEX_VALUE",
};
export function BrandLogo({
className,
variant = "wordmark",
mode = "dark",
}: LogoProps) {
const color = COLORS[mode];
if (variant === "icon") {
return (
<svg className={className} viewBox="...">
{/* Icon SVG content */}
</svg>
);
}
if (variant === "logo") {
return (
<svg className={className} viewBox="...">
{/* Logo SVG content */}
</svg>
);
}
// Default: wordmark
return (
<svg className={className} viewBox="...">
{/* Wordmark SVG content */}
</svg>
);
}@/components/ui/logos/{name}npx shadcn@latest add @elements/{name}-logosrc/components/ui/logos/clerk.tsxregistry/default/blocks/logos/clerk-logo/src/app/docs/logos/logo-variants-dialog.tsxregistry/default/blocks/logos/logos/registry-item.jsonsrc/registry/hasVariants: truebuild:registry