---
schema_version: "1"
id: 4b1416942f96dd5e49a013ce2654c4a90633c723050b3588ac0f7b8fe234a7bf
title: Background Utility Item
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/lightning-base-components/lightning-design-system/guides/aura/components/lightning/backgroundUtilityItem/aura-background-utility-item.md
canonical_url: https://developer.salesforce.com/docs/platform/lightning-component-reference/guide/aura-background-utility-item.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 3c2e2b93929045775179158b5666dca51c8d77c3e6b6b9f372faabf6b8f72cd2
products:
  - Lightning Component Reference
---
# Background Utility Item

**`lightning:backgroundUtilityItem`**

Enables a component to be used at the app level without rendering any UI.

**For Use In**

Lightning Experience

::::::tabset{tabs='[ "Develop", "Specifications"]'}

:::::tab

Implement the `lightning:backgroundUtilityItem` interface to allow a component to be used as an app-level component that is created when the app loads, and runs code without rendering itself in the app UI.

Components that implement this interface are added to the app through the Select Utility Items milestone in Setup.

This example shows how to implement a background utility item that listens for `lightning:tabCreated` events when the app loads, and invokes `lightning:workspaceAPI` methods to prevent more than 10 tabs from opening.

```html
<aura:component implements="lightning:backgroundUtilityItem">
  <aura:handler event="lightning:tabCreated" action="{! c.onTabCreated }" />
  <lightning:workspaceAPI aura:id="workspace" />
</aura:component>
```

In your client-side controller, limit the number of tabs when a new tab is created.

```javascript
({
  onTabCreated: function (cmp) {
    var workspace = cmp.find("workspace");
    workspace.getAllTabInfo().then(function (tabInfo) {
      if (tabInfo.length > 10) {
        workspace.closeTab({
          tabId: tabInfo[0].tabId,
        });
      }
    });
  },
});
```


:::::

:::::tab
![No specifications to show](https://developer.salesforce.com/media/no-specs.png)

:::::

::::::
