@Marokapara I think the web map/legend already does this by default. If you zoom out from the features, it disappears from the legend. Just make sure you're setting zoom limits for each layer in your web map.
Hi @UalasRohrer , Thanks for your reply. I'm referring to the map extent, not the zoom level. So if I have some layers showing out of the map frame, I don't want them showing in the legend. I want them to reappear though when I zoom out and the layer comes into the map frame view.