CodeBlock
Syntax-highlighted code with a language label and one-click copy — the single shared code surface: every code example on this site renders through it (also used internally by Response).
npx @slipstream-ui/cli@latest add code-blockCopy feedback
ts
import { Conversation } from '@slipstream-ui/ai';export function Chat() {return <Conversation messages={messages} />;}
Last copied at: —
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| code | string | — | Raw code to display. |
| language | string | 'tsx' | Prism language identifier. |
| showCopyButton | boolean | true | Show/hide the copy control. |
Accessibility
- Copy button carries an aria-label that flips to "Copied".
- Language label is plain text; code remains selectable.
Browser support
| Browser | Tested versions |
|---|---|
| Chrome | 111+ (Mar 2023) |
| Edge | 111+ (Mar 2023) |
| Firefox | 121+ (Dec 2023) |
| Safari | 17.2+ — macOS & iOS (Dec 2023) |
Slipstream components rely only on CSS custom properties, Flexbox/Grid, and ARIA — the everyday baseline of the last two years of evergreen releases. Anything newer is progressive enhancement: unsupported browsers keep full functionality with static behavior instead of animations.