# ckeditor5-iframe

> iframe feature for CKEditor 5.

Latest version **27.1.0-next.9** (published 2021-06-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install ckeditor5-iframe
pnpm add ckeditor5-iframe
yarn add ckeditor5-iframe
bun add ckeditor5-iframe
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 27.1.0-next.9 |
| Published | 2021-06-02 |
| First published | 2021-06-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=12.0.0 |
| Dependencies | 8 |
| Unpacked size | 37.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Eduflow team |
| Maintainers | tony |
| Keywords | ckeditor, ckeditor5, ckeditor 5, ckeditor5-feature, ckeditor5-plugin, ckeditor5-iframe |

## Links

- npm: https://www.npmjs.com/package/ckeditor5-iframe
- Repository: https://github.com/eduflow/ckeditor5-iframe
- Issues: https://github.com/eduflow/ckeditor5-iframe/issues
- npm.io page: https://npm.io/package/ckeditor5-iframe

## Dependencies (8)

- [@ckeditor/ckeditor5-ui](https://npm.io/package/@ckeditor/ckeditor5-ui.md) ^27.1.0
- [@ckeditor/ckeditor5-core](https://npm.io/package/@ckeditor/ckeditor5-core.md) ^27.1.0
- [@ckeditor/ckeditor5-undo](https://npm.io/package/@ckeditor/ckeditor5-undo.md) ^27.1.0
- [@ckeditor/ckeditor5-utils](https://npm.io/package/@ckeditor/ckeditor5-utils.md) ^27.1.0
- [@ckeditor/ckeditor5-engine](https://npm.io/package/@ckeditor/ckeditor5-engine.md) ^27.1.0
- [@ckeditor/ckeditor5-widget](https://npm.io/package/@ckeditor/ckeditor5-widget.md) ^27.1.0
- [@ckeditor/ckeditor5-clipboard](https://npm.io/package/@ckeditor/ckeditor5-clipboard.md) ^27.1.0
- [@ckeditor/ckeditor5-inspector](https://npm.io/package/@ckeditor/ckeditor5-inspector.md) ^2.2.2

## Alternatives

- [ext-list](https://npm.io/package/ext-list.md) — 6.3M weekly downloads
- [@lexical/selection](https://npm.io/package/@lexical/selection.md) — 3.8M weekly downloads
- [@lexical/text](https://npm.io/package/@lexical/text.md) — 3.6M weekly downloads
- [@lexical/clipboard](https://npm.io/package/@lexical/clipboard.md) — 3.0M weekly downloads
- [@tiptap/extension-mention](https://npm.io/package/@tiptap/extension-mention.md) — 3.0M weekly downloads

## Recent versions

- 27.1.0-next.9 (latest) — 2021-06-02
- 27.1.0-next.8 — 2021-06-01
- 27.1.0-next.7 — 2021-06-01
- 27.1.0-next.6 — 2021-06-01
- 27.1.0-next.5 — 2021-06-01
- 27.1.0-next.4 — 2021-06-01
- 27.1.0-next.3 — 2021-06-01
- 27.1.0-next.2 — 2021-06-01
- 27.1.0-next.1 — 2021-06-01
- 27.1.0-next.0 — 2021-06-01

## README

# CKEditor 5 iframe feature &middot; [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/iframe/ckeditor5-iframe/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/ckeditor5-iframe.svg?style=flat)](https://www.npmjs.com/package/ckeditor5-iframe)

ckeditor5-iframe is based on CKEditor 5's [HTML
embed](https://ckeditor.com/docs/ckeditor5/latest/features/iframe-embed.html)
[Plugin](https://ckeditor.com/docs/ckeditor5/latest/api/module_iframe-embed_iframeembed-IframeEmbed.html) ([NPM](https://www.npmjs.com/package/@ckeditor/ckeditor5-iframe-embed))

Renders links to `<iframe src="...">`

![ckeditor5-iframe in a classic build.](/screenshots/1.png?raw=true "ckeditor5-iframe in a classic build")

## Table of contents

- [Installation](#installation)
- [Configuration](#configuration)
- [Input format](#input-format)
- [Development](#development)
- [Credits](#credits)

## Installation

via npm:

`npm install ckeditor5-iframe --save-dev`

via yarn:

`yarn install ckeditor5-iframe --dev`

## Configuration

In your editor build / configuration:

```js
import IframeEmbed from "ckeditor5-iframe/src/iframeembed";

ClassicEditor.create(document.querySelector("#editor"), {
  plugins: [Essentials, Paragraph, Bold, Italic, IframeEmbed],
  toolbar: ["bold", "italic", "iframeEmbed"],
});
```

### Show previews

![Preview option](/screenshots/preview.png?raw=true "Screenshot of the in-editor
preview")

Passing `true` to `iframeEmbed.showPreviews` will enable previewing.

```js
import IframeEmbed from "ckeditor5-iframe/src/iframeembed";

ClassicEditor.create(document.querySelector("#editor"), {
  plugins: [Essentials, Paragraph, Bold, Italic, IframeEmbed],
  toolbar: ["bold", "italic", "iframeEmbed"],
  iframeEmbed: {
    showPreviews: true,
  },
});
```

The minimum dimensions are tweakable via [CSS variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties) `--ck-iframe-embed-content-min-height` and `--ck-iframe-embed-content-min-width`.

## Input format

```html
<figure class="iframe-embed">
  <iframe src="https://www.google.com">
</figure>
```

## Development

To boot up a development loop, clone the repo, install the packages via `yarn`, `yarn start` and go to http://localhost:8080

![Dev environment](/screenshots/dev.png?raw=true "Screenshot of dev environment")

From here, you can customize `demo/`'s `app.js` and `index.html` as well as
files inside `src/` (the plugin code itself) and files will be automatically
rebuilt. You still may need to refresh.

The `window.editor` can access the
[`ClassicEditor`](https://ckeditor.com/docs/ckeditor5/latest/api/module_editor-classic_classiceditor-ClassicEditor.html) object, e.g. `editor.getData()` can retrieve the output HTML.

### Credits

Icon: https://iconify.design/icon-sets/mdi/iframe.html, Open Font License

---
_Source: https://npm.io/package/ckeditor5-iframe · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
