# Hide Components when there are no Records

> Please note that this is now available as a plugin for easier installation. While you can use this document as a reference, the recommended method to add…

Source: https://tadabase.com/docs/snippets/hide-components-when-there-are-no-records  
Status: Not yet re-checked. Moved from our previous help site and not yet re-checked against the current product. Last edited Sep 20, 2024.

> **Warning:** Please note that this is now available as a plugin for easier installation. While you can use this document as a reference, the recommended method to add this functionality is through the plugin installation wizard. Learn more about plugins [here](https://tadabase.com/docs).

![Screenshot for “Hide Components when there are no Records”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-09/scaled-1680-/2022-09-24-15-25-48.png)

You can add a little JavaScript to a page that will hide a Data Component if there are no records to display.

**One Easy Step**

**Add the following code to the JavaScript tab of your page.**

```
TB.render('component_3', function(data) {   
    if (data.records === undefined || data.records.length === 0) {
    data.ele.css('display','none')
    }
});
```

> **Note:** Remember to change the component Id in the code to your component ID.

![Screenshot for “Hide Components when there are no Records”](https://tadabase-docs-assets.s3.amazonaws.com/uploads/images/gallery/2022-09/scaled-1680-/image-1664072841697.png)

**Original Community Post:**

[Hide components when there are no records - Community Discussions / Tips and Tricks - Tadabase Community](https://community.tadabase.io/t/hide-components-when-there-are-no-records/915)
