You’re talking about the properties of a custom widget inside Mendix Studio/Studio Pro, correct? To my knowledge, you cannot set up conditionally visible properties.
This is a good idea. Many widgets have use cases where this capability would make sense, including many of my own widgets. Please submit it as an idea here on the forums!