framecn

Glass Code Block

Component 3

About

A frosted-glass code editor window with syntax highlighting and a line-by-line stagger-reveal animation, useful as a premium code showcase on landing pages.

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

Code

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

Usage.tsx

import GlassCodeBlock from "@/components/ui/glass-code-block";

export default function GlassCodeBlockDemo() {
  const code = `import { motion } from "remotion";

// Generate a hero scene
export function Hero() {
  const frame = useCurrentFrame();
  const opacity = frame / 30;
  return <h1 style={{ opacity }}>Hello</h1>;
}`;

  return (
    <div className="w-full h-screen flex items-center justify-center bg-black">
      <GlassCodeBlock code={code} title="hero.tsx" />
    </div>
  );
}

Dependencies

More by framecn

View all
  • Blur Out Up

    Blur Out Up

    33
  • Shader Dithering

    Shader Dithering

    29
  • Zoom Through Transition

    Zoom Through Transition

    19
  • Top Down Letters

    Top Down Letters

    19
  • Strikethrough Replace

    Strikethrough Replace

    17
  • Format Morph

    Format Morph

    14
  • Mesh Gradient Background

    Mesh Gradient Background

    11
  • Terminal to Browser Deploy

    Terminal to Browser Deploy

    9