PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

alpinejs conditional classes

<div :class="{ 'hidden': ! show }">

Setting the hidden attribute when show is set to false. Inside the :class attribute you will include a JS object with the key being the classes you want to add, and the second is the condition you want to evaluate as to whether or not that class should be added.

BETA Snippet explanation automatically generated by OpenAI:

Here is what the above code is doing:
1. If the user is logged in, then show the textarea input field.
2. If the user is not logged in, show a message asking the user to log in or sign up.

We can see that the user is logged in by accessing the user in the

Snippet By Tony Lea

ยท

Created October 12th, 2021

ยท

Report Snippet