Code Block
Code Block component from @bungas/ui
Code Block component from @bungas/ui
The CodeBlock component from Bungas UI.
function greet(name: string) { console.log(`Hello, ${name}!`);}greet("World");function greet(name: string) { console.log(`Hello, ${name}!`);}greet("World");import { useState } from "react";export function Counter() { const [count, setCount] = useState(0); return ( <button onClick={() => setCount(count + 1)}> Count: {count} </button> );}import { useState } from "react";export function Counter() { const [count, setCount] = useState(0); return ( <button onClick={() => setCount(count + 1)}> Count: {count} </button> );}.container { display: flex; flex-direction: column; gap: 1rem; padding: 2rem;}.button { background: #3b82f6; color: white; padding: 0.5rem 1rem; border-radius: 0.25rem;}{ "name": "@bungas/ui", "version": "1.0.0", "dependencies": { "react": "^18.0.0", "tailwindcss": "^4.0.0" }}# Install dependenciesnpm install @bungas/ui# Build the projectnpm run build# Start development servernpm run devfunction greet(name: string) { console.log(`Hello, ${name}!`);}greet("World");npm install @bungas/uiimport { CodeBlock } from "@bungas/ui"import { CodeBlock } from "@bungas/ui"
export function Example() {
return <CodeBlock />
}function greet(name: string) { console.log(`Hello, ${name}!`);}greet("World");function greet(name: string) { console.log(`Hello, ${name}!`);}greet("World");import { useState } from "react";export function Counter() { const [count, setCount] = useState(0); return ( <button onClick={() => setCount(count + 1)}> Count: {count} </button> );}import { useState } from "react";export function Counter() { const [count, setCount] = useState(0); return ( <button onClick={() => setCount(count + 1)}> Count: {count} </button> );}.container { display: flex; flex-direction: column; gap: 1rem; padding: 2rem;}.button { background: #3b82f6; color: white; padding: 0.5rem 1rem; border-radius: 0.25rem;}{ "name": "@bungas/ui", "version": "1.0.0", "dependencies": { "react": "^18.0.0", "tailwindcss": "^4.0.0" }}# Install dependenciesnpm install @bungas/ui# Build the projectnpm run build# Start development servernpm run devfunction greet(name: string) { console.log(`Hello, ${name}!`);}greet("World");