Let's hack the right click event and create a contextual menu with Tailwind CSS and Alpinejs. We'll use the @contextmenu.prevent
directive to prevent the browser from opening the default contextual menu.
![](https://media.dev.to/cdn-cgi/image/width=1000,height=420,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpxkeik5us326w1op9eai.png)
How to creat a contextual menu with Tailwind CSS and Alpinejs
![](https://media.dev.to/cdn-cgi/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F702580%2Fe1627cfa-046d-49bd-b661-ec32af0ddcd6.png)