> For the complete documentation index, see [llms.txt](https://docs.jetadmin.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.jetadmin.io/classic-app-builder/classic-tutorials/part-2-intermediate/conditional-visibility.md).

# Conditional Visibility

In Jet Admin, you can make certain components visible or invisible depending on the values or combination of values from your data or user attributes.&#x20;

Say, we want to show two different status change `buttons` depending on the status value of the selected row of the `users` table:

![](https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LQ08RFAKZvFADEiXKFy%2F-MkfYzwIiYAzw06D690g%2F-MkgFhSXlnt5fbAjvCz0%2Fvisibility1.gif?alt=media\&token=0cb6b168-edf7-4b84-9178-66f118400cdf)

{% hint style="info" %}
If standard permissions are not enough and you may want to **restrict access** on the level of **individual UI components**, use [user properties](/access-and-sharing/members-users-and-groups/user-and-team-properties.md) in the visibility logical expression
{% endhint %}

To achieve that, let's first drop **two buttons**: one that changes the status of a user to "active" and the other that changes it to "inactive":

![](https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LQ08RFAKZvFADEiXKFy%2F-MkfYzwIiYAzw06D690g%2F-MkgHjYYjBz2TurTvxpq%2Fzthxbcxgn.png?alt=media\&token=955b24e7-b88c-4c51-9d00-ff763f3866e2)

Then, we proceed to the "Activate" button's settings to the **"Visible" section**:

![](https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LQ08RFAKZvFADEiXKFy%2F-MkfYzwIiYAzw06D690g%2F-MkgIeg9WfYt8QbOJPlC%2Fvisibility2.gif?alt=media\&token=2aa2a7f3-96f5-44ba-9972-beeebbd5266c)

Next, we type in the condition: `IF` the `status` value from the selected row equals "inactive", then return `true`, otherwise, return `false`. Returned `true` will make the component visible and `false` will make it invisible:

![](https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LQ08RFAKZvFADEiXKFy%2F-MkfYzwIiYAzw06D690g%2F-MkgKklxhgu8c3b0s1JQ%2Fvisibility3.gif?alt=media\&token=d6b6f1bf-c381-4b8c-a8b1-acfe965e7117)

Here's the expression: `=IF(EQ(elements.users["0"].selected_item.Status, "inactive"), 1, 0)`

Then we do the same for the "Deactivate" button, grabbing the "active" value from the selected row:

`=IF(EQ(elements.users["0"].selected_item.Status, "active"), 1, 0)`

And we get our buttons being **dynamically hidden** based on the status value from the selected row:

![](https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LQ08RFAKZvFADEiXKFy%2F-MkfYzwIiYAzw06D690g%2F-MkgFhSXlnt5fbAjvCz0%2Fvisibility1.gif?alt=media\&token=0cb6b168-edf7-4b84-9178-66f118400cdf)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.jetadmin.io/classic-app-builder/classic-tutorials/part-2-intermediate/conditional-visibility.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
