Breadcrumb
Display a trail of links separated by symbols
Use the Breadcrumb
component to show hierarchical path from the homepage to the current page. They’re not only useful for navigation, but can also improve SEO by helping search engines better understand the structure of your site. Breadcrumbs are especially useful in complex websites or apps with multiple layers of content, such as e-commerce sites or online documentation platforms.
To use the Breadcrumb
component, you must pass an items
prop to the component that references the breadcrumb items as an array of objects, where each object describes a breadcrumb link. Each object can have the following properties:
icon
: Sets an icon for the anchor.label
: Sets a label for the anchor.href
: Sets a link for the anchor.target
: Sets the target of the anchor.
items
prop references an array with a single element, the breadcrumb will not act as a link, as the item will be treated as the current page. Likewise, last items in the array will be treated as the current page, therefore, href
attributes will have no effect. Breadcrumbs with Icons
The icon can be an imported SVG string. You can import icons from webcoreui/icons
. For Astro components, you can also reference the icon type. For available icons in Webcore, see the documentation of the Icon
component. Icons and labels are optional, meaning you can also create breadcrumbs with icons only.
Custom Separators
To use a custom separator, pass a string to the separator
prop on the Breadcrumb
component:
API
Prop | Purpose |
---|---|
items | Sets the breadcrumb items. |
items.icon | Sets an icon for the anchor. |
items.label | Sets a text for the anchor. |
items.href | Sets a link for the anchor. |
items.target | Sets the target of the anchor. |
separator | Sets a custom separator for the breadcrumb. |
className | Pass additional CSS classes for the breadcrumb. |
Request improvement for this page