首页/ AI 技能 / @skilllib/skill-2117939930272414928
Skill站外收录 @skilllib/skill-2117939930272414928

svelte-components

提供构建现代化 Svelte 组件的完整实践方案,涵盖可复用组件库集成、原生 Web Components 封装、复杂表单结构处理等核心场景,支持无障碍访问与灵活样式定制。

0.0 (0) 16 次安装 原作者 编程导航
收录于 2026-01-22
软件开发 AI 技能

Skills.MD

# 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: ```svelte <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 ```javascript // svelte.config.js export default { compilerOptions: { customElement: true, }, }; ``` ```svelte <!-- MyButton.svelte --> <svelte:options customElement="my-button" /> <button><slot /></button> ``` ## Reference Files - [component-libraries.md](references/component-libraries.md) - Bits UI, Ark UI setup - [web-components.md](references/web-components.md) - Building custom elements - [form-patterns.md](references/form-patterns.md) - Advanced form handling ## Notes - Bits UI 1.0: flexible, unstyled, accessible components for Svelte - Form `defaultValue` attribute enables easy form resets - Use snippets to wrap rich HTML in custom select options - **Last verified:** 2025-01-14 <!-- PROGRESSIVE DISCLOSURE GUIDELINES: - Keep this file ~50 lines total (max ~150 lines) - Use 1-2 code blocks only (recommend 1) - Keep description <200 chars for Level 1 efficiency - Move detailed docs to references/ for Level 3 loading - This is Level 2 - quick reference ONLY, not a manual -->

评论 0

还没有评论,来抢沙发。