--- url: https://developer.youcan.shop/themes/filters/arrays/sortKey.md --- # Sort Key Sorts an object by its keys. ## Example ::: details Data ```json { "options": { "size": "M", "color": "red", "material": "cotton" } } ``` ::: ```liquid {% assign options = options | sort_key %} {% for option in options %} {{- option[0] }}: {{ option[1] }} {% endfor %} ``` ::: tip Output ```html color: red material: cotton size: M ``` :::