# Autoresize

> Editor42 Autoresize plugin: the editor grows and shrinks to fit its content, so the editing area needs no scrollbar, within the heights you allow.

Source: https://editor42.com/plugins/autoresize  
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: `autoresize`

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

Automatically adjusts the height of the editor iframe to fit its content, eliminating the need for a scrollbar within the editing area. Recalculates height on content changes and respects minimum/maximum height constraints. When content exceeds the maximum height, scrolling is re-enabled. Only works in iframe mode, not inline.

## Options

| Option | Type | Default | Description |
|---|---|---|---|
| `autoresize_overflow_padding` | `number` | `1` | Padding in pixels added to the left and right sides of the editor body. |
| `autoresize_bottom_margin` | `number` | `50` | Extra margin in pixels added below the content. |

This plugin also respects the core options `min_height` and `max_height` to constrain the resize range.

## Commands

| Command | Description |
|---|---|
| `editor42AutoResize` | Manually triggers a resize calculation and applies the new height. |

## Events

| Event | Description |
|---|---|
| `ResizeEditor` | Fired whenever the editor container height is changed by the resize logic. |
