Detect mobile with liquid

Hello,

I’m optimizing a theme and would like to render the content for the appropriate device.

Does anyone know if we have an object in liquid that returns whether the device is mobile or desktop?

For example:

{% if isMobile %}
{% comment %} Mobile content {% endcomment %}
{% else %}
{% comment %} Desktop content {% endcomment %}
{% endif %}

Thanks!

1 Like

I am interested in this as well, seems like this would be a no-brainer native feature.

3 Likes

This feature needs to be added. :+1:

2 Likes