by vercel-labs
A library of behaviors for agents to build and drive the next generation of user interfaces.
# Add to your Claude Code skills
git clone https://github.com/vercel-labs/uiui is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by vercel-labs. A library of behaviors for agents to build and drive the next generation of user interfaces. It has 8,233 GitHub stars.
ui's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/vercel-labs/ui" and add it to your Claude Code skills directory (see the Installation section above).
ui is primarily written in TypeScript. It is open-source under vercel-labs on GitHub, so you can review or fork the full source.
Yes. AgentsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh ui against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
A library of behaviors for agents to build and drive 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, Web Components and Angular.
UI SDK is in beta. Install core and the adapter for your framework:
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, @ui-sdk/web or @ui-sdk/angular.
Then give your agent the UI SDK skill:
npx skills@latest add vercel-labs/ui --skill ui-sdk
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.
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 every one.
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 (
<SearchField>
<SearchFieldInput placeholder="Search" />
<SearchFieldClear>Clear</SearchFieldClear>
</SearchField>
)
}
export { Search }
<script setup lang="ts">
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
</script>
<template>
<SearchField>
<SearchFieldInput placeholder="Search" />
<SearchFieldClear>Clear</SearchFieldClear>
</SearchField>
</template>
<script lang="ts">
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
</script>
<SearchField>
<SearchFieldInput placeholder="Search" />
<SearchFieldClear>Clear</SearchFieldClear>
</SearchField>
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.Input
const SearchFieldClear = parts.Clear
function Search() {
return (
<SearchField>
<SearchFieldInput placeholder="Search" />
<SearchFieldClear>Clear</SearchFieldClear>
</SearchField>
)
}
export { Search }
Register a custom element for each part:
import { createParts, wrappedButton, wrappedChild } from "@ui-sdk/web"
import { searchField } from "./search-field"
createParts(searchField, {
root: "search-field",
input: { tag: "search-field-input", target: wrappedChild("input") },
clear: { tag: "search-field-clear", target: wrappedButton },
})
Then use them in your HTML:
<search-field>
<search-field-input><input placeholder="Search" /></search-field-input>
<search-field-clear><button>Clear</button></search-field-clear>
</search-field>
Write a directive for each part:
import { Directive, inject } from "@angular/core"
import { usePart, usePrimitive } from "@ui-sdk/angular/primitive"
import { searchField } from "./search-field"
@Directive({ selector: "[appSearchField]" })
export class SearchField {
readonly handle = usePrimitive(searchField, () => ({}))
}
@Directive({ selector: "[appSearchFieldInput]" })
export class SearchFieldInput {
constructor() {
usePart(inject(SearchField).handle, "input")
}
}
@Directive({ selector: "[appSearchFieldClear]" })
export class SearchFieldClear {
constructor() {
usePart(inject(SearchField).handle, "clear")
}
}
Then put them on your own elements:
<ng-container appSearchField>
<input appSearchFieldInput placeholder="Search" />
<button *appSearchFieldClear>Clear</button>
</ng-container>
Contributions are welcome. See CONTRIBUTING.md to get the repo running locally and land a change, and use issues to report bugs. By participating, you agree to our Code of Conduct.
Please do not open public issues for security vulnerabilities. Instead, follow SECURITY.md and report responsibly to [email protected].
UI SDK is currently in beta and subject to the Vercel beta terms; the framework, APIs, documentation, and behavior may change before general availability.