# Visual Blocks

> Editor42 Visual Blocks plugin — toggles the visibility of block-level element outlines in the editor.

Source: https://editor42.com/plugins/visualblocks  
Every page of editor42.com has a Markdown copy at its URL + `.md` (`index.md` after a URL that ends in `/`); all of them are in one file: https://editor42.com/llms-full.txt

Plugin alias: `visualblocks`

```js
editor42.init({
  plugins: 'visualblocks'
});
```

Toggles the visibility of block-level element outlines in the editor by adding or removing the CSS class `editor42-m-visualblocks` on the editor body. When active, block elements are rendered with visible borders and labels, helping authors understand document structure.

## Options

| Option | Type | Default | Description |
|---|---|---|---|
| `visualblocks_default_state` | boolean | `false` | Enable visual blocks automatically on init. |

## Commands

| Command | Description |
|---|---|
| `editor42VisualBlocks` | Toggles visual blocks on/off. |

## Toolbar buttons

| Button | Type | Description |
|---|---|---|
| `visualblocks` | Toggle button | Toggles visual blocks on/off. |

## Menu items

| Item | Type | Description |
|---|---|---|
| `visualblocks` | Toggle menu item | Toggles visual blocks on/off. |

## Events

| Event | Description |
|---|---|
| `VisualBlocks` | Fired when toggled. Payload: `{ state: boolean }`. |
