> ## 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.

> [tab] 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] Other Frameworks
>
> ```js theme={null}
> const commentElement = Velt.getCommentElement();
> commentElement.on('commentPinClicked').subscribe((eventData) => {
>   console.log('Comment pin clicked:', eventData);
> });
> ```

**Event Data:** [CommentPinClickedEvent](https://velt.dev/docs/api-reference/sdk/models/data-models.md#commentpinclickedevent)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.