theshanelevine

Code Block

AI chats 1

About

A code block that streams agent-written code line by line with syntax token colors, a filename header, and a live copy-to-clipboard button.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Code Block to your project and fits it to your theme.

Code

How Code Block is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import CodeBlock from "@/components/ui/code-block";

export default function Default() {
  return (
    <div className="flex min-h-[320px] w-full items-center justify-center bg-canvas p-8">
      <CodeBlock />
    </div>
  );
}

More by theshanelevine

View all
  • Loading State

    Loading State

    944
  • Streaming Text

    Streaming Text

    490
  • Thinking

    Thinking

    158
  • Records Table

    Records Table

    114
  • Approval Card

    Approval Card

    75
  • Chat Panel

    Chat Panel

    39
  • Recommendation Card

    Recommendation Card

    4
  • Filter Table

    Filter Table

    2

More in AI chats

View all
  • AI Actions

    AI Actions

    319
  • Color Picker

    Color Picker

    81
  • Agent Chat

    Agent Chat

    17
  • Prompt with Model Picker

    Prompt with Model Picker

    2
  • Message Thread

    Message Thread

    35
  • System Message

    System Message

    54
  • Suggestions

    Suggestions

    28
  • Message With Header And Delivery Status

    Message With Header And Delivery Status

    38