# Install Blk42 plugin for CKEditor 5

> Install the Blk42 Tailwind and Bootstrap editor into CKEditor 5: the npm plugin for your own build, a ready-to-use bundle with Blk42 inside, or one CDN script.

Source: https://blk42.com/docs/install/ckeditor-5  
Section: Installation > CKEditor 5  
Every page of blk42.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://blk42.com/llms-full.txt

Blk42 adds Bootstrap and Tailwind grids to your CKEditor 5: insert a block with the grid layout you pick, edit the grid, fill the block with content and save it as a template for later.

*The page shows these as tabs, one at a time: Plugin, Ready-to-Use Bundle, CDN.*

## Plugin

### Step 1: Install NPM package

Blk42 is part of the [N1ED](https://n1ed.com) plugin for CKEditor 5, one npm package that is easy to add into your existing CKEditor 5 build project for further compilation. Your Blk42 API key switches on the blocks. If you buy N1ED later, its file manager and image editor join the same build with no rebuild.

```sh
npm install --save-dev @edsdk/n1ed-ckeditor5
```

Moving from `@edsdk/blk42-ckeditor5`? Replace it, don't add to it: remove its import and the `Blk42` entry from `plugins`. An old version left in the build next to N1ED stops CKEditor 5 before it starts (two plugins named `Blk42`).

### Step 2: Include to build

Add N1ED into your import section:

```js
import {
    ClassicEditor,
    Image,
    Essentials,
    Paragraph,
    Bold,
    Italic
} from 'ckeditor5';
import N1ED from "@edsdk/n1ed-ckeditor5";
```

*The page highlights line 9 of this code.*

Then pass it to the `plugins` section of your `ClassicEditor` creation method call and set the API key:

```js
ClassicEditor.create(
    document.querySelector('#editor'), // your editor selector
    {
        licenseKey: "GPL", // or your commercial key: CKEditor 5 v44+ will not start without one
        plugins: [
            Essentials,
            Paragraph,
            Bold,
            Italic,
            N1ED
        ],
        apiKey: "BL42B5RRdemodemodemodemo", // the demo key; yours is in the Dashboard: https://blk42.com/dashboard
    }
).then( editor => {
    console.log(editor);
} ).catch( error => {
    console.error(error.stack);
} );
```

*The page highlights lines 10 and 12 of this code.*

### Step 3: Build

Build your CKEditor 5 project or your project with CKEditor 5 imported to apply the newly added plugin.

If you see a new bottom toolbar of the editor, everything works fine.

### ✓ Ready to Use

## Ready-to-Use Bundle

### Step 1: Download

The ready-to-use CKEditor 5 bundle already contains the Blk42 plugin, precompiled and enabled, with Bootstrap or Tailwind layouts from the start. Just download and use it, HTML sample included.

[Download Bundle](https://blk42.com/download/ckeditor-5-with-blk42.zip)

### Step 2: Unpack

The archive contains the compiled build and a ready-made sample page:

```text
build/
  ckeditor5-blk42.js
  ckeditor5-blk42.js.map
sample/
  index.html
  styles.css
```

Open `sample/index.html` right from your disk to see the editor running — no webserver needed. When you are ready to install it, copy `build/ckeditor5-blk42.js` somewhere into your webserver public directory, for example:

```text
var/
  www/
    public/
      js/
        ckeditor5-blk42.js
```

The `.map` file is optional: it is what turns a minified stack trace back into readable line numbers if you ever need to report a problem.

### Step 3: Attach to content box

Add the script link onto your page and initialize CKEditor 5 there, attaching it to the textarea or some div with the content you want to edit.

```html
<script src="/js/ckeditor5-blk42.js"></script>
<script type="text/javascript">
    CKEditor5WithBlk42.create(
        document.querySelector('#editorId'),
        {
            Blk42: {
                // apiKey: "...",
                // Get your own key in the Dashboard: https://blk42.com/dashboard
            }
        }
    );
</script>
```

### ✓ Ready to Use

## CDN

### Step 1: Add the CDN Script

One script loads CKEditor 5 with the Blk42 plugin enabled and preconfigured, always the latest version.

```html
<!-- Load CKEditor 5 with Blk42 -->
<script src="https://cloud.n1ed.com/v/latest/sdk/ckeditor5-blk42.js"></script>

<!-- Your editor placeholder -->
<div id="editorId"></div>

<script type="text/javascript">
    CKEditor5WithBlk42.create(
        document.querySelector('#editorId'),
        {
            Blk42: {
                // apiKey: "...",
                // Get your own key in the Dashboard: https://blk42.com/dashboard
            }
        }
    );
</script>
```

*The page highlights line 2 of this code.*

**Blk42 is part of the N1ED family** — its scripts are served from N1ED's cloud, `cloud.n1ed.com`, the one loader every product of the family shares.

### ✓ Ready to Use

## Configuration

Configure your Blk42 CKEditor 5 installation in the Dashboard: set the Bootstrap or Tailwind options and share your custom blocks between your websites, all without touching the code.

Blk42 uses the editor's own image upload settings. For blocks together with a file manager and an image editor in one plugin, use [N1ED](https://n1ed.com).

[Dashboard](https://blk42.com/dashboard)

## Examples

Live CodePlay examples for CKEditor 5 with the JS/CSS/HTML code provided.

- [Bootstrap in CKEditor 5](https://blk42.com/docs/examples/ckeditor-5/bootstrap)
- [Tailwind in CKEditor 5](https://blk42.com/docs/examples/ckeditor-5/tailwind)
