> ## Documentation Index
> Fetch the complete documentation index at: https://doc.lucidworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# hide:when

[localhost link]: http://localhost:3000/docs/4/app-studio/reference/tags/lightning.directive.hideWhen

[mintlify link]: https://doc.lucidworks.com/docs/4/app-studio/reference/tags/lightning.directive.hideWhen.md

[old doc.lw link]: https://doc.lucidworks.com/app-studio/4.2/1054.md

> [card] Key questions to get you started
>
> Powered by Lucidworks Agent Studio

## Description

Show or hideWhen element based on expression passed to it.

## Usage

as attribute

```xml wrap  theme={"dark"}
<ANY hide-when="{expression}">
   ...
</ANY>
```

#### Parameters

| Param | Type | Details |
| - | - | - |
| hide-when | **expression** | Expression to evaluate. |

## Example

#### Source

```xml wrap  theme={"dark"}
<p><a href="javascript:void(0);" ng-click="alert()" styling="button">{{foo ? 'Show' : 'Hide'}}!</a></p>
<h3 hide-when="foo" id="example_hello-world">Hello World</h3>
```

```xml wrap  theme={"dark"}
angular.module('lightning')
.controller('ExampleController', ['$scope','$timeout', function($scope,$timeout) {
          $scope.foo = false;
          $scope.alert = function(){
            $scope.foo = !$scope.foo
          };
        }]);
```

#### Result

![Result](https://mintcdn.com/lucidworks/ENcE8K39c0iEpL8J/assets/images/app-studio/as-examples/tags/hideWhen.png?fit=max\&auto=format\&n=ENcE8K39c0iEpL8J\&q=85\&s=ae6cba27823e10d5d81f3298bbdaf2b5)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.