> ## Documentation Index
> Fetch the complete documentation index at: https://velt.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Customize Behavior

## `commentPinClicked` Event

* Listen to when a comment pin is clicked.
* Use this to get information about which pin was clicked and implement custom actions like navigation, analytics tracking, or opening a custom comment dialog.

<Tabs>
  <Tab title="React / Next.js">
    ```jsx theme={null}
    // Using Hook
    const commentPinClickedEvent = useCommentEventCallback('commentPinClicked');
    useEffect(() => {
      if (commentPinClickedEvent) {
        console.log('Comment pin clicked:', commentPinClickedEvent);
      }
    }, [commentPinClickedEvent]);

    // Using API
    const commentElement = client.getCommentElement();
    commentElement.on('commentPinClicked').subscribe((eventData) => {
      console.log('Comment pin clicked:', eventData);
    });
    ```
  </Tab>

  <Tab title="Other Frameworks">
    ```js theme={null}
    const commentElement = Velt.getCommentElement();
    commentElement.on('commentPinClicked').subscribe((eventData) => {
      console.log('Comment pin clicked:', eventData);
    });
    ```
  </Tab>
</Tabs>

**Event Data:** [CommentPinClickedEvent](/api-reference/sdk/models/data-models#commentpinclickedevent)
