Julien Thibeaut

Code Block

Component 22

About

A component for displaying code snippets with syntax highlighting and customizable styling.

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

"use client"

import { CodeBlock, CodeBlockCode } from "@/components/ui/code-block"

export function CodeBlockBasic() {
  const code = `function greet(name) {
  return \`Hello, \${name}!\`;
}

// Call the function
greet("World");`

  return (
    <div className="w-full max-w-[400px]">
      <CodeBlock>
        <CodeBlockCode code={code} language="javascript" />
      </CodeBlock>
    </div>
  )
}

Dependencies

More by Julien Thibeaut

View all
  • Dock

    Dock

    3.1K
  • Text Effect

    Text Effect

    1.6K
  • Infinite Slider

    Infinite Slider

    1.5K
  • Text Shimmer

    Text Shimmer

    1.3K
  • Text Scramble

    Text Scramble

    1.1K
  • Progressive blur

    Progressive blur

    683
  • Glow Effect

    Glow Effect

    610
  • Tailwind CSS Background Snippet

    Tailwind CSS Background Snippet

    536