JSFiddle - React, Tailwind, and code Playground

HTML

<label>
    <input type="checkbox">
    <img src="http://www.centrecon.ru/sites/default/files/YouTubeLogo_32px.jpg">
</label>

CSS

img {
    -webkit-transition: all 0.5s;
    -moz-transition: all 0.5s;
    -o-transition: all 0.5s;
    transition: all 0.5s;
}
label input {
    display: none;
}
label input:checked + img {
    -webkit-transform: rotate(360deg);
    -moz-transform: rotate(360deg);
    -o-transform: rotate(360deg);
    transform: rotate(360deg);
}