بنقرة واحدة
create-component-and-docs
Guidelines for creating new React components and their Fumadocs MDX documentation.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Guidelines for creating new React components and their Fumadocs MDX documentation.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | Create Component and Docs |
| description | Guidelines for creating new React components and their Fumadocs MDX documentation. |
Use this skill when the user asks to create a new UI component. This skill ensures that both the component code and its documentation are created in the correct locations with the correct structure.
Location: src/components/emerald-ui-components/<kebab-case-name>.tsx
Template:
'use client'
/**
* @author: @shatlyk1011
* @description: [Brief description of component]
* @version: 1.0.0
* @date: [Current Date YYYY-MM-DD]
* @license: MIT
* @website: https://emerald-ui.com
*/
import { useState } from 'react'
import {
// Import icons from lucide-react as needed
Star,
} from 'lucide-react'
import { motion, AnimatePresence } from 'motion/react'
import { cn } from '@/lib/utils'
// Define interfaces
interface MyComponentProps {
// props...
}
export default function MyComponent({ ...props }: MyComponentProps) {
// implementation...
return <div className='...'>{/* Component JSX */}</div>
}
Key Guidelines:
'use client' at the top.motion/react for animations.lucide-react for icons.default.Location: src/content/docs/components/<kebab-case-name>.mdx
Template:
---
title: [Component Name]
description: [Brief description]
icon: [Lucide Icon Name]
full: false
---
import [ComponentName] from '@/components/emerald-ui-components/[kebab-case-name]'
<Preview link='[kebab-case-name]' comment={['[additional packages if there is any]']}>
<[ComponentName] />
</Preview>
Key Guidelines:
title, description, icon, and full.@/components/emerald-ui-components/....<Preview>.link prop in <Preview> should match the filename (without extension).Location: src/registry/registry-components.ts
Action: Add an entry to the component array in the registry file. Place it under the correct category comment (e.g., // ─── Buttons ─────, // ─── Cards ─────, etc.).
Template:
{
name: '[kebab-case-name]',
type: 'registry:component',
dependencies: ['[any npm dependencies e.g., motion, lucide-react]'],
registryDependencies: ['[any other registry components e.g., button]'],
files: [
{
path: 'components/emerald-ui-components/[category-folder-if-any]/[kebab-case-name].tsx',
type: 'registry:component',
},
// Include any context or hook files if necessary
],
},
Key Guidelines:
name should be the kebab-case name of the component.files[].path must be the correct relative path from the src/ directory (e.g., components/emerald-ui-components/buttons/my-button.tsx).dependencies (npm packages) or registryDependencies (other registry components) if the component uses them.