1

I was trying to do a button with and I have tried in different ways. svg worked but unfortunately SVG is not supporting on Next.js & Material UI. I am providing the code and the screenshot below.

Any kind of help would be really helpful

enter image description here

span.button__publish {
    margin-left: 45px;
    position: relative;
}

.button__publish button {
    width: 137px;
    height: 37.3px;
    border-radius: 4px;
    background-color: #8ae38c;
}
*emphasized text*
<span class="button__publish">
  <button class="MuiButtonBase-root MuiButton-root MuiButton-text publish MuiButton-textPrimary" tabindex="0" type="button">
   <span class="MuiButton-label">Publish</span>
  </button>
</span>
nazifa rashid
  • 1,469
  • 1
  • 9
  • 20

1 Answers1

0

You can use css's clip-path property. I added an example, but you have to find out the exact values yourself so that it looks like you want. For reference see the documentation on MDN.

span.button__publish {
    margin-left: 45px;
    position: relative;
}

.button__publish button {
    width: 137px;
    height: 37.3px;
    border-radius: 4px;
    background-color: #8ae38c;
    clip-path: polygon(5% 5%, 100% 0%, 100% 75%, 75% 75%, 75% 100%, 50% 75%, 0% 75%);
}
*emphasized text*
<span class="button__publish">
  <button class="MuiButtonBase-root MuiButton-root MuiButton-text publish MuiButton-textPrimary" tabindex="0" type="button">
   <span class="MuiButton-label">Publish</span>
  </button>
</span>

EDIT: this way part of the border is "eaten", too, see here for how to fix this.

TheEagle
  • 5,808
  • 3
  • 11
  • 39