ocif-thing-editor
v0.0.3
Published
React component library for editing OCIF (Open Canvas Interchange Format) documents
Downloads
11
Readme
ocif thing
An infinite canvas editor based on the OCIF spec
More about OCIF: canvasprotocol.org
ocif thing playground: ocif.jmsv.dev
ocif-thing-editor usage
https://www.npmjs.com/package/ocif-thing-editor
Install
npm install ocif-thing-editorReact component
import { useState } from "react"
+ import { OcifEditor, useOcifEditor } from "ocif-thing-editor"
+ import "ocif-thing-editor/styles.css"
function App() {
+ const [value, setValue] = useState(initialValue)
+ const editor = useOcifEditor({ value, onChange: setValue })
return (
<div style={{ width: "100vw", height: "100vh" }}>
+ <OcifEditor editor={editor} />
</div>
)
}Development
bun i
bun dev