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>
<ul class="icon-list inline">
<li class="active">
<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>
<div class="display-switcher">
<span>View the results</span>
<ul class="icon-list inline">
<li class="active">
<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 {
@include medium-text();
align-items: center;
margin-bottom: 60px;
@include phablet {
display: flex;
}
ul {
margin-bottom: 0;
&.icon-list.inline {
li {
@include medium-text();
margin-right: 20px;
&:not(.active) {
i {
@include theme("color", "color-primary", "link-color");
}
}
}
}
}
> span {
display: block;
margin-right: 20px;
}
}