Svelte components

From spences10/skills · View interactive version

Svelte components is an AI agent skill from the GitHub repository spences10/skills. Build Svelte components. Use for Svelte custom elements, component libraries (Bits UI, Ark UI, Melt UI), form patterns, or third-party integration.

How to use this skill

Skill file

Svelte 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

UI, Ark UI setup

elements

handling

Notes

<!--

PROGRESSIVE DISCLOSURE GUIDELINES:

-->

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.