Syntax-highlighted code with a language label and one-click copy. Used internally by Response and available standalone.

npx slipstream-ui@latest add code-block
Copy feedback
ts
import { Conversation } from '@slipstream-ui/ai';
export function Chat() {
return <Conversation messages={messages} />;
}
Last copied at: —

Props

PropTypeDefaultDescription
codestring—Raw code to display.
languagestring'tsx'Prism language identifier.
showCopyButtonbooleantrueShow/hide the copy control.

Accessibility

  • Copy button carries an aria-label that flips to "Copied".
  • Language label is plain text; code remains selectable.