ProUnlock everything for $49.99 a year, or $79.99 once. See plans ›

Nexus UI

Code Snippet, animated React component

A code block for developer pages. A macOS-style header with the language in quiet monospace (click it to switch) and a small Copy button that morphs into a tick. Real token-level highlighting for JS, TS, Python, Bash and JSON with no highlighter library, dark and light themes, optional line numbers, and lines that roll in one after another.

  • Pro
  • Cards
  • Spring

Play with it

Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.

const fetchUser = async (id) ⇒ {
try {
const res = await fetch(`/api/users/${id}`);
if (!res.ok) throw new Error("Not found");
return await res.json();
} catch (error) {
console.error("Request failed:", error);
return null;
}
};
fetchUser(42).then((user) ⇒ console.log(user.name));

Props

PropTypeDefaultWhat it does
initial"js"Language shown first.
theme"dark"Colour theme of the block.
lineNumberstrueShows line numbers.
controlstrueShows the chip row for language, theme and line numbers under the block.
autoplayfalseTours the languages every few seconds until someone touches it. Pauses off screen.
className—Extra classes for the wrapper.