Alpha zoom template
Collapse the table of content
Expand the table of content

Alpha zoom template (HTML)

[ This article is for Windows 8.x and Windows Phone 8.x developers writing Windows Runtime apps. If you’re developing for Windows 10, see the latest documentation ]

Defines an item in a ListView that provides the zoomed out, alphabetical listing for a SemanticZoom. This template is for use with a ListView that has a grid layout. For additional templates, see Item templates for grid layouts and Item templates for list layouts.

To use the template

To use the template, copy the HTML and the CSS styles into your project. The HTML includes a ListView that's designed to be used with the template.


<!-- Item template -->
<div id="semanticZoomTemplate" data-win-control="WinJS.Binding.Template">
    <div class="semanticZoom">
 	    <h2 data-win-bind="innerText: text"></h2>

<!-- ListView -->
<div id="semanticZoomAlpha"
    data-win-options="{ itemTemplate: select('#semanticZoomTemplate'), layout: { type: WinJS.UI.GridLayout } }">


/* overall grid dimensions */
#semanticZoomAlpha {
    position: absolute;
    top: calc(50% - 210px); /* vertically center tiles */
    left: calc(50% - 630px); /* horizontally center tiles */
    width: 1260px;
    height: 430px;

    /* semantic zoom alpha template */
    #semanticZoomAlpha .win-container {
        margin: 5px 10px;

/* individual item */
.semanticZoom {
    color: white;
    width: 140px;
    height: 52px;
    overflow: hidden;
    padding: 9px 15px;
    white-space: nowrap;
    display: -ms-flexbox;
    -ms-flex-pack: end;
    -ms-flex-direction: column;
    background-color: rgba(70,23,180,1.0);

/* High Contrast */
@media (-ms-high-contrast) {
    /* add a border to the item */
    .semanticZoom {
        padding: 8px;
        color: ButtonText;
        background-color: ButtonFace;
        border: 2px solid ButtonText;

    /* outline shown on mouse hover */
    #semanticZoomAlpha .win-container:hover {
        outline: 3px solid Highlight;

    /* use high contrast colors for hover state */
    .semanticZoom:hover {
        background-color: Highlight;
        color: HighlightText;
        border-color: HighlightText;

    /* style the focus visual for edge-to-edge items */
    #semanticZoomAlpha .win-focusedoutline {
        outline-color: WindowText;

Related topics

Item templates for grid layouts
Item templates for list layouts



© 2018 Microsoft