Skip to main content
Version: 13.x (Current)

Breadcrumbs

<bk-breadcrumbs></bk-breadcrumbs>

breadcrumbs

The Breadcrumbs provide a visual representation of the the current nesting path, and allows to go back to any nesting level.

How to configure

The Breadcrumbs component should be supplied with a data-schema containing field labels from the underlying data. These labels are used to display the nesting path in the provided visual representation.

{
"tag": "bk-breadcrumb",
"properties": {
"dataSchema": {
"type": "object",
"properties": {
"colors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"r": {"type": "number"},
"g": {"type": "number"},
"b": {"type": "number"}
}
}
}
}
}
}
}

Examples

A Breadcrumbs component configured like:

{
"tag": "bk-breadcrumb",
"properties": {
"dataSchema": {
"type": "object",
"properties": {
"product": {
"type": "object",
"label": {
"en": "Product",
"it": "Prodotto"
},
"dataSchema": {
"type": "object",
"properties": {
"colors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"r": {"type": "number"},
"g": {"type": "number"},
"b": {"type": "number"}
}
}
}
}
}
}
}
}
}
}

upon receiving two nested-navigation-state/push events with payload including selectedKey property like:

{
"selectedKey": "product"
}

and

{
"selectedKey": "colors"
}

(which notify the request to enter the visualization of nested field product and nested field colors respectively), and assuming the browser language setting to be set to english,

visualizes a nesting path that can be represented by a string like:

<home-icon>/Product/Colors

API

Properties & Attributes

propertyattributetypedefaultdescription
dataSchema-ExtendedJSONSchema7Definition-data schema describing the fields of the collection to display
showHomeshow-homebooleantruetoggles visualization of a "home" icon at breadcrumbs 0-level

Listens to

eventaction
nested-navigation-state/pushupdates the representation of the nesting path by adding one step
nested-navigation-state/backupdates the representation of the nesting path by removing the specified number of steps
display-dataattempts to recreate current nesting path with new data. If fails, goes back to 0-level

Emits

eventdescription
nested-navigation-state/backnotifies to go back the specified number of steps in the nesting path