Examples
CodeBlock Component Demo
Examples of using the custom CodeBlock component
CodeBlock Component Examples
Basic Usage
hello.js
1 lines • 2 words1
console.log('Hello, World!');
With Badges
Button.tsx
1 2 3 4 5 6 7 8 9
import React from 'react'; export function Button({ children, onClick }) { return ( <button onClick={onClick} className="btn"> {children} </button> ); }
Shell Commands
package-scripts
1 2 3 4 5 6 7 8
# Install dependencies npm install # Start development server npm run dev # Build for production npm run build
Python Example
fibonacci.py
1 2 3 4 5 6 7 8
def fibonacci(n): if n <= 1: return n return fibonacci(n-1) + fibonacci(n-2) # Generate first 10 fibonacci numbers for i in range(10): print(f"F({i}) = {fibonacci(i)}")
Recursive file & folder creation
Allow writing touch & mkdir which allows to create recursive with auto folder creation and runs chmod +x on the created file by default
Suspense Wrapper Guide for SSR and Client UX
Learn how to create, use, and master Suspense Wrappers for SSR-heavy apps in Next.js 14+ with real-world examples, best practices, and common pitfalls.