Code where it usually lives: a tutorial, a product page, a code review, configuration files, a snippet library and more. Copy, download, expand and wrap it, and compare the themes.
21 code blocks on one page, in all 13 languages. Brand names, code and copy are placeholders. Every block is the same component with different settings.
A tutorial in a blog post
Theme Auto, the default · File names · Line numbers and Highlight lines 8-13 in the CSS · Collapsed lines 10 and Download in the JavaScript.
Tutorial
Add a dark mode switch in three small files
By Lorem Ipsum · 6 min read
Lorem ipsum dolor sit amet, consectetur adipiscing elit. A button in the header, two palettes in CSS custom properties and a few lines of JavaScript that remember what the visitor chose.
1. The button
Put the button in your header. Its pressed state tells screen readers whether dark mode is on. Integer posuere erat a ante venenatis dapibus.
Copy codeCopied.Code selected. Copy it with Ctrl+C, Command+C or your device's Copy command.Expand codeCollapse codeEnable line wrappingDisable line wrappingCode sampleDownload codeDownload failed. Copy the code instead.Plain textHighlighted linesLine annotations are unavailable for more than 5,000 lines. The complete code is still available.Added linesRemoved linesPrepare code for EtchThe builder prepares pasted code automatically. Use this converter only when it did not: paste the original code below, copy the prepared result into Code, then turn off Manual converter and save. Always paste the original, not a previously prepared result.1. Original code2. Prepared code for the Code fieldCopy prepared codeCopied. Paste into the Code field in Etch.Result selected. Press Ctrl+C or Command+C to copy it manually.
2. Two palettes
Light colors are the default. The highlighted lines switch them as soon as the page carries the dark theme attribute. Donec ullamcorper nulla non metus auctor fringilla.
Copy codeCopied.Code selected. Copy it with Ctrl+C, Command+C or your device's Copy command.Expand codeCollapse codeEnable line wrappingDisable line wrappingCode sampleDownload codeDownload failed. Copy the code instead.Plain textHighlighted linesLine annotations are unavailable for more than 5,000 lines. The complete code is still available.Added linesRemoved linesPrepare code for EtchThe builder prepares pasted code automatically. Use this converter only when it did not: paste the original code below, copy the prepared result into Code, then turn off Manual converter and save. Always paste the original, not a previously prepared result.1. Original code2. Prepared code for the Code fieldCopy prepared codeCopied. Paste into the Code field in Etch.Result selected. Press Ctrl+C or Command+C to copy it manually.
3. Remember the choice
The script reads the saved choice, falls back to the system setting and updates the button. It is longer than the preview, so the block starts collapsed: expand it, or copy and download the whole file.
Copy codeCopied.Code selected. Copy it with Ctrl+C, Command+C or your device's Copy command.Expand codeCollapse codeEnable line wrappingDisable line wrappingCode sampleDownload codeDownload failed. Copy the code instead.Plain textHighlighted linesLine annotations are unavailable for more than 5,000 lines. The complete code is still available.Added linesRemoved linesPrepare code for EtchThe builder prepares pasted code automatically. Use this converter only when it did not: paste the original code below, copy the prepared result into Code, then turn off Manual converter and save. Always paste the original, not a previously prepared result.1. Original code2. Prepared code for the Code fieldCopy prepared codeCopied. Paste into the Code field in Etch.Result selected. Press Ctrl+C or Command+C to copy it manually.
That’s it. Cras mattis consectetur purus sit amet fermentum: whatever readers copy is the complete original file, never just the visible preview.
A product page with a dark hero
Theme Dark · Icons toolbar: hover or focus a button to see its label · The one-line install command hides the language badge and the wrap button and uses Text size Small.
Lorem Events API
Send your first event in five lines
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Install the package, add your key and track what matters: no dashboards to configure first.
Free for 10,000 events a month. Maecenas faucibus mollis interdum.
Installbash
npm install @lorem/events
Copy codeCopied.Code selected. Copy it with Ctrl+C, Command+C or your device's Copy command.Expand codeCollapse codeEnable line wrappingDisable line wrappingCode sampleDownload codeDownload failed. Copy the code instead.Plain textHighlighted linesLine annotations are unavailable for more than 5,000 lines. The complete code is still available.Added linesRemoved linesPrepare code for EtchThe builder prepares pasted code automatically. Use this converter only when it did not: paste the original code below, copy the prepared result into Code, then turn off Manual converter and save. Always paste the original, not a previously prepared result.1. Original code2. Prepared code for the Code fieldCopy prepared codeCopied. Paste into the Code field in Etch.Result selected. Press Ctrl+C or Command+C to copy it manually.
Quick starttrack.jsjavascript
import { Events } from '@lorem/events';
const events = new Events(process.env.LOREM_KEY);
await events.send('signup', { plan: 'pro' });
Copy codeCopied.Code selected. Copy it with Ctrl+C, Command+C or your device's Copy command.Expand codeCollapse codeEnable line wrappingDisable line wrappingCode sampleDownload codeDownload failed. Copy the code instead.Plain textHighlighted linesLine annotations are unavailable for more than 5,000 lines. The complete code is still available.Added linesRemoved linesPrepare code for EtchThe builder prepares pasted code automatically. Use this converter only when it did not: paste the original code below, copy the prepared result into Code, then turn off Manual converter and save. Always paste the original, not a previously prepared result.1. Original code2. Prepared code for the Code fieldCopy prepared codeCopied. Paste into the Code field in Etch.Result selected. Press Ctrl+C or Command+C to copy it manually.
Code review
First line number 41 · Removed lines 44 · Added lines 45-46 · Caption below the code.
Copy codeCopied.Code selected. Copy it with Ctrl+C, Command+C or your device's Copy command.Expand codeCollapse codeEnable line wrappingDisable line wrappingCode sampleDownload codeDownload failed. Copy the code instead.Plain textHighlighted linesLine annotations are unavailable for more than 5,000 lines. The complete code is still available.Added linesRemoved linesPrepare code for EtchThe builder prepares pasted code automatically. Use this converter only when it did not: paste the original code below, copy the prepared result into Code, then turn off Manual converter and save. Always paste the original, not a previously prepared result.1. Original code2. Prepared code for the Code fieldCopy prepared codeCopied. Paste into the Code field in Etch.Result selected. Press Ctrl+C or Command+C to copy it manually.
Lines 41–51 of inc/shipping.php: the fixed limit of 100 becomes a filter.
A patch file
Language Diff colors the − and + lines and the hunk header · Download saves fix-shipping-threshold.diff · Theme Light.
Copy codeCopied.Code selected. Copy it with Ctrl+C, Command+C or your device's Copy command.Expand codeCollapse codeEnable line wrappingDisable line wrappingCode sampleDownload codeDownload failed. Copy the code instead.Plain textHighlighted linesLine annotations are unavailable for more than 5,000 lines. The complete code is still available.Added linesRemoved linesPrepare code for EtchThe builder prepares pasted code automatically. Use this converter only when it did not: paste the original code below, copy the prepared result into Code, then turn off Manual converter and save. Always paste the original, not a previously prepared result.1. Original code2. Prepared code for the Code fieldCopy prepared codeCopied. Paste into the Code field in Etch.Result selected. Press Ctrl+C or Command+C to copy it manually.
Configuration files
Icons toolbar on all three · YAML with a long file name · JSON indented with tabs at Tab size 2, collapsed after 8 lines · Plain text with Download.
Deploy workflow
A GitHub Actions workflow. Its secret placeholder is shown exactly as written.
Copy codeCopied.Code selected. Copy it with Ctrl+C, Command+C or your device's Copy command.Expand codeCollapse codeEnable line wrappingDisable line wrappingCode sampleDownload codeDownload failed. Copy the code instead.Plain textHighlighted linesLine annotations are unavailable for more than 5,000 lines. The complete code is still available.Added linesRemoved linesPrepare code for EtchThe builder prepares pasted code automatically. Use this converter only when it did not: paste the original code below, copy the prepared result into Code, then turn off Manual converter and save. Always paste the original, not a previously prepared result.1. Original code2. Prepared code for the Code fieldCopy prepared codeCopied. Paste into the Code field in Etch.Result selected. Press Ctrl+C or Command+C to copy it manually.
Block theme settings
Indented with tabs and shown at Tab size 2. Collapsed after 8 lines.
Copy codeCopied.Code selected. Copy it with Ctrl+C, Command+C or your device's Copy command.Expand codeCollapse codeEnable line wrappingDisable line wrappingCode sampleDownload codeDownload failed. Copy the code instead.Plain textHighlighted linesLine annotations are unavailable for more than 5,000 lines. The complete code is still available.Added linesRemoved linesPrepare code for EtchThe builder prepares pasted code automatically. Use this converter only when it did not: paste the original code below, copy the prepared result into Code, then turn off Manual converter and save. Always paste the original, not a previously prepared result.1. Original code2. Prepared code for the Code fieldCopy prepared codeCopied. Paste into the Code field in Etch.Result selected. Press Ctrl+C or Command+C to copy it manually.
Environment
Plain text with Download, so the file arrives ready to rename.
Copy codeCopied.Code selected. Copy it with Ctrl+C, Command+C or your device's Copy command.Expand codeCollapse codeEnable line wrappingDisable line wrappingCode sampleDownload codeDownload failed. Copy the code instead.Plain textHighlighted linesLine annotations are unavailable for more than 5,000 lines. The complete code is still available.Added linesRemoved linesPrepare code for EtchThe builder prepares pasted code automatically. Use this converter only when it did not: paste the original code below, copy the prepared result into Code, then turn off Manual converter and save. Always paste the original, not a previously prepared result.1. Original code2. Prepared code for the Code fieldCopy prepared codeCopied. Paste into the Code field in Etch.Result selected. Press Ctrl+C or Command+C to copy it manually.
A database report
Language SQL · Icons toolbar · Line numbers · Wrap lines on: the long WHERE line wraps under one number, and the reader can turn wrapping off.
Monthly revenue by plansql
SELECT
DATE_TRUNC('month', o.created_at) AS month,
p.name AS plan,
COUNT(*) AS orders,
SUM(o.total) AS revenue
FROM orders AS o
JOIN plans AS p ON p.id = o.plan_id
WHERE o.status = 'paid' AND o.created_at >= DATE '2026-01-01' -- this year only; refunded orders drop out through the status filter
GROUP BY month, plan
ORDER BY month, revenue DESC;
Copy codeCopied.Code selected. Copy it with Ctrl+C, Command+C or your device's Copy command.Expand codeCollapse codeEnable line wrappingDisable line wrappingCode sampleDownload codeDownload failed. Copy the code instead.Plain textHighlighted linesLine annotations are unavailable for more than 5,000 lines. The complete code is still available.Added linesRemoved linesPrepare code for EtchThe builder prepares pasted code automatically. Use this converter only when it did not: paste the original code below, copy the prepared result into Code, then turn off Manual converter and save. Always paste the original, not a previously prepared result.1. Original code2. Prepared code for the Code fieldCopy prepared codeCopied. Paste into the Code field in Etch.Result selected. Press Ctrl+C or Command+C to copy it manually.
A README
Language Markdown · Icons toolbar · File name README.md · Caption below the code.
README.mdmarkdown
# Lorem Starter
A small starter theme for **Etch** sites. Lorem ipsum dolor sit amet.
## Install
1. Download the [latest release](https://lorem.example/releases).
2. Upload it in *Appearance → Themes*.
3. Run `npm install` in the theme folder.
> Tip: keep your own changes in a child theme.
Copy codeCopied.Code selected. Copy it with Ctrl+C, Command+C or your device's Copy command.Expand codeCollapse codeEnable line wrappingDisable line wrappingCode sampleDownload codeDownload failed. Copy the code instead.Plain textHighlighted linesLine annotations are unavailable for more than 5,000 lines. The complete code is still available.Added linesRemoved linesPrepare code for EtchThe builder prepares pasted code automatically. Use this converter only when it did not: paste the original code below, copy the prepared result into Code, then turn off Manual converter and save. Always paste the original, not a previously prepared result.1. Original code2. Prepared code for the Code fieldCopy prepared codeCopied. Paste into the Code field in Etch.Result selected. Press Ctrl+C or Command+C to copy it manually.
Markdown is colored too: headings, emphasis, lists, links, quotes and inline code.
A snippet library from a loop
Four snippets, one block: Code, Language and File name come from a JSON loop. A dynamic binding that is the whole value needs no preparation, so this works the same with an ACF field or a custom field.
Fluid type mixin
SCSS: one mixin for type that scales between two sizes.
Copy codeCopied.Code selected. Copy it with Ctrl+C, Command+C or your device's Copy command.Expand codeCollapse codeEnable line wrappingDisable line wrappingCode sampleDownload codeDownload failed. Copy the code instead.Plain textHighlighted linesLine annotations are unavailable for more than 5,000 lines. The complete code is still available.Added linesRemoved linesPrepare code for EtchThe builder prepares pasted code automatically. Use this converter only when it did not: paste the original code below, copy the prepared result into Code, then turn off Manual converter and save. Always paste the original, not a previously prepared result.1. Original code2. Prepared code for the Code fieldCopy prepared codeCopied. Paste into the Code field in Etch.Result selected. Press Ctrl+C or Command+C to copy it manually.
Debounce helper
TypeScript: wait until the input settles before reacting.
Copy codeCopied.Code selected. Copy it with Ctrl+C, Command+C or your device's Copy command.Expand codeCollapse codeEnable line wrappingDisable line wrappingCode sampleDownload codeDownload failed. Copy the code instead.Plain textHighlighted linesLine annotations are unavailable for more than 5,000 lines. The complete code is still available.Added linesRemoved linesPrepare code for EtchThe builder prepares pasted code automatically. Use this converter only when it did not: paste the original code below, copy the prepared result into Code, then turn off Manual converter and save. Always paste the original, not a previously prepared result.1. Original code2. Prepared code for the Code fieldCopy prepared codeCopied. Paste into the Code field in Etch.Result selected. Press Ctrl+C or Command+C to copy it manually.
Body class for covers
PHP: mark posts with a featured image for your CSS.
Copy codeCopied.Code selected. Copy it with Ctrl+C, Command+C or your device's Copy command.Expand codeCollapse codeEnable line wrappingDisable line wrappingCode sampleDownload codeDownload failed. Copy the code instead.Plain textHighlighted linesLine annotations are unavailable for more than 5,000 lines. The complete code is still available.Added linesRemoved linesPrepare code for EtchThe builder prepares pasted code automatically. Use this converter only when it did not: paste the original code below, copy the prepared result into Code, then turn off Manual converter and save. Always paste the original, not a previously prepared result.1. Original code2. Prepared code for the Code fieldCopy prepared codeCopied. Paste into the Code field in Etch.Result selected. Press Ctrl+C or Command+C to copy it manually.
Nightly database backup
Bash: export the WordPress database with WP-CLI and compress it.
db-export.shbash
#!/usr/bin/env bash
set -euo pipefail
stamp=$(date +%F)
wp db export "backups/db-${stamp}.sql" --add-drop-table
gzip -9 "backups/db-${stamp}.sql"
echo "Saved backups/db-${stamp}.sql.gz"
Copy codeCopied.Code selected. Copy it with Ctrl+C, Command+C or your device's Copy command.Expand codeCollapse codeEnable line wrappingDisable line wrappingCode sampleDownload codeDownload failed. Copy the code instead.Plain textHighlighted linesLine annotations are unavailable for more than 5,000 lines. The complete code is still available.Added linesRemoved linesPrepare code for EtchThe builder prepares pasted code automatically. Use this converter only when it did not: paste the original code below, copy the prepared result into Code, then turn off Manual converter and save. Always paste the original, not a previously prepared result.1. Original code2. Prepared code for the Code fieldCopy prepared codeCopied. Paste into the Code field in Etch.Result selected. Press Ctrl+C or Command+C to copy it manually.
Themes
Icons toolbar · Light and Dark are fixed. Site follows the color scheme of its section. Auto, the default, follows the visitor’s system setting: switch your system to dark mode and the tutorial above turns dark.
Light
A fixed light palette, whatever the visitor’s system uses.
Copy codeCopied.Code selected. Copy it with Ctrl+C, Command+C or your device's Copy command.Expand codeCollapse codeEnable line wrappingDisable line wrappingCode sampleDownload codeDownload failed. Copy the code instead.Plain textHighlighted linesLine annotations are unavailable for more than 5,000 lines. The complete code is still available.Added linesRemoved linesPrepare code for EtchThe builder prepares pasted code automatically. Use this converter only when it did not: paste the original code below, copy the prepared result into Code, then turn off Manual converter and save. Always paste the original, not a previously prepared result.1. Original code2. Prepared code for the Code fieldCopy prepared codeCopied. Paste into the Code field in Etch.Result selected. Press Ctrl+C or Command+C to copy it manually.
Copy codeCopied.Code selected. Copy it with Ctrl+C, Command+C or your device's Copy command.Expand codeCollapse codeEnable line wrappingDisable line wrappingCode sampleDownload codeDownload failed. Copy the code instead.Plain textHighlighted linesLine annotations are unavailable for more than 5,000 lines. The complete code is still available.Added linesRemoved linesPrepare code for EtchThe builder prepares pasted code automatically. Use this converter only when it did not: paste the original code below, copy the prepared result into Code, then turn off Manual converter and save. Always paste the original, not a previously prepared result.1. Original code2. Prepared code for the Code fieldCopy prepared codeCopied. Paste into the Code field in Etch.Result selected. Press Ctrl+C or Command+C to copy it manually.
Site
Follows the color scheme of the section around it. This dark box declares a dark color scheme, as an ACSS dark section does.
Copy codeCopied.Code selected. Copy it with Ctrl+C, Command+C or your device's Copy command.Expand codeCollapse codeEnable line wrappingDisable line wrappingCode sampleDownload codeDownload failed. Copy the code instead.Plain textHighlighted linesLine annotations are unavailable for more than 5,000 lines. The complete code is still available.Added linesRemoved linesPrepare code for EtchThe builder prepares pasted code automatically. Use this converter only when it did not: paste the original code below, copy the prepared result into Code, then turn off Manual converter and save. Always paste the original, not a previously prepared result.1. Original code2. Prepared code for the Code fieldCopy prepared codeCopied. Paste into the Code field in Etch.Result selected. Press Ctrl+C or Command+C to copy it manually.
Your own look
Eight styling variables on a parent class: square corners, a 2 px border, a hard shadow, a tinted toolbar and a bolder title, here with the Icons toolbar. The code is this example’s own CSS.
Copy codeCopied.Code selected. Copy it with Ctrl+C, Command+C or your device's Copy command.Expand codeCollapse codeEnable line wrappingDisable line wrappingCode sampleDownload codeDownload failed. Copy the code instead.Plain textHighlighted linesLine annotations are unavailable for more than 5,000 lines. The complete code is still available.Added linesRemoved linesPrepare code for EtchThe builder prepares pasted code automatically. Use this converter only when it did not: paste the original code below, copy the prepared result into Code, then turn off Manual converter and save. Always paste the original, not a previously prepared result.1. Original code2. Prepared code for the Code fieldCopy prepared codeCopied. Paste into the Code field in Etch.Result selected. Press Ctrl+C or Command+C to copy it manually.
Polish interface
All 22 interface labels in Polish, set in the Interface labels group: Kopiuj kod, Pobierz kod, Rozwiń kod. Highlight lines 3 · Collapsed lines 5.
Licznik słówlicznik-slow.jsjavascript
// Policz słowa w tekście
export function countWords(text) {
const words = text.trim().split(/\s+/);
return words.filter(Boolean).length;
}
console.log(countWords('Ala ma kota')); // 3
Kopiuj kodSkopiowano.Kod zaznaczony. Skopiuj go skrótem Ctrl+C, Command+C lub poleceniem Kopiuj na urządzeniu.Rozwiń kodZwiń kodWłącz zawijanie wierszyWyłącz zawijanie wierszyPrzykład koduPobierz kodPobieranie nie powiodło się. Skopiuj kod.Zwykły tekstWyróżnione linieNumeracja i wyróżnienia są niedostępne powyżej 5000 linii. Pełny kod pozostaje dostępny.Dodane linieUsunięte liniePrzygotuj kod do EtchWklej oryginał, skopiuj wynik do pola Code i wyłącz konwerter.1. Oryginalny kod2. Wynik do pola CodeKopiuj przygotowany kodSkopiowano. Wklej do pola Code w Etch.Wynik zaznaczony. Skopiuj skrótem Ctrl+C lub Command+C.