File contents 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:
Gather Requirements :
Component name and purpose
Props interface
Events to emit
Slots needed
State management requirements
TypeScript preference
Component Structure :
<script lang="ts">
// Imports
// Type definitions
// Props
// State
// Derived values
// Effects
// Functions
</script>
<!-- Markup -->
<style>
/* Scoped styles */
</style>
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
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
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
1 --- 2 name: 1755-svelte-component-24cc1228 3 description: Create Svelte Component 4 --- 5 6 # Create Svelte Component 7 8 Create new Svelte component: $ARGUMENTS 9 10 ## Current Svelte Project 11 12 - Svelte config: @svelte.config.js or @vite.config.js (if exists) 13 - Components directory: @src/components/ or @src/lib/ (if exists) 14 - TypeScript config: @tsconfig.json (detect TypeScript usage) 15 - Testing setup: @vitest.config.js or @jest.config.js (if exists) 16 17 ## Task 18 19 Create Svelte component with best practices. When creating components: 20 21 1. **Gather Requirements**: 22 - Component name and purpose 23 - Props interface 24 - Events to emit 25 - Slots needed 26 - State management requirements 27 - TypeScript preference 28 29 2. **Component Structure**: 30 ```svelte 31 <script lang="ts"> 32 // Imports 33 // Type definitions 34 // Props 35 // State 36 // Derived values 37 // Effects 38 // Functions 39 </script> 40 41 <!-- Markup --> 42 43 <style> 44 /* Scoped styles */ 45 </style> 46 ``` 47 48 3. **Best Practices**: 49 - Use proper prop typing with TypeScript/JSDoc 50 - Implement $bindable props where appropriate 51 - Create accessible markup by default 52 - Add proper ARIA attributes 53 - Use semantic HTML elements 54 - Include keyboard navigation support 55 56 4. **Component Types to Create**: 57 - **UI Components**: Buttons, Cards, Modals, etc. 58 - **Form Components**: Inputs with validation, custom form controls 59 - **Layout Components**: Headers, Sidebars, Grids 60 - **Data Components**: Tables, Lists, Data visualizations 61 - **Utility Components**: Portals, Transitions, Error boundaries 62 63 5. **Additional Files**: 64 - Create accompanying test file 65 - Add Storybook story if applicable 66 - Create usage documentation 67 - Export from index file 68 69 ## Example Usage 70 71 User: "Create a Modal component with customizable header, footer slots, and close functionality" 72 73 Assistant will: 74 - Create Modal.svelte with proper structure 75 - Implement focus trap and keyboard handling 76 - Add transition effects 77 - Create Modal.test.js with basic tests 78 - Provide usage examples 79 - Suggest accessibility improvements
tools-only/X-Skills/tree/main/development/tools/1755-svelte-component_24cc1228 commit 516dcbfe97
Frequently asked questions How do I install the 1755 Svelte Component 24cc1228 skill? Run npx skillmds@latest add tools-only/1755-svelte-component-24cc1228 in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
What does the 1755 Svelte Component 24cc1228 skill do? Create Svelte Component It is listed under Web & Frontend on SkillMD.
Is 1755 Svelte Component 24cc1228 safe to use? This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
Which AI agents work with 1755 Svelte Component 24cc1228? This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Is 1755 Svelte Component 24cc1228 free to use? Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
Who published 1755 Svelte Component 24cc1228? tools-only (@tools-only) published this skill. Their other Agent Skills are listed on their SkillMD profile.