تخطَّ إلى المحتوى
أمرمستورد

svelte-component

Create new Svelte components with best practices, TypeScript support, and testing

وصف مستورد لم يراجعه محرر بعد

جاء هذا العنصر من مستودعه الأصلي وفحصناه آلياً فقط، ولم يكتب له محرر وصفاً عربياً بعد. اقرأ محتواه بنفسك قبل أن تعتمد عليه. ولا تُفهرس هذه الصفحة في محركات البحث حتى تُراجَع.

التنزيل

الملفات: 1 · الحجم: 3.2 ك.ب

نزّل ملف ZIP

يحمل الملف ترخيص المصدر الأصلي.

التثبيت

بعد التنزيل، شغّل الأمر في الطرفية. يسأل unzip قبل أن يستبدل أي ملف موجود.

  • لهذا المشروع

    يوضع في: .claude/commands/

    mkdir -p .claude/commands && unzip ~/Downloads/svelte-component.zip -d .claude/commands

  • لحسابك على الجهاز كله

    يوضع في: ~/.claude/commands/

    mkdir -p ~/.claude/commands && unzip ~/Downloads/svelte-component.zip -d ~/.claude/commands

التعليمات

Create Svelte Component

Create new Svelte component: $ARGUMENTS

Current Svelte Project

  • Svelte config: @svelte.config.js or @vite.config.js (if exists)
  • Components directory: @src/components/ or @src/lib/ (if exists)
  • TypeScript config: @tsconfig.json (detect TypeScript usage)
  • Testing setup: @vitest.config.js or @jest.config.js (if exists)

Task

Create Svelte component with best practices. When creating components:

  1. Gather Requirements:

    • Component name and purpose
    • Props interface
    • Events to emit
    • Slots needed
    • State management requirements
    • TypeScript preference
  2. Component Structure:

    <script lang="ts">
      // Imports
      // Type definitions
      // Props
      // State
      // Derived values
      // Effects
      // Functions
    </script>
    
    <!-- Markup -->
    
    <style>
      /* Scoped styles */
    </style>
    
  3. Best Practices:

    • Use proper prop typing with TypeScript/JSDoc
    • Implement $bindable props where appropriate
    • Create accessible markup by default
    • Add proper ARIA attributes
    • Use semantic HTML elements
    • Include keyboard navigation support
  4. Component Types to Create:

    • UI Components: Buttons, Cards, Modals, etc.
    • Form Components: Inputs with validation, custom form controls
    • Layout Components: Headers, Sidebars, Grids
    • Data Components: Tables, Lists, Data visualizations
    • Utility Components: Portals, Transitions, Error boundaries
  5. Additional Files:

    • Create accompanying test file
    • Add Storybook story if applicable
    • Create usage documentation
    • Export from index file

Example Usage

User: "Create a Modal component with customizable header, footer slots, and close functionality"

Assistant will:

  • Create Modal.svelte with proper structure
  • Implement focus trap and keyboard handling
  • Add transition effects
  • Create Modal.test.js with basic tests
  • Provide usage examples
  • Suggest accessibility improvements

الملفات

  • LICENSE1 ك.ب
  • svelte-component.md2.2 ك.ب

التعليقات (0)

لا تعليقات بعد. كن أول من يعلّق.

سجّل الدخول لتعلّق. التعليق من المستوى 1 (عضو).

أبلغ

عناصر مشابهة

  • أمرمستورد

    accessibility-audit

    Audit web accessibility for WCAG compliance with automated axe-core tests, keyboard and screen reader checks, and remediation guidance

    MITالملفات: 1

  • أمرمستورد

    component-scaffold

    Scaffold React and React Native components with TypeScript, tests, styles, and Storybook stories

    MITالملفات: 1

  • أمرمستورد

    create-component

    Guided component creation with proper patterns

    MITالملفات: 1

  • أمرمستورد

    create-plugin

    Guided end-to-end plugin creation workflow with component design, implementation, and validation

    Apache-2.0الملفات: 1

  • أمرمستورد

    gws-events-renew

    Google Workspace Events: Renew/reactivate Workspace Events subscriptions.

    MITالملفات: 1