I'm using Tailwind and the Radio Group component from Headless UI. By default, the transition between checked and unchecked styles is happening instantly with no animation. I'd like to add a smooth transition between the two states.
Normally I do this with the Tailwind CSS Transition classes but in this case it doesn't work. Here's my code:
<RadioGroup.Option
className="..."
value={value}
>
{({ checked }) => (
<div
className={`...bg-black text-white transition-colors duration-500 ${
checked ? "bg-white text-black" : ""
}`}
>
{label}
</div>
)}
</RadioGroup.Option>
What would be the best way to accomplish a smooth transition between the CSS classes of the checked and unchecked states?