Standard catalog

Use the 69 standard components, drop the ones you do not want, and replace any of them with your own.

What is this?

You want the agent to answer with tables, charts, and forms today, not after you build a component library. standardUI is a catalog of 69 ready-made components that the agent already knows how to use. The 18 components of the A2UI 1.0 basic catalog are in it under their A2UI names and props (Image.url, CheckBox.value, Row.justify: "spaceBetween", weight for flex-grow); the rest extend the catalog.

React Native

The standard components render DOM, so React Native has no standardUI yet. Build a catalog of your own native components with createGenerativeUI; see Catalogs and Generative UI with your own components.

Use it as it is:

import { standardUI } from "@copilotkit/react-core/v2/generative-ui";

<CopilotKitProvider runtimeUrl="/api/copilotkit" generativeUI={{ ui: standardUI }}>

What is in it

A few things to know:

  • Inputs keep what users type. When the agent binds an input to a value, what the user types stays. A later agent update cannot write over it.
  • Button and Pressable can act in the browser. href opens a URL, and Button with copy copies text, with no message to the agent.
  • Map needs one package. Run npm install maplibre-gl if your agent draws maps. Without it, the map shows a list of the places. In Angular, also add provideGenerativeUIMap() from @copilotkit/angular/generative-ui/map to the root providers. In Vue, also add app.use(GenerativeUIMap) from @copilotkit/vue/v2/generative-ui/map.
  • Chart needs no extra install in React. It uses recharts, which comes with CopilotKit. In Angular, Chart draws with chart.js and Icon with lucide: install them and add provideGenerativeUIChart() and provideGenerativeUIIcons() from the /chart and /icons entries of @copilotkit/angular/generative-ui. Without them, a chart shows its data as a table and an icon shows nothing. In Vue, Chart draws with chart.js: install it and add app.use(GenerativeUIChart) from @copilotkit/vue/v2/generative-ui/chart. Without it, a chart shows its data as a table. Icons work with no setup.

Component details:

  • Every input validates. checks holds the Checkable rules of A2UI 1.0: [{ "condition": { "@call": "email", "args": { "value": { "@path": "/form/email" } } }, "message": "Enter a valid email" }]. An input shows the first failed message once the user has been in it, and a Button with the same checks is disabled while one fails. A failed check gives an A2UI ValidationResult. The built-in validators set a code: required, pattern, tooShort, tooLong, notANumber, tooSmall, tooLarge, or email. A result with severity: "warning" or "info" (from a bound result or your own validator) shows its message in its own color. It does not make the input invalid or disable the Button.
  • Video takes any URL. A video file plays in the native player, with captions as WebVTT tracks; a YouTube link shows a poster until the user presses play, then loads the privacy-enhanced embed. A page on another video site (Vimeo, Loom, TikTok, …) and a file that fails to load show a link card instead of a dead player. YouTube is the only provider that embeds; to embed another one, replace the component.
  • Tabs takes a list of panels. tabs: [{ "title", "child" }], with the id of each panel.

Each standalone component has a dedicated page with the existing live examples, copyable surface operations, and API reference. Structural parts are documented on their parent component's page. Previews use local sample data and do not require a model connection.

For the positional order of each component in A2UI Express, see Positional parameter order.

Add your own components

Put your components on top of the standard ones with extends:

import { createGenerativeUI, standardUI } from "@copilotkit/react-core/v2/generative-ui";

export const appUI = createGenerativeUI({
  id: "acme/app@1",
  extends: [standardUI],
  components: {
    ProductCard: { component: ProductCard, props: productSchema },
  },
});

See Catalogs for how to declare a component.

Drop components

Every component makes the prompt a little longer. If your app never needs a map or a video, remove them. omit returns a copy of the catalog without them, and the agent does not see them:

export const appUI = createGenerativeUI({
  id: "acme/app@1",
  extends: [standardUI.omit(["Map", "Video", "HtmlView"])],
  components: {},
});

The names are typed, so a typo is a type error. Call omit once, at module level.

Replace a component

Your app has its own card, with your shadows and spacing. overrides swaps the component of a standard component. The agent sees the same component as before, with the same props:

import {
  createGenerativeUI,
  standardUI,
  type GenerativeUIComponentProps,
} from "@copilotkit/react-core/v2/generative-ui";

function MyCard({ children }: GenerativeUIComponentProps<typeof standardUI, "Card">) {
  return <div className="rounded-2xl border p-6 shadow-sm">{children}</div>;
}

export const appUI = createGenerativeUI({
  id: "acme/app@1",
  extends: [standardUI],
  overrides: { Card: { component: MyCard } },
  components: {},
});
  • Your component gets the props of the component it replaces. The types check this.
  • Only components of the catalogs in extends can be overridden. An unknown name is a type error.
  • You can combine both: extends: [standardUI.omit(["Map"])] with overrides: { Card: ... }.

Next: make the standard components match your brand with a theme.

How is this guide?