使用无样式的 Svelte 组件,键盘、焦点和屏幕阅读器支持已经内置。

这些文档介绍 ui-sdk 在 Svelte 里的用法。用的是其他框架?请看 React、Vue、Solid 或 Web Components。想从行为出发构建自己的组件,请看 Core。

@ui-sdk/svelte 提供 Select、Dialog、Tabs 等组件,它们都构建在 ui-sdk 的行为之上。这些组件处理交互、焦点和 ARIA 属性。标记和样式由你决定。

导入你需要的部件,在你的应用里把它们组合起来,再用自己的 CSS 设置样式。

快速开始

把这段提示词复制到你的智能体里:

提示词
Set up ui-sdk in this Svelte project. It needs Svelte 5.33 or newer.

1. Install @ui-sdk/svelte and @ui-sdk/core with the project's package manager. If a release-age policy blocks the install, stop and ask me instead of changing it.
2. Add a note to AGENTS.md, creating it if needed: before using ui-sdk, follow the ui-sdk skill if it's installed, and read node_modules/@ui-sdk/svelte/docs/llms.txt. To build a new component, also search node_modules/@ui-sdk/svelte/docs/core.md by heading, and read rendering.md next to it.
3. If you support skills, run: npx skills@latest add vercel-labs/ui --skill ui-sdk

它会安装 ui-sdk,并让你的 AGENTS.md 指向随包发布的文档。

自己配置

探索组件

使用组件指南 介绍这些组件共有的模式,比如组合部件、处理状态和设置样式。