Alphadex An alphabet-based navigation pattern.

An alphadex is used to navigate alphabetically within a page. It is comprised of single character (e.g. A, B, C) buttons that link to a corresponding alphabetized section.

Table of contents


Usage guidelines

When to use
  • An alphadex is used to alphabetically filter through long lists of many items. If the items are sorted alphabetically, including an alphadex at the top of the list will help with discovery and organization.

Variations

Range

When space is limited, or when the data being navigated with the alphadex is unevenly distributed, consider using the range variation. This variation groups multiple characters into each button.

Mobile

At the smallest breakpoints, use the mobile variation of the alphadex, which is a select menu with letters for each section. Only show letters in this version of the alphadex if they have corresponding sections. Use the mobile attribute to render the mobile alphadex and the letters attribute to manually set the letters to those with corresponding sections.


Attributes

An asterisk next to a value denotes that it is the default value for that attribute. Unless noted otherwise, attributes should be added to the component element directly. Boolean attributes work based on their presence or absence from the component.

<res-component booleanAttribute stringAttribute="parameter">    
  <child-element></child-element>
</res-component>
AttributeTypeDescription
lettersstringString of letters and characters to add to index (defaults to full alphabet)
activestringActive letter or character
rangebooleanUse a range of letters instead of individual letters (always 0-1, A-Z)
mobilebooleanSwitches to small screen dropdown

API

NameTypeDataDescription
letterspropertystringGet/set available letters
activepropertystringGet/set active character
rangepropertybooleanGet/set range style
mobilepropertybooleanGet/set mobile style

Events

EventDetailReturns
changedetail.letterNewly active letter

Notes

Depends on:

History

VersionNote
0.21.0Add 1 pixel to width of range alphadex cells to prevent stacking
0.12.0Apply new spacing scale.
0.11.0Update event from alphadex:change to change
0.10.0Color update
0.7.0Initial build to spec.