How to numerate drupal views rows in twig? For css purpuses I want to add custom class name to the first item in view.

&lt;article class="myclass"&gt;&lt;/article&gt;
&lt;article&gt;&lt;/article&gt;
&lt;article&gt;&lt;/article&gt;


I need the number in views-view-fields--viewname.html.twig to make some logic expression like 

if(view-num == 1) {
    &lt;article class="myclass"&gt;&lt;/article&gt; 
} else { 
    &lt;article&gt;&lt;/article&gt;
}


or maybe in one of the variables I get in fields {{fields.view_number.content}}
The fields template is probably not the best place. Normally you would do this in the views style plugin. Grid has such options built in, for Unformatted you can add

loop.first ? 'views-row-first',


to  views-view-unformatted.twig.html:

{% if title %}
  &lt;h3&gt;{{ title }}&lt;/h3&gt;
{% endif %}
{% for row in rows %}
  {%
    set row_classes = [
      default_row_class ? 'views-row',
      loop.first ? 'views-row-first',
    ]
  %}
  &lt;div{{ row.attributes.addClass(row_classes) }}&gt;
    {{ row.content }}
  &lt;/div&gt;
{% endfor %}