Quick start guide and documentation
| Class | Element | Purpose |
|---|---|---|
.rsl-breadcrumb |
<ol> |
Main breadcrumb container |
.compact |
<ol> |
Smaller size variant (optional) |
.truncate |
<a> |
Truncate long labels with ellipsis (optional) |
| Attribute | Where | Purpose |
|---|---|---|
aria-label="breadcrumb" |
<nav> |
Identifies navigation as breadcrumb trail |
aria-current="page" |
Last <li> |
Indicates current page in the trail |
aria-label |
<a> (icon-only) |
Descriptive label for icon-only links |
aria-label to each link for screen reader accessibility.
.rsl-breadcrumb .truncate {
max-width: 150px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: inline-block;
vertical-align: bottom;
}
The separator between breadcrumb items is defined in CSS using the ::after pseudo-element. You can customize it:
/* Default separator is "/" */
.rsl-breadcrumb li:not(:last-child):after {
content: "/";
margin-left: 5px;
color: #6c757d;
}
/* Use ">" instead */
.rsl-breadcrumb li:not(:last-child):after {
content: ">";
}
/* Use icon */
.rsl-breadcrumb li:not(:last-child):after {
content: "\f054"; /* FontAwesome chevron-right */
font-family: "Font Awesome 5 Free";
font-weight: 900;
}
/* Change link colors */
.rsl-breadcrumb a {
color: #6E7BFF;
}
.rsl-breadcrumb a:hover {
color: #5a67d8;
}
/* Change separator color */
.rsl-breadcrumb li:not(:last-child):after {
color: #999;
}
/* Current page color */
.rsl-breadcrumb li[aria-current="page"] {
color: #495057;
}
<nav> element: Identifies the breadcrumb as a navigation landmarkaria-label="breadcrumb": Specifies the type of navigation for screen readers<ol> element: Ordered list represents the hierarchical structurearia-current="page": Marks the current location in the breadcrumb trail<a> elementScreen readers will announce:
<nav>aria-label contentaria-current="page"flex-wrap: wrap.rsl-breadcrumb class on the <ol> element. Separators are added via CSS ::after pseudo-elements.
:not(:last-child) to exclude the last item. Check that your markup doesn't have extra whitespace or elements.
.compact class for smaller screens, or implement the collapsed pattern for very long trails.