Back to Copilotkit

Actions

showcase/shell-docs/src/content/reference/bot/components/Actions.mdx

1.60.11.3 KB
Original Source

Overview

Actions is the row container for interactive controls. Put Button and Select elements inside it. (Input is a block-level control — place it directly in the Message, not in an Actions row.)

Import

tsx
import { Actions } from "@copilotkit/bot-ui";

Props

<PropertyReference name="children" type="BotChildren"> The interactive controls in this row (`Button` / `Select`). </PropertyReference>

Usage

tsx
<Message>
  <Section>Ship **v1.4.2** to production?</Section>
  <Actions>
    <Button
      style="primary"
      onClick={async ({ thread }) => {
        await thread.post("🚀 Shipping!");
      }}
    >
      Ship it
    </Button>
    <Button
      onClick={async ({ thread }) => {
        await thread.post("Standing down.");
      }}
    >
      Cancel
    </Button>
  </Actions>
</Message>

On Slack

Renders as an actions block — at most 25 controls per row (SLACK_LIMITS.actionsElements).

  • Button — clickable button with inline onClick
  • Select — dropdown
  • Input — block-level text input (lives outside Actions)