About svelte-components
A Svelte component-development skill covering component-library choices, forms, and custom elements. It also points to reference files for component libraries, web components, and form patterns.
Key features
- 01Guidance on Bits UI, Ark UI, and Melt UI
- 02Form handling with the `form` attribute
- 03Building custom elements
- 04Using snippets for component content
Use cases
- 01Choosing a Svelte component library
- 02Handling inputs outside a form wrapper
- 03Creating custom elements
- 04Building rich select options or component content
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ spences10/ skills --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" />
<!-- Native <slot> is appropriate inside custom elements. -->
<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
- Use snippets/
{@render}for normal Svelte component content; native<slot>is for custom elements - Last verified: 2026-05-14
Comments
Markdown supported