This is a very simple scenario where you need to hide/show some div but you can’t use <template if:true> tag. Let’s say you’re using loop.

Here we’re discussing 2 approaches if you’re looking for answer to how you can use dynamic hide/show in LWC without template if:true approach

Toggle Class (Simple Approach)

Toggle (classList Approach)


Leave a Comment