ais-breadcrumb
<ais-breadcrumb :attributes="string[]" // Optional parameters root-path="string" separator="string" :transform-items="function" :class-names="object" />
About this widget
The breadcrumb
widget is a secondary navigation scheme that lets the user see where the current page is in relation to the facet’s hierarchy.
It reduces the number of actions a user needs to take to get to a higher-level page and improves the discoverability of the app or website’s sections and pages. It is commonly used for websites with lot of data, organized into categories with subcategories.
All attributes (lvl0
, lvl1
in this case) must be declared as attributesForFaceting in your Algolia settings.
Examples
1
2
3
4
5
6
7
8
<ais-breadcrumb
:attributes="[
'categories.lvl0',
'categories.lvl1',
'categories.lvl2',
'categories.lvl3',
]"
/>
Props
attributes
|
type: string[]
Required
An array of attributes to generate the breadcrumb. |
||
Copy
|
|||
root-path
|
type: string
Optional
The path to use if the first level is not the root level. |
||
Copy
|
|||
separator
|
type: string
default: >
Optional
The level separator used in the records. |
||
Copy
|
|||
transform-items
|
type: function
Optional
Modifies the items being displayed, for example, to filter or sort them. It takes items as argument and expects them back in return. |
||
Copy
|
|||
class-names
|
type: object
Optional
The CSS classes to override.
|
||
Copy
|
Customize the UI
default
|
The slot to override the complete DOM output of the widget. Scope
Where each item is an
|
||
Copy
|
|||
rootLabel
|
The slot to override the root label. |
||
Copy
|
|||
separator
|
The slot to override the separator. |
||
Copy
|
If SEO is critical to your search page, your custom HTML markup needs to be parsable:
- use plain
<a>
tags withhref
attributes for search engines bots to follow them, - use semantic markup with structured data when relevant, and test it.
Refer to our SEO checklist for building SEO-ready search experiences.
HTML output
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<div class="ais-Breadcrumb">
<ul class="ais-Breadcrumb-list">
<li class="ais-Breadcrumb-item">
<a class="ais-Breadcrumb-link" href="#">Home</a>
</li>
<li class="ais-Breadcrumb-item">
<span class="ais-Breadcrumb-separator" aria-hidden="true">></span>
<a class="ais-Breadcrumb-link" href="#">Cooking</a>
</li>
<li class="ais-Breadcrumb-item ais-Breadcrumb-item--selected">
<span class="ais-Breadcrumb-separator" aria-hidden="true">></span>
Kitchen textiles
</li>
</ul>
</div>