easeUI

Code Block

A code block with a label, a copy button, and light coloring for keywords, strings, comments and numbers, with no highlighter dependency.

greet.js
function greet(name) {
// Say hello, politely
const message = `Hello, ${name}!`;
return message;
}

Installation

$ bunx --bun shadcn add @easeui/code-block

API reference

PropTypeDefaultDescription
codestring--
label?stringcodeShown in the header, such as a language name or a filename. Default "code".
className?string--

Updated