JSFiddle - React, Tailwind, and code Playground

by Bahman ParsaManesh

HTML

<svg class="SVGBadge-svg" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
        <circle class="SVGBadge-svgBackground" cx="10" cy="10" r="10"/>
        <text class="SVGBadge-number" x="10" y="14.5" text-anchor="middle">1</text>
      </svg>

SCSS

.SVGBadge {
  &-svg {
    font-size: 30px;
    position: absolute;
    bottom: 100%;
    left: 100%;
    width: 1em;
    height: 1em;
    margin-left: -0.6em;
    margin-bottom: -0.6em;
  }
  
  &-svgBackground {
    fill: red;
  }
  
  &-number {
    fill: white;
    font-family: "Roboto";
    font-size: 12px;
    letter-spacing: -1px;
  }
}