Home

/

Examples

/

Code example

Block

fa-solid fa-code

Code example

Displays code neatly formatted with colours, a title bar and a copy button — like every code example on this site.

Visit the live website
Code example

Displays a piece of code neatly formatted: with syntax colours, a title bar, a copy button and optionally line numbers or a collapsible mode. Every code example on this site — including the one below — uses this block. The technical name is Code.

Example

greeting.jsx
const greeting = 'Hello Obelisk'; console.log(greeting);

The prompt for this example

prompt
Put this piece of code on the page as a code block with line numbers and a copy button.