# @atlaskit/editor-plugin-guideline

> guideline plugin for @atlaskit/editor-core

Latest version **33.0.0** (published 2026-11-17) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @atlaskit/editor-plugin-guideline
pnpm add @atlaskit/editor-plugin-guideline
yarn add @atlaskit/editor-plugin-guideline
bun add @atlaskit/editor-plugin-guideline
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 33.0.0 |
| Published | 2026-11-17 |
| First published | 2023-05-24 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 6 |
| Unpacked size | 71.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Atlassian Pty Ltd |
| Maintainers | atlassianartifactteam |

## Links

- npm: https://www.npmjs.com/package/@atlaskit/editor-plugin-guideline
- Repository: https://bitbucket.org/atlassian/atlassian-frontend-mirror
- Homepage: https://bitbucket.org/atlassian/atlassian-frontend-mirror#readme
- Issues: https://bitbucket.org/atlassian/atlassian-frontend-mirror/issues
- npm.io page: https://npm.io/package/@atlaskit/editor-plugin-guideline

## Dependencies (6)

- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.0.0
- [@emotion/react](https://npm.io/package/@emotion/react.md) ^11.7.1
- [@atlaskit/tokens](https://npm.io/package/@atlaskit/tokens.md) ^20.12.0
- [@atlaskit/editor-prosemirror](https://npm.io/package/@atlaskit/editor-prosemirror.md) ^9.0.0
- [@atlaskit/editor-plugin-width](https://npm.io/package/@atlaskit/editor-plugin-width.md) ^34.0.0
- [@atlaskit/editor-shared-styles](https://npm.io/package/@atlaskit/editor-shared-styles.md) ^5.2.0

## Recent versions

- 33.0.0 (latest) — 2026-11-17
- 32.0.0 — 2026-11-17
- 31.0.0 — 2026-11-16
- 30.0.2 — 2026-11-02
- 30.0.1 — 2026-10-29
- 30.0.0 — 2026-10-27
- 29.0.0 — 2026-10-20
- 28.0.0 — 2026-10-16
- 27.0.0 — 2026-10-13
- 26.0.0 — 2026-10-08
- 25.0.0 — 2026-10-07
- 24.0.0 — 2026-10-02
- 23.0.0 — 2026-10-01
- 22.0.0 — 2026-09-25
- 21.0.0 — 2026-09-24
- … 121 more at https://npm.io/package/@atlaskit/editor-plugin-guideline/versions

## README

# Editor Plugin Guideline

Guideline plugin for @atlaskit/editor-core

## Overview

The Guideline plugin provides the ability to display vertical guidelines in the editor. Guidelines are rendered as vertical lines at specified positions and can be customized with different styles and states. This plugin was designed to contain only basic logic to render guidelines. Commonly used configurations and utilities reside in the `editor-common` package.

## Key features

- **Display guidelines** - Render vertical guidelines at specified positions within the editor
- **Flexible positioning** - Position guidelines using coordinate values relative to the editor center
- **Customizable styles** - Configure line style (solid/dashed), color, and cap style
- **State management** - Control visibility and active states of individual guidelines
- **Plugin integration** - Works with the width plugin to calculate correct positioning

## Install

```
yarn add @atlaskit/editor-plugin-guideline
```

- **npm** - [@atlaskit/editor-plugin-guideline](https://www.npmjs.com/package/@atlaskit/editor-plugin-guideline)
- **Source** - [Bitbucket](https://bitbucket.org/atlassian/atlassian-frontend/src/master/packages/editor/editor-plugin-guideline)

## Usage

### Basic Example

```typescript
pluginInjectionApi?.dependencies?.guideline?.actions?.displayGuideline(view)({
  guidelines: [{
    key: "guideline_01",
    position: {
      x: -100
    },
    active: true,
    style: "dashed",
    color: "rgba(0, 0, 0, 0.2)"
  }, 
  {
    key: "guideline_02",
    position: {
      x: 300
    },
    show: false
  }]
});
```

### Guideline Configuration

A guideline config consists of three parts:

- **Key** (required) - A unique identifier for the guideline
- **Position** (required) - The x-coordinate position of the guideline
- **State/Style** (optional) - Display state and styling options

### Position

The position value is defined as: `type Position = { x: number };`

Position diagram:

```
  │                   editor width                    │
  │------------------- max 1800px --------------------│
  │                                                   │
  │          center line (when position x=0)          │
  │                         │                         │
  │--------- x < 0 ---------│--------- x > 0 ---------│
  │                         │                         │
  ┌────────────┬────────────┬────────────┬────────────┐
  │            │            │            │            │
  │            │            │            │            │
  │            │            │            │            │
  │            │-- 380px ---│--- 380px --│            │
  │            │            │            │            │
  │            │            │            │            │
  │            │            │            │            │
  └────────────┴────────────┴────────────┴────────────┘
               │      editor content     │
               │-------- max 760px ------│
  │---------- or 1800px in full-width mode  ----------│
```

- When `x` is 0, a vertical line is displayed at the center of the editor
- Negative values move the line left (up to minus half of the editor width)
- Positive values move the line right (up to half of the editor width)
- Guidelines outside the visible range are ignored

### State and Style

Configure guidelines with the following state and style options:

```typescript
type GuidelineConfig = {
  // ...
  active?: boolean;           // default false
  show?: boolean;             // default true
  styles?: {
    lineStyle?: 'dashed' | 'solid';  // default 'solid'
    color?: CSSToken;                // default undefined
    capStyle?: 'line'                // default undefined
  }
};
```

- `active` - Equivalent to the highlight state in the grid plugin
- `show` - Hide a guideline (useful for animations)
- `styles.color` - Override the guideline color with a valid CSS color
- `styles.lineStyle` - Line style can be 'solid' or 'dashed'
- `styles.capStyle` - Line cap style, supports 'line'

## Support

For internal Atlassian, visit the slack channel [#help-editor](https://atlassian.slack.com/archives/CFG3PSQ9E) for support or visit [go/editor-help](https://go/editor-help) to submit a bug.

## License

Please see [Atlassian Frontend - License](https://hello.atlassian.net/wiki/spaces/AF/pages/2589099144/Documentation#License) for more licensing information.

---
_Source: https://npm.io/package/@atlaskit/editor-plugin-guideline · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
