A library of behaviors for agents to build the next generation of user interfaces.
★ 5,098⑂ 166👁 5⑃ 474● 122▤ 24
+403
日增长
5,098
stars
166
forks
5
watchers
474
prs
122
issues
24
releases
README
UI SDK
A library of behaviors for agents to build the next generation of user interfaces.
Keyboard navigation, focus, selection, dismissal, popups, drag and drop and the ARIA they need live in @ui-sdk/core, with adapters for React, Vue, Svelte, Solid and Web Components.
Read the docs
Install
UI SDK is in beta. Install core and the adapter for your framework:
bash
npm install @ui-sdk/react @ui-sdk/core
For other frameworks, swap @ui-sdk/react for @ui-sdk/vue, @ui-sdk/svelte, @ui-sdk/solid or @ui-sdk/web.
Then give your agent the UI SDK skill:
bash
npx skills add vercel-labs/ui --skill ui-sdk
Example
Every component in UI SDK is built from behaviors. You start by creating the primitive with behaviors.
Don't worry, you don't need to learn how to write this. Your agents will. And we made them really good at it.
ts
import { createFocusRecovery, definePrimitive } from "@ui-sdk/core"
const searchField = definePrimitive({
name: "search-field",
state: () = ({ value: "" }),
api: (context) = ({
set: (value: string) = context.store.set({ value }),
recovery: createFocusRecovery({ fallback: () = context.element("input") }),
}),
slots: (slot) = ({
input: slot({
attrs: (state) = ({ value: state.value }),
on: {
input: (event, { api }) =
api.set((event.target as HTMLInputElement).value),
},
}),
clear: slot({
present: (state) = state.value !== "",
attrs: () = ({ type: "button" }),
press: ({ api }) = api.set(""),
bind: (el, part) = part.api.recovery.bind(el, part),
}),
}),
})
export { searchField }
Then render it in your framework with createParts. The parts are the same in all five.
React
tsx
import { createParts } from "@ui-sdk/react/primitive"
import { searchField } from "./search-field"
const parts = createParts(searchField, { input: "input", clear: "button" })
const SearchField = parts.Root
const SearchFieldInput = parts.Input
const SearchFieldClear = parts.Clear
function Search() {
return (
Clear
)
}
export { Search }
Vue
vue
import { createParts } from "@ui-sdk/vue/primitive"
import { searchField } from "./search-field"
const parts = createParts(searchField, { input: "input", clear: "button" })
const SearchField = parts.Root
const SearchFieldInput = parts.Input
const SearchFieldClear = parts.Clear
Clear
Svelte
svelte
import { createParts } from "@ui-sdk/svelte/primitive"
import { searchField } from "./search-field"
const parts = createParts(searchField, { input: "input", clear: "button" })
const SearchField = parts.Root
const SearchFieldInput = parts.Input
const SearchFieldClear = parts.Clear
Clear
Solid
tsx
import { createParts } from "@ui-sdk/solid/primitive"
import { searchField } from "./search-field"
const parts = createParts(searchField, { input: "input", clear: "button" })
const SearchField = parts.Root
const SearchFieldInput = parts.InTop issues
#495Angular: what a sixth renderer needs, and why the contract can carry it2 comments · 2026-11-14#494NumberInput: the control has no spinbutton role or aria-valuenow/min/max2 comments · 2026-11-14#580Menu: a text field inside the menu loses focus on pointer move and loses typed keys1 comments · 2026-11-14#576PasswordInput: unmounting it while the field has focus throws in focusout (selectionStart of undefined)1 comments · 2026-11-14#540Agent snapshot lists a Button rendered as a link with no actions1 comments · 2026-11-14#535Potential issues found while auditing Dialog and Popup internals1 comments · 2026-11-14#523A root with a pending controlled input rebuilds the component that renders it (Solid)1 comments · 2026-11-14#520Field on the server: the control's `aria-describedby` names ids no element has, so an error is not announced before hydration1 comments · 2026-11-14
Latest release
@ui-sdk/[email protected] @ui-sdk/[email protected] Pre-release 2026-11-15Patch Changes - Updated dependencies [75c3588] - Updated dependencies [452f851] - Updated dependencies [2b4ed26] - Updated dependencies [8228013] - Updated dependencies [7bb89c2] - @ui-sdk/[email protected]