How to use Sprig to filter categories using a dropdown
You need to apply the category filter to the entry query.
{% set categoryId = categoryId ?? '' %}

{% set entryQuery = craft.entries ({
    search: search,
    section: 'articles',
    limit: 2,
    relatedTo: categoryId,
}) %}

And also update the select field to match.
    &lt;select sprig name=&quot;categoryId&quot; id=&quot;category&quot; value=&quot;{{ categoryId }}&quot; class=&quot;form-control&quot;&gt;
      &lt;option value=&quot;&quot;&gt;Any&lt;/option&gt;
        {% for category in categories %}
          &lt;option value=&quot;{{ category.id }}&quot;&gt;{{ category }}&lt;/option&gt;
        {% endfor %}
    &lt;/select&gt;

See the Sprig filters video for an explanation of how to output and use categories as filters:
https://putyourlightson.com/sprig/videos#sprig-filters