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

# nx:layer-state-set

> Sets the visibility state of a layer by name

Turns layers on or off, so you can show or hide parts of your template based on your data. It sets the layer's video switch, the eye icon in the After Effects timeline.

## Example

```json theme={null}
{
  "type": "function",
  "name": "nx:layer-state-set",
  "params": {
    "layerName": "Background",
    "visible": true
  }
}
```

To hide several layers at once, pass an array of names:

```json theme={null}
{
  "type": "function",
  "name": "nx:layer-state-set",
  "params": {
    "layerName": ["Promo Tag", "Price Badge"],
    "visible": false
  }
}
```

## Parameters

**layerName** `string | string[]` *required*

Name of the layer to modify. Layers with this name in every composition of the project are changed. Pass an array of names to change several layers.

**visible** `boolean` *required*

`true` turns the layer on, `false` turns it off


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