Skip to content

Code

Free

Shows a command, a file name, or a prop inside a sentence. The chip takes the size of the text around it, and it can color the code.

  • React 19
  • Tailwind CSS 4

Added Nov 8, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Put the code text inside, and set lang to color it.

install-note.tsx

CodeTokens

PropTypeDefaultDescription
nodesRequiredreadonly HighlightRenderNode[]—The nodes of renderTokens from

Code

<code>
PropTypeDefaultDescription
langstring—Highlight the text in this language (a name or alias that highlighter knows). Works when the children are text (strings and numbers). Without it the code is plain ink.
palette"color""ink""theme"—
size"default""xs"—
...props<code> attributes—Every other attribute goes to the <code>, with a ref.
  • Use lang to highlight a short piece of code.
  • Use size="xs" for a fixed 12/16 chip in a row or a cell.

It renders the native code element.

A long value breaks at any character, so it does not push the page wider.

Built with

Installs with Code

Components
Mark
  1. AddedCode, with Mark.
Open the release