Properties
ariaLabel
Type: string
Default: breadcrumbs
Controls the aria-label
on the parent element (<nav>
).
Usage:
Rendered Component:
customBaseUrl
Type: string
In most cases it is not necessary to enter the base url, as this value is taken from the Astro Config.
If your project has special requirements that make it impossible to use base
, you can use customBaseUrl
to overwrite the base url used by Astro.
Usage:
Rendered Component:
crumbs
Type:
Default: []
This property expects an array of objects that describe the breadcrumbs “manually”. There are two required key value pairs: text: ''
and href: ''
, every additional pair will add an attribute to this specific element. For example: title: 'Part of the breadcrumb list'
, will add an title attribute.
Usage:
Rendered Component:
ellipsisAriaLabel
Type: string
Default: Show hidden navigation
aria-label
of the ellipsis button (.c-breadcrumbs__truncated-button
).
Usage:
Rendered Component:
indexText
Type: string
Default: Home
Label of the first nav element.
Usage:
Rendered Component:
linkTextFormat
Type: "lower" | "capitalized" | "sentence"
Controls the text transformation of all link texts.
lower
: Transforms the link text to lower case.- astro-breadcrumbs => astro breadcrumbs
capitalized
: Transforms the link text to capitalized case.- astro-breadcrumbs => Astro Breadcrumbs
sentence
: Transforms the link text to sentence case.- astro-breadcrumbs => Astro breadcrumbs
Usage:
Rendered Component:
mainBemClass
Type: string
Default: c-breadcrumbs
CSS BEM root class.
Usage:
Rendered Component:
schemaJsonScript
Type: boolean
Default: true
Enable or disable the schema.org JSON-LD script tag generation.
Usage:
Rendered Component:
Output:
truncated
Type: boolean
Default: false
With the setting true
, the breadcrumbs that no longer fit in a line are truncated and an ellipsis button is displayed.
Only the first element and the last element are displayed, with the ellipsis button in between.
A click on the ellipsis button shows all truncated elements.
The calculation is carried out using ResizeObserver and is therefore responsive.
The width of all elements is calculated together and compared with the available width. If the elements are larger than the available width, they are truncated.
Usage:
Rendered Component:
Deprecated Properties
baseUrl
Deprecated: v2.0.0
Type: string
Default: undefined
By default Astro-Breadcrumbs creates all links with relative urls. If you have other requirements you can use this property to customize the start of the url.
Usage:
trailingSlash
Deprecated: v2.0.0
Type: boolean
Default: false
If set to true
all links will have a trailing slash.
Usage: