[](https://deploy.now.sh/?repo=https://github.com/zeit/next.js/tree/master/examples/with-draft-js)
# DraftJS Medium editor inspiration
## How to use
### Using `create-next-app`
Download [`create-next-app`](https://github.com/segmentio/create-next-app) to bootstrap the example:
```
npm i -g create-next-app
create-next-app --example with-draft-js
```
### Download manually
Download the example [or clone the repo](https://github.com/zeit/next.js):
Deploy it to the cloud with [now](https://zeit.co/now)([download](https://zeit.co/download)):
```bash
now
```
## The idea behind the example
Have you ever wanted to have an editor like medium.com in your Next.js app? DraftJS is avalaible for SSR, but some plugins like the toolbar are using `window`, which does not work when doing SSR.
This example aims to provides a fully customizable example of the famous medium editor with DraftJS. The goal was to get it as customizable as possible, and fully working with Next.js without using the react-no-ssr package.
constinitialData={'blocks':[{'key':'16d0k','text':'You can edit this text.','type':'unstyled','depth':0,'inlineStyleRanges':[{'offset':0,'length':23,'style':'BOLD'}],'entityRanges':[],'data':{}},{'key':'98peq','text':'','type':'unstyled','depth':0,'inlineStyleRanges':[],'entityRanges':[],'data':{}},{'key':'ecmnc','text':'Luke Skywalker has vanished. In his absence, the sinister FIRST ORDER has risen from the ashes of the Empire and will not rest until Skywalker, the last Jedi, has been destroyed.','type':'unstyled','depth':0,'inlineStyleRanges':[{'offset':0,'length':14,'style':'BOLD'},{'offset':133,'length':9,'style':'BOLD'}],'entityRanges':[],'data':{}},{'key':'fe2gn','text':'','type':'unstyled','depth':0,'inlineStyleRanges':[],'entityRanges':[],'data':{}},{'key':'4481k','text':'With the support of the REPUBLIC, General Leia Organa leads a brave RESISTANCE. She is desperate to find her brother Luke and gain his help in restoring peace and justice to the galaxy.','type':'unstyled','depth':0,'inlineStyleRanges':[{'offset':34,'length':19,'style':'BOLD'},{'offset':117,'length':4,'style':'BOLD'},{'offset':68,'length':10,'style':'ANYCUSTOMSTYLE'}],'entityRanges':[],'data':{}}],'entityMap':{}}