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
| Group | Components |
|---|---|
| Layout | Box, Column, Row, Grid, GridItem, Card, Flow, FlowItem, Carousel, CarouselItem, CarouselMediaItem, Spacer, Divider, Tabs |
| Text | Title, Text, Caption, Label, Bold, Italic, Underline, Strikethrough, Badge, Blockquote, Code, Markdown, Math, ShimmerText, Link, Tooltip |
| Inputs | Button, Pressable, Form, TextField, TextArea, Select, CheckBox, Radio, RadioGroup, Slider, SegmentedControl, ChoicePicker, DateTimeInput |
| Data | Table, TableSection, TableRow, TableCell, List, ListItem, Chart, Map |
| Media | Image, Icon, Favicon, Svg, Video, AudioPlayer, HtmlView |
| Feedback and overlay | PulseIndicator, FlashcardFlip, Popover, PopoverTrigger, PopoverContent, Modal |
| Composites | LinkCard, Citation, FollowUp, EntityCard, ImageGrid |
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.
ButtonandPressablecan act in the browser.hrefopens a URL, andButtonwithcopycopies text, with no message to the agent.Mapneeds one package. Runnpm install maplibre-glif your agent draws maps. Without it, the map shows a list of the places. In Angular, also addprovideGenerativeUIMap()from@copilotkit/angular/generative-ui/mapto the root providers. In Vue, also addapp.use(GenerativeUIMap)from@copilotkit/vue/v2/generative-ui/map.Chartneeds no extra install in React. It usesrecharts, which comes with CopilotKit. In Angular,Chartdraws withchart.jsandIconwithlucide: install them and addprovideGenerativeUIChart()andprovideGenerativeUIIcons()from the/chartand/iconsentries of@copilotkit/angular/generative-ui. Without them, a chart shows its data as a table and an icon shows nothing. In Vue,Chartdraws withchart.js: install it and addapp.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.
checksholds theCheckablerules 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 aButtonwith the same checks is disabled while one fails. A failed check gives an A2UIValidationResult. The built-in validators set acode:required,pattern,tooShort,tooLong,notANumber,tooSmall,tooLarge, oremail. A result withseverity: "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 theButton. Videotakes any URL. A video file plays in the native player, withcaptionsas 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.Tabstakes 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
extendscan be overridden. An unknown name is a type error. - You can combine both:
extends: [standardUI.omit(["Map"])]withoverrides: { Card: ... }.
Next: make the standard components match your brand with a theme.
How is this guide?