ylm
v1.0.1-beta.1
Published
YJS in custom elements, simple collabrative components powered by YJS.
Downloads
66
Readme
Y-Block
YJS in custom elements, simple collabrative components powered by YJS.
Installation
pnpm install @y-block/components
Blocks
Usage
<!DOCTYPE html>
<html lang="en">
<script type="module">
import '@y-block/components/y-doc/y-doc.js'
import '@y-block/components/y-array/y-array.js'
import '@y-block/components/y-text/y-text.js'
import * as Y from 'yjs'
const doc = new Y.Doc()
doc.getArray('my-array').insert(0, ["Hello", "Array!"])
</script>
<body>
<y-doc>
<y-array array="doc.getArray('my-array')">
<input $:placeholder="item" />
</y-array>
</y-doc>
</body>
</html>