Syed Hasnain

Code Block

AI chats 15

About

A muted code surface with line numbers, focused rows, filename metadata, and copy feedback.

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 Demo() {
  return (
    <CodeBlock
      className="w-full max-w-lg"
      code={`export function AgentStatus({ active }: Props) {
  return (
    <span data-active={active}>
      {active ? "Working" : "Ready"}
    </span>
  )
}`}
      filename="agent-status.tsx"
      highlightLines={[3, 4]}
      language="tsx"
    />
  )
}

Dependencies

More by Syed Hasnain

View all
  • Color Picker

    Color Picker

    153
  • Cost Meter

    Cost Meter

    41
  • Background Inbox

    Background Inbox

    35
  • Message Scroller

    Message Scroller

    32
  • Attachments

    Attachments

    30
  • Video Player

    Video Player

    26
  • Quota Banner

    Quota Banner

    26
  • Commit

    Commit

    26

More in AI chats

View all
  • AI Actions

    AI Actions

    335
  • Message With Header And Delivery Status

    Message With Header And Delivery Status

    47
  • System Message

    System Message

    70
  • AI Task List

    AI Task List

    179
  • Message Thread

    Message Thread

    54
  • Illos Knowledge Sources

    Illos Knowledge Sources

    23
  • AI Prompt Composer with Model Selector

    AI Prompt Composer with Model Selector

    120
  • Memory Scope

    Memory Scope

    3

Explore more

Part of Pasta UI — browse the full library on 21st.dev.