component-wrapper-architecture
A blueprint for creating and extending 8-bit themed UI components using shadcn/ui base components.
Install
mkdir -p .claude/skills/component-wrapper-architecture && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/1166" && unzip -o skill.zip -d .claude/skills/component-wrapper-architecture && rm skill.zipInstalls to .claude/skills/component-wrapper-architecture
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Best practices for wrapping shadcn/ui components. Apply when creating 8-bit styled variants of existing shadcn/ui components.Key capabilities
- →Wrap shadcn/ui components with retro styling
- →Define component variants using `class-variance-authority`
- →Re-export unchanged sub-components of a base component
- →Apply pixelated borders using an outer wrapper for components
- →Pass through all original props to the base component
- →Remove default border radius from base components
How it works
The skill outlines a wrapper pattern that imports base shadcn/ui components with aliases, defines variants, and applies retro styling while ensuring prop forwarding and compatibility.
Inputs & outputs
When to use component-wrapper-architecture
- →Creating retro UI variants
- →Wrapping shadcn/ui buttons
- →Implementing 8-bit aesthetic components
About this skill
Component Wrapper Architecture
8-bit components wrap shadcn/ui components rather than replacing them. This pattern maintains compatibility while adding retro styling.
Basic Wrapper Pattern
Structure:
- Import base component with alias
- Define variants using class-variance-authority
- Export separate interface for props
- Use ref prop (not forwardRef for React 19)
import { type VariantProps, cva } from "class-variance-authority";
import { cn } from "@/lib/utils";
import { Button as ShadcnButton } from "@/components/ui/button";
import "@/components/ui/8bit/styles/retro.css";
export const buttonVariants = cva("", {
variants: {
font: {
normal: "",
retro: "retro",
},
variant: {
default: "bg-foreground",
// ...
},
},
defaultVariants: {
variant: "default",
size: "default",
},
});
export interface BitButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
asChild?: boolean;
ref?: React.Ref<HTMLButtonElement>;
}
function Button({ children, asChild, ...props }: BitButtonProps) {
const { variant, size, className, font } = props;
return (
<ShadcnButton
{...props}
className={cn(
"rounded-none active:translate-y-1 transition-transform",
className
)}
size={size}
variant={variant}
asChild={asChild}
>
{children}
</ShadcnButton>
);
}
Re-exporting Base Components
For components with multiple sub-components, re-export unchanged parts:
import {
Dialog as ShadcnDialog,
DialogHeader as ShadcnDialogHeader,
DialogFooter as ShadcnDialogFooter,
DialogDescription as ShadcnDialogDescription,
} from "@/componentsconst Dialog = ShadcnDialog;
const DialogHeader =/ui/dialog";
ShadcnDialogHeader;
const DialogFooter = ShadcnDialogFooter;
const DialogDescription = ShadcnDialogDescription;
export {
Dialog,
DialogHeader,
DialogFooter,
DialogDescription,
// ...custom implementations
};
Card Wrapper Pattern
Use outer wrapper for pixelated borders while keeping base component:
function Card({ className, font, ...props }: BitCardProps) {
return (
<div
className={cn(
"relative border-y-6 border-foreground dark:border-ring !p-0",
className
)}
>
<ShadcnCard
{...props}
className={cn(
"rounded-none border-0 !w-full",
font !== "normal" && "retro",
className
)}
/>
{/* Pixelated side borders */}
<div
className="absolute inset-0 border-x-6 -mx-1.5 border-foreground dark:border-ring pointer-events-none"
aria-hidden="true"
/>
</div>
);
}
Key Principles
- Alias imports - Use
as ShadcnComponentpattern for base components - Empty cva base - Variants often start empty, relying on CSS for styling
- Separate prop interface - Export
BitComponentPropsfor TypeScript - React 19 ref - Use
ref?: React.Ref<T>instead of forwardRef - rounded-none - Remove all border radius from base component
- Pass through props - Forward all props including
size,variant,className - Conditional retro - Use
font !== "normal" && "retro"pattern
Component Examples
components/ui/8bit/button.tsx- Basic wrapper with pixel borderscomponents/ui/8bit/card.tsx- Card with outer wrappercomponents/ui/8bit/dialog.tsx- Multi-subcomponent wrapper
How it compares
This skill provides a specific architectural pattern for applying 8-bit styling to shadcn/ui components by wrapping them, maintaining compatibility rather than replacing them.
Compared to similar skills
component-wrapper-architecture side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| component-wrapper-architecture (this skill) | 3 | 7mo | No flags | Intermediate |
| figma-implement-design | 24 | 4mo | No flags | Advanced |
| ai-elements | 3 | 5mo | Review | Beginner |
| retro-css-architecture | 1 | 7mo | No flags | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by TheOrcDev
View all by TheOrcDev →You might also like
figma-implement-design
openai
Translate Figma nodes into production-ready code with 1:1 visual fidelity using the Figma MCP workflow (design context, screenshots, assets, and project-convention translation). Trigger when the user provides Figma URLs or node IDs, or asks to implement designs or components that must match Figma specs. Requires a working Figma MCP server connection.
ai-elements
vercel
Create new AI chat interface components for the ai-elements library following established composable patterns, shadcn/ui integration, and Vercel AI SDK conventions. Use when creating new components in packages/elements/src or when the user asks to add a new component to ai-elements.
retro-css-architecture
TheOrcDev
Organize 8-bit CSS with custom properties, pixel fonts, and responsive pixel art. Apply when creating or modifying retro-styled components and their CSS.
prowler-ui
prowler-cloud
Prowler UI-specific patterns. For generic patterns, see: typescript, react-19, nextjs-15, tailwind-4. Trigger: When working inside ui/ on Prowler-specific conventions (shadcn vs HeroUI legacy, folder placement, actions/adapters, shared types/hooks/lib).
paper-to-code-components
millionco
Use when implementing Paper MCP, Paper-to-code, design-to-code, Viewfinder, or Paper-exported JSX in React/Next.js apps. Covers component candidates, globals.css tokens for arbitrary values, shadcn reuse, data-paper-* roots, and avoiding monolithic JSX.
UI Engineer
vinay-veerappa
Specialized skill for building modern, high-performance web UIs using Next.js, Tailwind, and Shadcn/UI.