# Use | default: for Optional Fallbacks

Use the `default` filter when a setting is optional and should fall back to another value.

```liquid
{% comment %} BAD: verbose conditional for optional field {% endcomment %}
{%- if section.settings.mobile_image != blank -%}
  {%- assign mobile_img = section.settings.mobile_image -%}
{%- else -%}
  {%- assign mobile_img = section.settings.image -%}
{%- endif -%}

{% comment %} GOOD: default filter handles nil/blank in one line {% endcomment %}
{%- assign mobile_img = section.settings.mobile_image | default: section.settings.image -%}
```

Common pattern for responsive settings where mobile is optional:

```liquid
{%- assign mobile_heading = section.settings.mobile_heading | default: section.settings.heading -%}
{%- assign mobile_text_size = section.settings.mobile_text_size | default: section.settings.text_size -%}
```

`| default:` returns the fallback when the input is nil, `false`, or empty string.
