Terminal Block

Stable

A stylized terminal window for displaying code snippets with a copy button.

Examples

Basic Usage

deploy.sh
#!/bin/bash
echo "Initializing secure connection..."
ssh -i ~/.ssh/id_rsa user@secure.server.com
echo "Connected successfully."
tsx
<TerminalBlock 
  title="deploy.sh" 
  code={`#!/bin/bash
echo "Initializing secure connection..."
ssh -i ~/.ssh/id_rsa user@secure.server.com
echo "Connected successfully."`} 
/>

API Reference

PropertyDescriptionTypeDefault
codeThe source code or command to display.string-
titleOptional filename or title in the header.string-
languageLanguage of the code (currently for semantics).string"bash"