About svelte-components
A reference skill for Svelte developers covering component libraries, form handling, and Web Components. It also points to focused references for common implementation patterns.
Key features
- 01Bits UI, Ark UI, and Melt UI guidance
- 02Form attributes and reset patterns
- 03Building Web Components
- 04Handling rich HTML select options
Use cases
- 01Choosing a component library for a Svelte project
- 02Handling forms that cannot wrap inputs
- 03Compiling Svelte components as custom elements
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ spences10/ svelte-skills-kit --skill svelte-componentsAfter installing, type/svelte-componentsin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
references/component-libraries.mdform-patterns.mdweb-components.mdDetails
From the project READMESvelte Components
Quick Start
Component libraries: Bits UI (headless) | Ark UI | Melt UI (primitives)
Form trick: Use form attribute when form can't wrap inputs:
<form id="my-form" action="/submit"><!-- outside table --></form>
<table>
<tr>
<td><input form="my-form" name="email" /></td>
<td><button form="my-form">Submit</button></td>
</tr>
</table>
Web Components
// svelte.config.js
export default {
compilerOptions: {
customElement: true,
},
};
<!-- MyButton.svelte -->
<svelte:options customElement="my-button" />
<button><slot /></button>
Reference Files
- component-libraries.md - Bits UI, Ark UI setup
- web-components.md - Building custom elements
- form-patterns.md - Advanced form handling
Notes
- Bits UI 1.0: flexible, unstyled, accessible components for Svelte
- Form
defaultValueattribute enables easy form resets - Use snippets to wrap rich HTML in custom select options
- Last verified: 2025-01-14
Comments
Markdown supported