# webmcpui — full documentation > Framework-agnostic, WebMCP-native web components: accessible form controls an agent can fill and interaction primitives an agent can drive, with Standard Schema validation and design tokens. Each element is a good HTML control first and, when a WebMCP host is present, exposes itself as a tool an agent can call — additive and feature-detected. Source: https://webmcpui.com --- # Introduction URL: https://webmcpui.com/docs Agent-aware web components for the WebMCP era — framework-agnostic form and interaction primitives with Standard Schema validation. # Introduction **webmcpui** is a framework-agnostic, WebMCP-native web component library. Every element is a proper, accessible HTML control first and, when you opt in, also registers an imperative [WebMCP](/docs/webmcp) tool an agent can call. Three families of primitives: - **Form controls** expose a *value* an agent can set — ``, ``, ``, ``, `` / ``. Shared behavior (form association, validation, WebMCP exposure, theming) lives in a `WmcpFormControl` base. - **Interaction primitives** expose an *action* an agent can trigger — ``, ``, ``, ``, ``, ``, `` — or, for ``, a *reading* an agent can perceive. They share a `WmcpAction` / `WmcpExposable` base. - **Presentational primitives** are accessible, themed controls with no agent surface — ``, ``, ``, ``, ``. Building in React or Vue? [`@webmcpui/react`](/docs/frameworks) and [`@webmcpui/vue`](/docs/frameworks) wrap these elements with typed, idiomatic components — same behavior, framework-native ergonomics. ## Why it exists The same control a person operates by hand, an agent should be able to operate by calling a tool — fill a field, click a button, open a dialog, switch a tab, or read a notification. webmcpui's elements are good, accessible controls first; agent-exposure is additive and opt-in. It's all feature-detected: with no agent present (the common case today), the WebMCP layer is a complete no-op, so your controls are always good HTML. ## One source of truth, two channels Vanilla custom elements built with [Lit](https://lit.dev), distributed two ways: - an **ESM package** for build tools (`@webmcpui/core`), and - a single-file **CDN bundle** for no-build environments (Webflow, WordPress, plain HTML). ## Next steps - [Installation](/docs/installation) — add it to your project, with or without a build step. - [Validation](/docs/validation) — bring any Standard Schema validator. - [WebMCP exposure](/docs/webmcp) — how elements become agent tools. - [Testing](/docs/testing) — exercise exposure with the fake agent. --- # Installation URL: https://webmcpui.com/docs/installation Add webmcpui to your project with a build tool, or drop a single script tag — no build step required. # Installation Two distribution channels from one source of truth. Use the ESM package with your bundler, or the single-file CDN bundle for no-build environments. ## With a build tool ```bash pnpm add @webmcpui/core @webmcpui/tokens ``` ```ts import { defineComponents } from '@webmcpui/core'; import '@webmcpui/tokens/css'; // theme tokens (CSS custom properties) defineComponents(); // registers and the other elements ``` ```html ``` Importing the package does **not** register the elements — you call `defineComponents()` so you control timing. (The CDN bundle below registers automatically.) > In an SSR framework, call `defineComponents()` on the client only — custom elements need the DOM. In Nuxt, for example, do it from a `.client.ts` plugin. ## No build? Drop a script tag For Webflow, WordPress, or hand-written HTML — one tag, every `` element auto-registers: ```html ``` ## Frameworks Because these are standard custom elements, they work anywhere HTML renders. The only framework-specific note is telling the framework's template compiler not to treat `` as its own components: - **Vue / Nuxt** — set `compilerOptions.isCustomElement = (tag) => tag.startsWith('wmcp-')`. - **React** (19+) — custom elements and their props/attributes work directly. - **Svelte / SolidJS / Angular** — supported with each framework's standard custom-element handling. ## FAQ **Does webmcpui pull another UI framework into my bundle?** The components are built with [Lit 3](https://lit.dev), declared as a regular dependency of `@webmcpui/core`. Lit is a small runtime (~15 kB min+gzip), and if your app already uses Lit 3, npm dedupes the two down to a single copy. **Testing in jsdom or happy-dom?** See [testing environments](/docs/testing#environments) — component tests want a real browser. --- # Validation URL: https://webmcpui.com/docs/validation Bring any Standard Schema validator — Zod, Valibot, ArkType — and wire it straight into form validation. # Validation Every control accepts a [Standard Schema](https://standardschema.dev) validator on its `schema` property. Bring Zod, Valibot, ArkType, or anything that implements the spec — there's no bespoke schema language to learn. ```ts import { z } from 'zod'; const input = document.querySelector('wmcp-input')!; input.schema = z.string().email('Enter a valid email'); ``` Validation runs on input and during native form validation. On failure the element: - sets `aria-invalid="true"` on the native control inside its shadow root (the actual `` / `