Skip to content
agentskit.js

Message

Renders one message — user, assistant, tool, or system. Streaming-aware, role-aware.

Headless single-message renderer. Role in data-ak-role. Streaming state in data-ak-streaming. Content chunks (text, tool-call, tool-result, image, file) each emit a data-ak-part wrapper.

#React props

PropTypeDefault
messageMessage
avatarReactNode
actionsReactNode
avatar and actions are React slots. Message parts are exposed by the core
message shape but this component currently renders the message text; it does
not expose a renderPart prop.

#Message shape

import type { ContentPart } from '@agentskit/core'

type Message = {
  id: string
  role: 'user' | 'assistant' | 'tool' | 'system'
  content: string
  status: 'pending' | 'streaming' | 'complete' | 'error'
  createdAt: Date
  parts?: ContentPart[]
}

#Per-framework

FrameworkImport
Reactimport { Message } from '@agentskit/react'
Vueimport { Message } from '@agentskit/vue'
Svelteimport { Message } from '@agentskit/svelte'
Solidimport { Message } from '@agentskit/solid'
React Nativeimport { Message } from '@agentskit/react-native'
Angular<ak-message [message]="msg">
Inkimport { Message } from '@agentskit/ink'

Explore nearby

Ask the docs
Ask anything about AgentsKit. Answers come from the docs corpus and cite their sources.