# Storage

<figure><img src="https://3844357853-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLWWF0gTSzvFs1o4Cs6Tm%2Fuploads%2FlLa0uEzdDQ9VObeTmaqr%2Fstorage-light.png?alt=media&#x26;token=08029064-2c4d-48dc-9ba8-76752fdeea7e" alt=""><figcaption><p>Storage</p></figcaption></figure>

## Configuration <a href="#configuration" id="configuration"></a>

Set up a new instance with `config` parameters and `set`/`get` methods:

```javascript
const storage = appmixer.ui.Storage(config)

storage.set(key, value)
storage.get(key)
```

#### **`config.el`** **`...`**

{% hint style="info" %}
Learn about `widget` `config` [here](https://docs.appmixer.com/6.0/5.0/appmixer-sdk/ui-and-widgets/..#configuration).
{% endhint %}

#### **`config.storeId`**

Type: `String` | Default: `[]`

ID of a store to open within the storage.

## Instance <a href="#state" id="state"></a>

{% hint style="info" %}
Learn about `widget` instance [here](https://docs.appmixer.com/6.0/5.0/appmixer-sdk/ui-and-widgets/..#instance).
{% endhint %}

### State

```javascript
storage.state(name, value)
```

#### **`loader`**

Type: `Boolean` | Default: `null`

Toggle a custom loading state.

#### **`error`**

Type: `String` | Default: `null`

Toggle a custom error message.

## Example

```javascript
const storage = appmixer.ui.Storage({
    el: '#storage'
})

storage.open()
```
