create-element
БесплатноЗапускает вложенные скриптыНе проверенCreate new UI elements for tryelements.dev registry. Use when: (1) Adding new UI components (buttons, inputs, cards), (2) Building integration components…
Об этом скилле
Create Element
Creates new elements for the Elements registry (tryelements.dev).
Quick Start
Step 1: Scaffold
bun run .claude/skills/create-element/scripts/scaffold-element.ts <category> <name>
Step 2: Implement
Edit component following patterns in references/component-patterns.md
Step 3: Register
bun run build:registry && bun run dev
Context7 Integration (CRITICAL)
Before implementing any component with external dependencies, fetch the latest documentation:
Step 1: Resolve Library ID
mcp__context7__resolve-library-id
libraryName: "radix-ui"
query: "dialog component accessibility patterns"
Step 2: Query Specific Docs
mcp__context7__query-docs
libraryId: "/radix-ui/primitives"
query: "Dialog API controlled vs uncontrolled portal usage"
Common Libraries
| Library | Query For |
|---|---|
radix-ui |
Primitives (Dialog, Dropdown, Tabs, Select) |
next-themes |
Theme provider, useTheme hook, hydration |
cmdk |
Command palette patterns |
class-variance-authority |
CVA variant patterns |
embla-carousel-react |
Carousel implementation |
lucide-react |
Icon usage patterns |
Element Types
| Type | Example | When to Use |
|---|---|---|
registry:ui |
button, card, input | Base UI primitives |
registry:block |
theme-switcher, polar-checkout | Feature-complete blocks |
registry:example |
button-demo | Usage examples |
References
Read these based on what you're doing:
- references/registry-schema.md - When creating/editing registry-item.json
- references/component-patterns.md - When writing component code (CVA, cn(), data-slot)
- references/documentation.md - When creating MDX documentation
Directory Structure
registry/default/blocks/{category}/{component-name}/
├── registry-item.json # Metadata
├── components/
│ └── elements/
│ └── {component}.tsx # Main component
└── routes/ # Optional demo routes
├── layout.tsx
└── page.tsx
Workflow Example: Theme Switcher Tabs
1. Scaffold
bun run .claude/skills/create-element/scripts/scaffold-element.ts theme theme-switcher-tabs
2. Fetch Docs
mcp__context7__resolve-library-id
libraryName: "next-themes"
query: "useTheme hook theme switching"
mcp__context7__query-docs
libraryId: "/pacocoursey/next-themes"
query: "useTheme setTheme resolvedTheme hydration"
3. Implement
Edit registry/default/blocks/theme/theme-switcher-tabs/components/elements/theme-switcher-tabs.tsx:
"use client";
import { useTheme } from "next-themes";
import { useEffect, useState } from "react";
import { cn } from "@/lib/utils";
export function ThemeSwitcherTabs({ className }: { className?: string }) {
const { theme, setTheme } = useTheme();
const [mounted, setMounted] = useState(false);
useEffect(() => { setMounted(true); }, []);
if (!mounted) return <div className="h-8 w-24 animate-pulse bg-muted rounded" />;
return (
<div data-slot="theme-switcher-tabs" className={cn("...", className)}>
{/* Implementation */}
</div>
);
}
4. Update registry-item.json
{
"name": "theme-switcher-tabs",
"type": "registry:ui",
"title": "Theme Switcher Tabs",
"description": "Tab-based theme switcher with Light/Dark/System options",
"registryDependencies": [],
"dependencies": ["next-themes"],
"files": [...],
"docs": "Requires ThemeProvider. Tab-style theme switcher with system support."
}
5. Build & Test
bun run build:registry
bun run dev
Verification Checklist
- registry-item.json has all required fields ($schema, name, type, title, description, files)
- Component exports PascalCase function (e.g.,
export function ThemeSwitcherTabs) - Uses
cn()for className merging - Has
data-slotattribute on root element - Client components have
"use client"directive - Hydration-safe if using theme/client state
-
bun run build:registrysucceeds - Component renders correctly in dev
- If new category: Provider grouping configured (see "Creating New Categories" section)
Commands
# Scaffold new element
bun run .claude/skills/create-element/scripts/scaffold-element.ts <category> <name>
# Build registry
bun run build:registry
# Development server
bun run dev
# Lint/format
bun run lint
bun run format
Common Patterns
Simple Component (No Dependencies)
import { cn } from "@/lib/utils";
interface BadgeProps extends React.ComponentProps<"span"> {}
export function Badge({ className, ...props }: BadgeProps) {
return (
<span
data-slot="badge"
className={cn("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold", className)}
{...props}
/>
);
}
With CVA Vari
Установить create-element в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл create-element?
Create new UI elements for tryelements.dev registry. Use when: (1) Adding new UI components (buttons, inputs, cards), (2) Building integration components (Clerk, Stripe, Uploadthing), (3) Creating theme-related elements, (4) Any shadcn-style registry component. IMPORTANT: For logo components with variants (icon/wordmark/logo + dark/light), use the logo-with-variants skill instead. This skill includes scaffolding, registry schema, and component patterns. ALWAYS use Context7 MCP to fetch latest dependency docs before implementing.
Как установить скилл create-element?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл create-element запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic