JSFiddle - React, Tailwind, and code Playground

HTML

<svg>
    <rect x="50" y="50" width="50" height="50" transform="rotate(45,75,75)" fill="red"/>
    <rect x="50" y="50" width="50" height="50" class="transform" fill="green"/>
</svg>

CSS

.transform {
    transform-origin: 50% 50%;
    transform: rotate(45deg);
}