1 month ago

Hiding element after X seconds with Alpine

Posted 1 month ago by Romain


I think it's all in the title :D. I can't find a way to hide a flash message after 3 seconds with Alpine. What I have so far:

                <div x-data="{ show: true }" x-show="show">
                        {{ session('status') }}
                    setTimeout(() => show = false, 3000);

Any idea? Thanks

Please sign in or create an account to participate in this conversation.