Use the display switcher component when a page reload is triggered to let users:
For example:
Do not use the display switcher component when no page reload is triggered. In this case, use tabs instead.
Furthermore, do not use a page reload and the display switcher component:
Alternative to using a display switcher component:
The display switcher shows the display modes or the sections of content that are available. Each display mode or section of content is presented with an icon and a label.
The display mode or section of content that is currently active is clearly indicated. By default, the first display mode is always active.
When clicking another display mode, a page reload is trigger and the content is presented in a different way or the other section of content is shown. The display switcher again clearly indicates the new active display mode or section of content.
<div class="display-switcher">
<span>{{ 'View the results' }}</span>
{% include '@list' with {
'type': 'icon-list',
'icon_items': [
'<i class="icon-document" aria-hidden="true"></i><strong>As list</strong>',
'<i class="icon-marker" aria-hidden="true"></i><a href="javascript:(void);">On map</a>',
],
'modifier': 'inline'
} %}
</div>
<div class="display-switcher">
<span>View the results</span>
<ul class="icon-list inline">
<li><i class="icon-document" aria-hidden="true"></i><strong>As list</strong></li>
<li><i class="icon-marker" aria-hidden="true"></i><a href="javascript:(void);">On map</a></li>
</ul>
</div>
/* No context defined. */
.display-switcher {
margin-bottom: 1.6rem;
@include phablet {
display: flex;
}
ul {
margin-bottom: 0;
}
> span {
display: block;
margin-right: .6rem;
}
}