An open API service indexing awesome lists of open source software.

https://github.com/alchaplinsky/outline-editor


https://github.com/alchaplinsky/outline-editor

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

          

A React component for Outliner editor.

**WARNING**: This package is still WIP

## Getting Started

Clone repo: `git clone git@github.com:railsware/outliner.git`

Install via yarn: `yarn add file:[PATH_TO_OUTLINER]`.

Import from `@railsware/outliner`.

## Usage

Example:

```javascript
import Document from '@railsware/outliner'
import '@railsware/outliner/src/css/index.css'

class MyComponent extends React.Component {

constructor() {
super()
this.onChange = this.onChange.bind(this)
}

state = {
document: {
type: 'text',
value: 'This is a root node',
children: []
}
}

onChange(value) {
this.setState({
document
})
}

render() {
return
}
}
```

## Props
| Name | Type | Description | Required | Default |
|-----------------|-------------------------|-------------------------------------------------------------|-----------|----------------------------|
| onChange | func | Passes document state when change is made | true | |
| document | object | Document tree to render | true | |