---
title: UIConfig.json
description: Every property of UIConfig.json, the file that describes a Volumio plugin's settings page, with the field types the Volumio web UI renders and what each one sends back.
---

`UIConfig.json` describes a plugin's settings page: a page with sections, and fields inside each section. `getUIConfig` in `index.js` translates it and fills in the saved values, and the Volumio web UI renders it. [Add a settings page](/plugins/how-to/settings-page) shows how the pieces fit together.

## Example

```json title="UIConfig.json"
{
  "page": { "label": "TRANSLATE.PLUGIN_NAME" },
  "sections": [
    {
      "id": "account",
      "element": "section",
      "label": "TRANSLATE.ACCOUNT",
      "icon": "fa-user",
      "onSave": { "type": "controller", "endpoint": "music_service/my_service", "method": "saveAccount" },
      "saveButton": { "label": "TRANSLATE.SAVE", "data": ["username", "password", "high_quality"] },
      "content": [
        { "id": "username", "element": "input", "type": "text", "label": "TRANSLATE.USERNAME", "value": "" },
        { "id": "password", "element": "input", "type": "password", "label": "TRANSLATE.PASSWORD", "value": "" },
        { "id": "high_quality", "element": "switch", "label": "TRANSLATE.HIGH_QUALITY", "value": true }
      ]
    }
  ]
}
```

When the user selects **Save**, Volumio calls `saveAccount` with `{ "username": "...", "password": "...", "high_quality": true }`.

## Page

| Property | Type | Value |
| --- | --- | --- |
| `page.label` | string | The page title |
| `page.description` | string | Optional. A line under the title. |
| `sections` | array | The sections, in order |

## Section

| Property | Type | Value |
| --- | --- | --- |
| `id` | string | The section's id |
| `element` | string | `section` |
| `label` | string | The section title |
| `description` | string | Optional. A line under the title. |
| `icon` | string | Optional. A Font Awesome class, such as `fa-cog` |
| `hidden` | boolean | Optional. `true` hides the section. |
| `content` | array | The fields. See [Fields](#fields). |
| `onSave` | object | What **Save** calls: `{ "type": "controller", "endpoint": "<type>/<id>", "method": "<method>" }` |
| `onSave.askForConfirm` | object | Optional. `{ "title": "...", "message": "..." }` asks the user to confirm before saving. |
| `saveButton.label` | string | The text of the **Save** button |
| `saveButton.data` | array | The ids of the fields whose values **Save** sends. A field missing here is not sent. |
| `saveButton.hidden` | boolean | Optional. `true` hides the button. |

## Fields

Every field has these properties:

| Property | Type | Value |
| --- | --- | --- |
| `id` | string | The field's id, used in `saveButton.data` and in `visibleIf` |
| `element` | string | `input`, `switch`, `select`, `button` or `equalizer` |
| `label` | string | The field's label |
| `doc` | string | Optional. Help text, shown behind an info icon |
| `description` | string | Optional. A line under the field |
| `value` | any | The current value. `getUIConfig` sets it from the saved settings. |
| `visibleIf` | object | Optional. `{ "field": "<id>", "value": <value> }` shows the field only while the field `<id>` of the same section has that value. |
| `hidden` | boolean | Optional. `true` hides the field. |

### `input`

A text box. `type` is an HTML input type: `text`, `password`, `number` and the like.

```json
{ "id": "player_name", "element": "input", "type": "text", "label": "TRANSLATE.PLAYER_NAME", "value": "Volumio", "attributes": [{ "placeholder": "Living room" }, { "maxlength": 20 }] }
```

| Property | Type | Value |
| --- | --- | --- |
| `type` | string | The HTML input type |
| `attributes` | array | Optional. HTML attributes, one object each, such as `{ "maxlength": 20 }` |
| `readonly` | boolean | Optional. `true` shows the value without letting the user change it. |

Sends: the text the user typed.

### `switch`

An on and off switch.

```json
{ "id": "high_quality", "element": "switch", "label": "TRANSLATE.HIGH_QUALITY", "value": true }
```

Sends: `true` or `false`.

### `select`

A list of options.

```json
{
  "id": "bitrate",
  "element": "select",
  "label": "TRANSLATE.BITRATE",
  "value": { "value": 320, "label": "320 kbit/s" },
  "options": [
    { "value": 160, "label": "160 kbit/s" },
    { "value": 320, "label": "320 kbit/s" }
  ]
}
```

| Property | Type | Value |
| --- | --- | --- |
| `options` | array | The options, each `{ "value": ..., "label": "..." }` |
| `value` | object | The selected option, in the same shape |

Sends: the selected option, `{ "value": 320, "label": "320 kbit/s" }`.

### `button`

A button that acts at once, without **Save**.

```json
{
  "id": "clear_cache",
  "element": "button",
  "label": "TRANSLATE.CLEAR_CACHE",
  "onClick": { "type": "controller", "endpoint": "music_service/my_service", "method": "clearCache", "data": {} }
}
```

| Property | Type | Value |
| --- | --- | --- |
| `onClick` | object | What the button does. See the table below. |
| `onClick.askForConfirm` | object | Optional. `{ "title": "...", "message": "..." }` asks the user to confirm first. |
| `button_label` | string | Optional. The text on the button. Default: `label`. |
| `attributes` | array | Optional. HTML attributes, as for `input` |

| `onClick.type` | Does | Other properties |
| --- | --- | --- |
| `controller` | Calls a method of a plugin with `data` | `endpoint` (`<type>/<id>`), `method`, `data` |
| `emit` | Sends a socket.io message to Volumio | `message`, `data` |
| `openUrl` | Opens a web page in a new tab | `url` |

Sends: nothing. The button does not take part in **Save**.

### `equalizer`

One or more sliders.

```json
{
  "id": "eq",
  "element": "equalizer",
  "label": "TRANSLATE.EQUALIZER",
  "config": {
    "orientation": "vertical",
    "bars": [
      { "min": -12, "max": 12, "step": 1, "value": 0, "tooltip": "always" },
      { "min": -12, "max": 12, "step": 1, "value": 3, "tooltip": "always" }
    ]
  }
}
```

| Property | Type | Value |
| --- | --- | --- |
| `config.orientation` | string | `vertical` or `horizontal` |
| `config.bars` | array | One object per slider |
| `bars[].min`, `bars[].max`, `bars[].step` | number | The range and the step |
| `bars[].value` | number or array | The position. With `range: true`, two numbers. |
| `bars[].range` | boolean | Optional. `true` makes the slider select a range. |
| `bars[].ticks`, `bars[].ticksLabels`, `bars[].ticksPositions` | array | Optional. Fixed positions, their labels, and where they sit, from 0 to 100 |
| `bars[].tickSnapBounds` | number | Optional. How close the slider snaps to a tick |
| `bars[].tooltip` | string | `always`, `show` or `hide` |

Sends: an array with the `value` of each bar.

## Text and translations

Every text property can be a `TRANSLATE.` key, such as `"label": "TRANSLATE.GREETING"`. `i18nJson` replaces it with the value of `GREETING` in `i18n/strings_<language>.json`, or in `i18n/strings_en.json` when the user's language has no such key. Keys can be nested one level deep: `TRANSLATE.ACCOUNT.USERNAME` reads `{ "ACCOUNT": { "USERNAME": "Username" } }`.

## Related

- [Add a settings page](/plugins/how-to/settings-page)
- [index.js methods](/plugins/reference/index-js#getuiconfig)
