laguagu/claude-code-nextjs-skills / skills/shadcn
shadcn
VerifiedManages shadcn components and projects — adding, searching, fixing, debugging, styling, and composing UI, including chat interfaces. Provides project context, component docs, and usage examples. Applies when working with shadcn/ui, component registries, presets, --preset codes, or any project with a components.json file. Also triggers for "shadcn init", "create an app with --preset", "switch to --preset", and for building a design system or applying a DESIGN.md or brand spec to shadcn/ui.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 22.1 KB |
| agents/openai.yaml | config | 238 B |
| assets/shadcn-small.png | binary | 1.0 KB |
| assets/shadcn.png | binary | 3.8 KB |
| assets/showcase/color-pair.tsx | other | 3.4 KB |
| assets/showcase/preview-states.css | other | 425 B |
| assets/showcase/state-matrix.tsx | other | 1.6 KB |
| cli.md | markdown | 21.0 KB |
| customization.md | markdown | 6.7 KB |
| design-system-page.md | markdown | 15.4 KB |
| design-system.md | markdown | 21.5 KB |
| evals/evals.json | config | 10.4 KB |
| mcp.md | markdown | 3.5 KB |
| registry.md | markdown | 8.8 KB |
| rules/base-vs-radix.md | markdown | 7.3 KB |
| rules/chat.md | markdown | 17.2 KB |
| rules/composition.md | markdown | 4.8 KB |
| rules/forms.md | markdown | 5.0 KB |
| rules/icons.md | markdown | 1.9 KB |
| rules/styling.md | markdown | 4.6 KB |
| scripts/showcase-coverage.mjs | script | 1.6 KB |
assets/showcase/color-pair.tsx
View on GitHubimport * as React from "react"
import { cn } from "@/lib/utils"
// Resolves any CSS color (hex, rgb, oklch, color-mix) to sRGB by painting one pixel.
// Translucent colors are composited over the backdrop, as the browser would.
function toRgb(color: string, backdrop = "#fff") {
const canvas = document.createElement("canvas")
canvas.width = canvas.height = 1
const context = canvas.getContext("2d", { willReadFrequently: true })
if (!context) {
return null
}
context.fillStyle = backdrop
context.fillRect(0, 0, 1, 1)
context.fillStyle = color
context.fillRect(0, 0, 1, 1)
const [r, g, b] = context.getImageData(0, 0, 1, 1).data
return [r, g, b]
}
function toHex(rgb: number[]) {
return `#${rgb.map((value) => value.toString(16).padStart(2, "0")).join("")}`
}
function luminance([r, g, b]: number[]) {
const [R, G, B] = [r, g, b].map((value) => {
const channel = value / 255
return channel <= 0.03928
? channel / 12.92
: ((channel + 0.055) / 1.055) ** 2.4
})
return 0.2126 * R + 0.7152 * G + 0.0722 * B
}
function contrast(a: number[], b: number[]) {
const [light, dark] = [luminance(a), luminance(b)].sort((x, y) => y - x)
return (light + 0.05) / (dark + 0.05)
}
export function ColorPair({
name,
background,
foreground,
className,
}: {
name: string
background: string
foreground: string
className?: string
}) {
const ref = React.useRef<HTMLDivElement>(null)
const [info, setInfo] = React.useState<{ ratio: number; bg: string } | null>(
null
)
React.useEffect(() => {
const element = ref.current
if (!element) {
return
}
// Re-measure when the theme class on <html> changes.
const measure = () => {
const style = getComputedStyle(element)
const page = getComputedStyle(document.body).backgroundColor
const bg = toRgb(style.backgroundColor, page)
if (!bg) {
return
}
const fg = toRgb(style.color, toHex(bg))
if (fg) {
setInfo({ ratio: contrast(bg, fg), bg: toHex(bg) })
}
}
measure()
const observer = new MutationObserver(measure)
observer.observe(document.documentElement, { attributes: true })
return () => observer.disconnect()
}, [])
const level = !info
? ""
: info.ratio >= 7
? "AAA"
: info.ratio >= 4.5
? "AA"
: info.ratio >= 3
? "AA Large"
: "Fail"
return (
<div
className={cn(
"flex flex-col overflow-hidden rounded-xl border",
className
)}
>
<div
ref={ref}
style={{
backgroundColor: `var(--${background})`,
color: `var(--${foreground})`,
}}
className="flex h-24 items-end justify-between p-4"
>
<span className="text-2xl font-medium">Aa</span>
{info && (
<span className="rounded-full border border-current/20 px-2 py-0.5 font-mono text-xs">
{info.ratio.toFixed(2)} {level}
</span>
)}
</div>
<div className="flex flex-col gap-0.5 bg-background p-3">
<span className="text-sm font-medium">{name}</span>
<span className="font-mono text-xs text-muted-foreground">
--{background} / --{foreground}
</span>
{info && (
<span className="font-mono text-xs text-muted-foreground">
{info.bg}
</span>
)}
</div>
</div>
)
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |