---
title: "Inline Code Tool — Monospace Code Spans"
description: "Mark a selection as inline code with Cmd/Ctrl+E, and the markup it stores inside a block's text field."
source: https://blokeditor.com/docs/inlineCode/
lastmod: 2026-09-07
---

Framework JavaScript

Inline Tools Inline Code

# Inline code: monospace code spans

Wraps selected text in `<code>`. Activated with Cmd/Ctrl+E or by clicking the code button in the inline toolbar. Useful for marking up variable names, function calls, and short code snippets within text.

### Import

TypeScript

```
import { InlineCode } from '@bloklabs/core/tools';
```

### Save Data

TypeScript

```
// Stored as HTML inside the block's text field.
// "Call <code>getData()</code> to fetch results"
```

JSON

```
{
  "type": "paragraph",
  "data": { "text": "Call <code>getData()</code> to fetch results" }
}
```

### Usage Example

TypeScript

```
import { Blok } from '@bloklabs/core';
import { InlineCode, Paragraph } from '@bloklabs/core/tools';

const editor = new Blok({
  holder: 'editor',
  tools: {
    // Paragraph is the default block and is not bundled with the core —
    // without it the editor starts with an "unsupported block" stub.
    paragraph: Paragraph,
    inlineCode: InlineCode,
  },
});
```
