https://github.com/alchaplinsky/outline-editor
https://github.com/alchaplinsky/outline-editor
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/alchaplinsky/outline-editor
- Owner: alchaplinsky
- Created: 2019-04-27T21:48:27.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T20:26:14.000Z (over 3 years ago)
- Last Synced: 2025-01-01T23:27:42.143Z (over 1 year ago)
- Language: JavaScript
- Size: 2.2 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
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 | |