showcase/shell-docs/src/content/reference/react-native/components/CopilotMarkdown.mdx
CopilotMarkdown renders a Markdown string with sensible React Native styling, built on react-native-streamdown. It handles incomplete (streaming) Markdown gracefully, rendering incrementally as content arrives, which makes it ideal for assistant messages. Requires the react-native-streamdown peer dependency.
import { CopilotMarkdown, defaultMarkdownStyles } from "@copilotkit/react-native/components";
defaultMarkdownStylesThe default style map. Spread it to extend rather than replace the built-in styling:
import { CopilotMarkdown, defaultMarkdownStyles } from "@copilotkit/react-native/components";
const styles = {
...defaultMarkdownStyles,
h1: { fontSize: 28, fontWeight: "800" },
};
<CopilotMarkdown content="# Hello\nThis is **bold**." style={styles} />;
import { CopilotMarkdown } from "@copilotkit/react-native/components";
<CopilotMarkdown content="**Hello** from CopilotKit!" />;
AssistantMessage: renders its content through CopilotMarkdown