---
title: ValidSelectDefault
description: >-
  Identifies select and radio setting values that aren't one of the setting's
  options.
source_url:
  html: >-
    https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/valid-select-default
  md: >-
    https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/valid-select-default.md
api_name: liquid
---

# ValidSelectDefault

Identifies values for [`select`](https://shopify.dev/docs/storefronts/themes/architecture/settings/input-settings#select) and [`radio`](https://shopify.dev/docs/storefronts/themes/architecture/settings/input-settings#radio) settings that aren't one of the setting's `options`. Theme Check compares each value with the `value` of each option, not with its `label`.

This check covers the following values:

* In the `{% schema %}` tag of a section or theme block, the `default` of each `select` and `radio` setting, including the settings of blocks that the schema defines.
* In the same `{% schema %}` tag, the values that `presets` give the file's own settings and the settings of their blocks, including nested and static blocks. The same applies to the values in a section's `default`.
* In `config/settings_schema.json`, the `default` of each `select` and `radio` setting.

For a block in a preset or a section's `default`, Theme Check needs the settings of the block's type:

* If the schema defines its own blocks, which have a `name` in the schema's `blocks` array, then Theme Check reads the settings of the block with that type.
* Otherwise, Theme Check reads the settings from the block file in the `blocks` directory. If the block file doesn't exist, then Theme Check doesn't check the block's values.

***

## Examples

The following examples contain code snippets that either fail or pass this check.

### ✗ Fail

In the following example, `middle` isn't one of the option values, so Theme Check reports `Default value "middle" for setting "alignment" is not one of the valid options: "flex-start", "center", "flex-end".`:

## sections/example.liquid

```liquid
{% schema %}
{
  "name": "Example",
  "settings": [
    {
      "type": "select",
      "id": "alignment",
      "label": "Alignment",
      "options": [
        { "value": "flex-start", "label": "Left" },
        { "value": "center", "label": "Center" },
        { "value": "flex-end", "label": "Right" }
      ],
      "default": "middle"
    }
  ]
}
{% endschema %}
```

In the following example, the preset uses the label `Right` instead of the option value `flex-end`, so Theme Check reports `Value "Right" for setting "alignment" is not one of the valid options: "flex-start", "center", "flex-end".`:

## sections/example.liquid

```liquid
{% schema %}
{
  "name": "Example",
  "settings": [
    {
      "type": "select",
      "id": "alignment",
      "label": "Alignment",
      "options": [
        { "value": "flex-start", "label": "Left" },
        { "value": "center", "label": "Center" },
        { "value": "flex-end", "label": "Right" }
      ],
      "default": "center"
    }
  ],
  "presets": [
    {
      "name": "Example",
      "settings": {
        "alignment": "Right"
      }
    }
  ]
}
{% endschema %}
```

In the following example, the section's preset gives a `group` block a value that isn't one of the options in `blocks/group.liquid`, so Theme Check reports `Value "top" for setting "alignment" is not one of the valid options: "flex-start", "center".` in the section file:

## blocks/group.liquid

```liquid
{% schema %}
{
  "name": "Group",
  "settings": [
    {
      "type": "select",
      "id": "alignment",
      "label": "Alignment",
      "options": [
        { "value": "flex-start", "label": "Left" },
        { "value": "center", "label": "Center" }
      ]
    }
  ],
  "blocks": [{ "type": "@theme" }]
}
{% endschema %}
```

## sections/example.liquid

```liquid
{% schema %}
{
  "name": "Example",
  "blocks": [{ "type": "@theme" }],
  "presets": [
    {
      "name": "Example",
      "blocks": [
        {
          "type": "group",
          "settings": {
            "alignment": "top"
          }
        }
      ]
    }
  ]
}
{% endschema %}
```

### ✓ Pass

In the following example, the default and the preset value are both option values:

## sections/example.liquid

```liquid
{% schema %}
{
  "name": "Example",
  "settings": [
    {
      "type": "select",
      "id": "alignment",
      "label": "Alignment",
      "options": [
        { "value": "flex-start", "label": "Left" },
        { "value": "center", "label": "Center" },
        { "value": "flex-end", "label": "Right" }
      ],
      "default": "center"
    }
  ],
  "presets": [
    {
      "name": "Example",
      "settings": {
        "alignment": "flex-end"
      }
    }
  ]
}
{% endschema %}
```

***

## Options

The following example contains the default configuration for this check:

```yaml
ValidSelectDefault:
  enabled: true
  severity: warning
```

| Parameter | Description |
| - | - |
| `enabled` | Whether this check is enabled. |
| `severity` | The [severity](https://shopify.dev/docs/storefronts/themes/tools/theme-check/configuration#check-severity) of the check. |

***

## Disabling this check

Disabling this check isn't recommended.

***
