Topic: Make an Icon Clickable

cawgit free asked 3 years ago

Expected behavior*_Be able to click on an icon and have it set a variable to true to open a modal_*Actual behavior*_Icon is not clickable._*Resources (screenshots, code snippets etc.)

Click the link to view the image. I want the question mark to be clickable.

Magdalena Dembna staff answered 3 years ago

You can achieve this by simply adding native modifier to your click event. By default cursor over an icon element won't change to pointer so you need to add css style.

      <mdb-icon @click.native="handleClick" icon="calendar-check" class="clickable-icon"/>

import { mdbIcon } from 'mdbvue';
export default {
  components: {
  methods: {
    handleClick() {

<style scoped>
.clickable-icon {
  cursor: pointer;

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • User: Free
  • Premium support: No
  • Technology: MDB Vue
  • MDB Version: 5.6.0
  • Device: Desktop
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: Yes