agentskit.js

Markdown

Headless Markdown renderer. Streaming-aware. Style via data-ak-markdown.

Renders a string of Markdown content. When streaming is true the root element receives data-ak-streaming so you can animate incomplete text (e.g. a blinking cursor) without any inline styles.

The component is intentionally minimal β€” it renders the raw content string into a div. Wire a Markdown parser (e.g. react-markdown, marked) inside your own theme layer if you need HTML output.

#Props

PropTypeDefaultDescription
contentstringβ€”Markdown string to display
streamingbooleanfalseMarks the element as actively streaming

#Example

import { Markdown } from '@agentskit/react'

export function AssistantBubble({ part }) {
  return (
    <Markdown
      content={part.text}
      streaming={part.streaming}
    />
  )
}

#data-ak-markdown

The root div always carries data-ak-markdown. When streaming is true it also receives data-ak-streaming="true".

[data-ak-markdown] {
  line-height: 1.6;
  white-space: pre-wrap;
}

[data-ak-markdown][data-ak-streaming="true"]::after {
  content: 'β–‹';
  animation: blink 1s step-start infinite;
}

#Per-framework

FrameworkImport
Reactimport { Markdown } from '@agentskit/react'
Inkimport { Markdown } from '@agentskit/ink'

Explore nearby

✎ Edit this page on GitHubΒ·Found a problem? Open an issue β†’Β·How to contribute β†’

On this page