Breadcrumbs
Overview
Complex applications often allow users to drill down from more general views into increasingly more detailed views. As the user drills downward through the hierarchy of views, they can quickly lose track of where they are in the process and may find it difficult to return to a higher level in the hierarchy of views.
Because of this, we want to ensure two things:
- The user understands where they are in the hierarchy of views.
- The user can quickly return to higher levels in the hierarchy of views.
Breadcrumbs are a great way to accomplish both of these goals without requiring much space in your view.
We support two types of breadcrumbs:
- Simple breadcrumbs perform an action when clicked, typically a navigation back up to a higher level in the navigation tree. Most breadcrumbs are the simple variety.
- Dropdown breadcrumbs display a dropdown menu when clicked. Each item in the dropdown menu perform an action when clicked, typically a navigation over to an adjacent level in the navigation tree.
Breadcrumbs at the Function View Level
Breadcrumbs are a horizontal list of links displayed at the top of the view, above the function title. Breadcrumbs include a segment for each level in a hierarchy of views. This hierarchy may start at the root of your application’s tree of views, or it may reflect only a local hub. The segments indicate the hierarchy from left-to-right, with more general views on the left and more specific views on the right. Each segment is separated by a delimiter character.
Every breadcrumb segment is a link to a higher level in the hierarchy. This helps the user to quickly jump back to higher levels in the hierarchy of views. The function title identifies the current view, which is the lowest level of the hierarchy. The title is not a link. It helps the user understand where they are in the overall process.
Breadcrumbs are not a replacement for your app’s primary navigation.
If there are multiple paths through your app’s navigation tree down to the current page, the breadcrumbs should only display one path down to this page, regardless of how the user navigated here.
Breadcrumbs display a static link to the current location in your app’s hierarchical structure, not the user’s browsing history.
Do not use breadcrumbs in parts of your application where there is no hierarchy, since there is nothing to link back to in these sections.
On mobile devices, avoid wrapping in your breadcrumbs since this uses up valuable vertical space at the top of the view. If you notice wrapping, try shortening the text of individual breadcrumb segments or reduce the depth of the breadcrumbs to only a couple of levels up from the current view. This is not as much of a concern for larger screen widths since there is generally more room for the breadcrumbs to spread out.
Breadcrumbs at the Display Block Level
While less common, breadcrumbs are also supported within a display block. Breadcrumbs at this level don’t navigate from the current view to another view; instead, they are used for controlling navigation for local drill-down operations that take place fully within a display block. Breadcrumbs at the display block level should appear at the top of the display block, below the display block title and toolbar.
While breadcrumbs at the function view level show all levels in the hierarchy except for the last — the function title acts as the last breadcrumb — breadcrumbs at the display block level are not tied to the display block title and should include all levels of the hierarchy.
Development
Web component development
Component reference
rui-breadcrumbs
Container for rui-breadcrumb elements
Name | Type | Default | Description |
---|---|---|---|
slot | string | '' | Set to function-breadcrumbs to arrange breadcrumb above page title in function view. |
rui-breadcrumb
Breadcrumb element to show each level of hierarchy. Use this for each breadcrumb at either the function view level or at the display block level.
Name | Type | Default | Description |
---|---|---|---|
text | string | '' | Text displayed in the breadcrumb |
route | string | '' | If the breadcrumb links to a view within the app, assign the route for that view to this attribute. You must prefix the route with “/#” in Angular applications. |
rui-click | event | If the breadcrumb executes code when clicked, define a rui-click event handler for it. | |
isClickable | boolean | true | Specifies whether the breadcrumb is clickable or not. You should leave this at its default value of true other than very rare cases where a breadcrumb provides contextual info but isn’t clickable. |
rui-breadcrumb-dropdown
Breadcrumb that displays a dropdown menu when pressed.
Name | Type | Default | Description |
---|---|---|---|
text | string | '' | Text displayed in the breadcrumb |
rui-button-menu-option
Option in dropdown menu.
Name | Type | Default | Description |
---|---|---|---|
text | string | '' | Text displayed in the dropdown option |
isDisabled | boolean | false | Specifies whether the dropdown option is disabled. |
route | string | '' | If the dropdown option links to a view within the app, assign the route for that view to this attribute. You must prefix the route with “/#” in Angular applications. |
rui-menu-option-click | event | If the dropdown option executes code, define a rui-click event handler for it. |
rui-button-menu-separator
Separator between groups of options in a dropdown menu
Implementation
Begin by importing the rui-layout
module into your application.
Breadcrumbs at the function level
For breadcrumbs at the function view level, nest instances of rui-breadcrumb
within the rui-breadcrumbs
tag.
Do not include the lowest level of the hierarchy for breadcrumbs at the function view level, since the function view title acts as the final breadcrumb in the hierarchy.
Breadcrumb dropdowns
Most breadcrumbs perform a simple navigation when clicked. But breadcrumbs that link from one “spoke” to another in drill-down navigation scenarios display a dropdown menu of all available sibling spoke navigation options when clicked.
Angular wrapper development
Wrapper reference
jha-function-breadcrumbs
Container for jha-breadcrumb elements at the function view level
jha-breadcrumbs
Container for jha-breadcrumb elements at the display block or group box level
jha-breadcrumb
Breadcrumb element to show each level of hierarchy. Use this for each breadcrumb at either the function view level or at the display block level.
Name | Type | Default | Description |
---|---|---|---|
jhaText | string | '' | Text displayed in the breadcrumb |
jhaTooltip | string | '' | Tooltip to display when the mouse hovers over the breadcrumb |
jhaRouterLink | string | '' | If the breadcrumb links to a view within the app, assign to the route for that view to this attribute. If the breadcrumb executes code, define a click event handler for it. Otherwise if the breadcrumb links to a URL outside of the app, assign the outside URL to the jhaExternalUrl attribute. |
jhaRouterLinkActiveOptions | object | {} | If the active router link options need to be set, use this attribute. Pass in an object just like you would for the routerLinkActiveOptions directive. For example: |
jhaQueryParams | object | {} | If the breadcrumb links need to include query parameters, populate the jhaQueryParams with an object that includes your parameters. For example: |
jhaExternalUrl | string | '' | If the breadcrumb links to a view within the app, set its jhaRouterLink to the route for that view. If the breadcrumb executes code, define a click event handler for it. Otherwise if the breadcrumb links to a URL outside of the app, assign that URL to this attribute. |
jhaExternalUrlInNewWindow | boolean | true | If the breadcrumb links to a URL outside of the app, set this to true if that link should be opened in a new tab/window, otherwise bind this to false. |
isClickable | boolean | true | Specifies whether the breadcrumb is clickable or not. You should leave this at its default value of true other than very rare cases where a breadcrumb provides contextual info but isn’t clickable. |
jha-breadcrumb-dropdown
Breadcrumb that displays a dropdown menu when pressed.
Name | Type | Default | Description |
---|---|---|---|
jhaText | string | '' | Text displayed in the breadcrumb |
jhaTooltip | string | '' | Tooltip to display when the mouse hovers over the breadcrumb |
jha-breadcrumb-menu-option
Option in dropdown menu.
Name | Type | Default | Description |
---|---|---|---|
jhaText | string | '' | Text displayed in the dropdown option |
jhaTooltip | string | '' | Tooltip displayed when the mouse hovers over the dropdown option |
jhaIsDisabled | boolean | false | Specifies whether the dropdown option is disabled. |
jhaClick | event | If the dropdown option executes code, define a jha-click event handler for it. | |
jhaRouterLink | string | '' | If the dropdown option links to a view within the app, this specifies the route for that view. |
jhaExternalUrl | string | '' | If the dropdown option links to a URL outside of the app, this specifies the URL. |
jhaExternalUrlInNewWindow | boolean | true | If the dropdown option links to a URL outside of the app, leave this at its default value of true if that link should open in a new tab/window, otherwise bind this to false. |
jha-breadcrumb-menu-separator
Separator between groups of options in a dropdown menu
Implementation
Begin by importing the JhaLayoutModule
module into your application.
Breadcrumbs at the function level
For breadcrumbs at the function view level, nest instances of jha-breadcrumb
within the jha-function-breadcrumbs
tag.
Do not include the lowest level of the hierarchy for breadcrumbs at the function view level, since the function view title acts as the final breadcrumb in the hierarchy.
Breadcrumb dropdowns
Most breadcrumbs perform a simple navigation when clicked. But breadcrumbs that link from one “spoke” to another in drill-down navigation scenarios display a dropdown menu of all available sibling spoke navigation options when clicked.
Breadcrumbs at the display block level
For the less common case of breadcrumbs at the display block level, nest instances of jha-breadcrumb
within the jha-breadcrumbs
tag. Position the breadcrumbs at the top of the display block, just below the title and toolbar if present.
Unlike breadcrumbs at the function view, you should include all levels of the hierarchy in the breadcrumbs, including the last level. The display block title is unrelated to breadcrumbs at the display block level.
Component playground
Design
Figma design
Dev Component | Design Component Name |
---|---|
Function view with space for breadcrumbs | Add RUI / Layout / Function View and switch on “Has Breadcrumbs” |
Breadcrumb | RUI / Layout / Breadcrumb |
Breadcrumb dropdown | RUI / Layout / Breadcrumb Dropdown |
For breadcrumbs at the function level:
- Start by adding a function view with space for breadcrumbs.
- Drag in instances of the Breadcrumb or Breadcrumb Dropdown components as needed. Change the text for each to an appropriate value.
- For breadcrumbs at the function level, the function title itself acts as the active breadcrumb. Do not add a separate active breadcrumb at this level.
- For breadcrumbs at the function level, position the breadcrumb list 5 pixels above the function title.
For breadcrumbs at the content level:
- Add one or more inactive breadcrumbs using the Breadcrumb component.
- Add exactly one active breadcrumb to the right of all the inactive breadcrumbs.
- Vertically center the list of breadcrumbs.
Adobe XD design
- Sample App - Breadcrumbs
Dev Component | Design Component Name |
---|---|
Function view with space for breadcrumbs | JHA / Layout / Function View for Breadcrumbs |
Inactive breadcrumb at either the function level or the content level | JHA / Layout / Breadcrumb |
Active breadcrumb at the content level | Add text and apply the “JHA / Text / Breadcrumb Active” character style. |
Breadcrumb dropdown | JHA / Layout / Breadcrumb Dropdown |
For breadcrumbs at the function level:
- Start by adding a function view with space for breadcrumbs.
- Drag in instances of the Breadcrumb or Breadcrumb Dropdown components as needed. Change the text for each to an appropriate value.
- For breadcrumbs at the function level, the function title itself acts as the active breadcrumb. Do not add a separate active breadcrumb at this level.
- For breadcrumbs at the function level, position the breadcrumb list 5 pixels above the function title.
For breadcrumbs at the content level:
- Add one or more inactive breadcrumbs using the Breadcrumb component.
- Add exactly one active breadcrumb to the right of all the inactive breadcrumbs.
- Vertically center the list of breadcrumbs.