Skip to content
You have no unread notifications
Snippyly-Docs  /  github-veltdemo  /  
Open in github.dev Open in a new github.dev tab Open in codespace

YourDocument.js

Latest commit

368116d · 

History

History
29 lines (22 loc) · 799 Bytes

YourDocument.js

File metadata and controls

29 lines (22 loc) · 799 Bytes
Karthik-Velt
1
2
3
4
5
6
7
8
9
10
11
12
13
import { useVeltClient, VeltSidebarButton, VeltCommentTool, VeltHuddleTool, VeltPresence } from '@veltdev/react';
import { useEffect, useState } from 'react';
export default function YourDocument() {
// Get the Velt client
const { client } = useVeltClient();
useEffect(() => {
if (client) {
// Set a document ID
14
client.setDocumentId('github-veltdemo');
15
16
17
18
19
20
21
const selectionElement = client.getSelectionElement();
selectionElement.enableLiveSelection();
}
}, [client]);
return (
22
<div style={{ display:"flex", gap:"8px", marginRight:"16px", alignItems:"center", position:"absolute", top:"116px", right:"44px", zIndex:"999"}}>
23
24
25
26
27
28
29
<VeltPresence flockMode={true}/>
<VeltHuddleTool/>
<VeltCommentTool/>
<VeltSidebarButton/>
</div>
);
}
Blaming github-veltdemo/src/components/YourDocument.js at main · Snippyly-Docs/github-veltdemo