How can I add a wrapper to a group by in Drupal 8 views? I have a (drupal 8.3) view using group by that outputs html like:

&lt;div class="view-content"&gt;
  &lt;h3&gt;Category 1&lt;/h3&gt;
  &lt;div class="view-row"&gt;&lt;/div&gt;
  &lt;div class="view-row"&gt;&lt;/div&gt;
  &lt;div class="view-row"&gt;&lt;/div&gt;
  &lt;h3&gt;Category 2&lt;/h3&gt;
  &lt;div class="view-row"&gt;&lt;/div&gt;
  &lt;div class="view-row"&gt;&lt;/div&gt;
  &lt;div class="view-row"&gt;&lt;/div&gt;
&lt;/div&gt;


I would like to hook or template the group by to use a wrapper and achieve:

&lt;div class="view-content"&gt;
  &lt;div class="group-wrapper"&gt;
    &lt;h3&gt;Category 1&lt;/h3&gt;
    &lt;div class="view-row"&gt;&lt;/div&gt;
    &lt;div class="view-row"&gt;&lt;/div&gt;
    &lt;div class="view-row"&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="group-wrapper"&gt;
    &lt;h3&gt;Category 2&lt;/h3&gt;
    &lt;div class="view-row"&gt;&lt;/div&gt;
    &lt;div class="view-row"&gt;&lt;/div&gt;
    &lt;div class="view-row"&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


Any ideas how I can accomplish this using Bootstrap theme?
You can accomplish this by customizing the views-view-unformatted.html.twig file:


Use Twig debugging to determine which version of this template is currently being used. Most likely, it's views-view-unformatted.html.twig in /core/modules/views/templates
Copy that file to your theme's templates folder.
Rename the template to this: views-view-unformatted--your-view--your-display.html.twig where your-view is the machine name of your view and your-display is the machine name of your view display.
Add this code to the template file you created:

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

Flush your site's caches


Please note that spaces in your machine name are repalced with dashes in the name of the template file.