Skip to content

Button

Gen UI 2.0 standard

Sends its onClick event; with href it opens the URL, with copy it copies the text. Variant "primary" for the one main Button in a Row. submit true submits the Form around it. Its children render instead of the label. With checks it is disabled while a check fails.

One of the 69 components in CopilotKit's standardUI. The playground's catalog extends it, so every agent here can use Button. Standard catalog docs

Props

Read from standardUI.manifestComponents in the installed @copilotkit/react-core. In A2UI 1.0 any value may also be a { "@path" } binding into the surface data model or a { "@call" } function call.

PropTypeRequiredDescription
labelstringNoThe button text
onClickAction (event or functionCall)NoSent when the user clicks the button.
checks{ condition?, message? }[]NoValidation rules. The control shows the first failed one
textstringNoSame as label. Used when label is not set
variant"default" | "primary" | "soft" | "borderless"NoDefault "default": outlined. "primary" is filled, for the one main action. "borderless" has no box, like a link
blockbooleanNoFull width
disabledbooleanNo-
loadingbooleanNo-
submitbooleanNoSubmits the Form around it. The Form sends its onSubmit event
iconstringNoLucide icon name
uniformbooleanNoA square button, for an icon
hrefstringNoOpens this URL in a new tab on click, instead of onClick
copystringNoCopies this text to the clipboard on click and shows a check mark, instead of onClick
childcomponent idNoId of one child component.
childrenstring[] | { componentId, path }NoIds of child components, or a template { componentId, path } over a data list.
color"primary" | "secondary" | "danger"NoDefault "primary"
size"sm" | "md" | "lg"NoDefault "lg"
weightnumberNoflex-grow in a Row or Column
pillbooleanNoDefault true