I'm having trouble understanding how I can use TailwindCSS transition utilities to perform a simple width transition in this Angular component. For example, the button below usually displays an SVG icon. However, occasionally, it displays a text message. When the text message is displayed instead of the SVG icon, the width of the button changes. I would like to add a transition to the width change (in both directions) but I cannot figure out how. Any help appreciated!
<button class="bg-green-600 text-green-100 ring-green-400 p-4 rounded-full focus:outline-none">
<span *ngIf="buttonText" class="font-semibold">{{buttonText}}</span>
<svg *ngIf="!buttonText" xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6" />
</svg>
</button>