import { VeltComments, useVeltClient } from '@veltdev/react';

import { useEffect } from 'react'

export default function YourDocument() {
  const { client } = useVeltClient();

  useEffect(()=>{
    if(client){
      const commentElement = client.getCommentElement();
      commentElement.enableInboxMode(); // 2
      commentElement.disableInboxMode(); // 2
      commentElement.enablePopoverMode(); // 3
      commentElement.disablePopoverMode(); // 3
      commentElement.enableStreamMode(); // 4
      commentElement.disableStreamMode(); // 4
      commentElement.enableTextComments(); // 5
      commentElement.disableTextComments(); // 5
      commentElement.enablePersistentCommentMode(); // 6
      commentElement.disablePersistentCommentMode(); // 6
      commentElement.enableInlineCommentMode(); // 7
      commentElement.disableInlineCommentMode(); // 7
    }
    

  })

  return (
    <div>

        <VeltComments           {/* 1 */}
            inboxMode={true}    {/* 2 */}
            popoverMode={true}  {/* 3 */}
            streamMode={true}   {/* 4 */}
            textMode={true}     {/* 5 */}
            persistentCommentMode={true} {/* 6 */}
            inlineCommentMode={true} {/* 7 */}
        />
    </div>
  )
}
1

Freestyle mode

For a complete setup guide for Freestyle mode, read here.

Whether Freestyle Mode is enabled.

Default: true

<VeltComments/> {/* Freestyle mode is enabled by default when you use VeltComments}
2

Inbox mode

For a complete setup guide for Inbox mode, read here.

Whether Inbox Mode is enabled.

Default: false

<VeltComments inboxMode={true} />

API Method:

const commentElement = client.getCommentElement();
commentElement.enableInboxMode();
commentElement.disableInboxMode();
3

Popover mode

For a complete setup guide for Popover mode, read here.

Whether Popover Mode is enabled.

Default: false

<VeltComments popoverMode={true}/>

API Method:

const commentElement = client.getCommentElement();
commentElement.enablePopoverMode();
commentElement.disablePopoverMode();
4

Stream mode

For a complete setup guide for Stream mode, read here.

Whether Stream Mode is enabled.

Default: false

<VeltComments streamMode={true}/>

API Method:

const commentElement = client.getCommentElement();
commentElement.enableStreamMode();
commentElement.disableStreamMode();
5

Text mode

For a complete setup guide for Text mode, read here.

Whether Text Mode is enabled.

Default: true

<VeltComments textMode={true}/>

API Method:

const commentElement = client.getCommentElement();
commentElement.enableTextComments();
commentElement.disableTextComments();
6

Persistent comment mode

Whether Persistent comment mode is enabled.

Default: false

When Persistent comment mode is enabled, you can continue leave additional comments after finishing a comment.

When it is disabled, you will need to reclick the Comment Tool every time when you want to make a comment.

<VeltComments persistentCommentMode={true}/>

API Method:

const commentElement = client.getCommentElement();
commentElement.enablePersistentCommentMode();
commentElement.disablePersistentCommentMode();
7

Inline Comment Mode

Whether In-line comment mode is enabled.

When In-line comment mode is enabled, comments will appear under the text they are associated with in the DOM, instead of as a pop up window.

Default: false

<VeltComments inlineCommentMode={true}/>

API Method:

const commentElement = client.getCommentElement();
commentElement.enableInlineCommentMode();
commentElement.disableInlineCommentMode();