Alpine's Mask plugin allows you to automatically format a text input field as a user types.
frameworkreactivedeclarativeplugin
https://alpinejs.dev/plugins/mask