Get the position of a paragraphs entity in a nested template I try to build an accordion or slider element with Paragraphs.

Therefore I create a Slider element which had slides. Unfortunately the first element should always looks different. I can do this with a CSS class, but how to figure out which is the first slide?

Slider:

&lt;div class="feature-slider"&gt;
    &lt;div class="feature-slider__slides"&gt;     
        &lt;div class="feature-slider__slides-container"&gt;
            {{ content.field_feature_slider_slides }}
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


Slide (which will loaded through Drupal Magic):

&lt;div class="feature-slide {% if pos == 1 %}feature-slide--active{% endif %}"&gt;
  ...
&lt;/div&gt;


How can I get/set/access a variable (here pos) with the current position of the loop?

The Slider uses Paragraphs to add several Slides. The is a template for the slider paragraph--slider.html.twig and paragraph--slide.html.twig for the slides. No For-Loops are involved here. Drupal/Paragraphs rendering the slides through the template with content.field_feature_slider_slides from the slider.
For the Slide, are overriding the default field.html.twig template?
If yes, then you can use the Twig Loop variables:
https://twig.symfony.com/doc/2.x/tags/for.html
e.g. loop.first