Hide/show Grafana text visualization panel based on variable value

i have variable and its value is 1 now i want to show the panel else hide it so how can i do that, even i have posted the code
{{#if eq $yourVariable 1}}
Your graph data here
{{else if eq $yourVariable 0}}
Please select proper indicator
in Text Visualiztion, html section but code is not working.

@nomi10sw This code is handlebars and you try to use them in the native Text panel or Dynamic Text panel?

For Dynamic Text panel, check out the documentation on how to use variables

@nomi10sw late reply but I am working on something similar. do you still need help with this? are you trying to display 2 different strings based on a variable or you want the whole viz panel to disappear and somehow your grafana dashboard rearrange itself?