Skip to main content
Neighborhood Design System v5.1.0

Breadcrumb

Ready

A navigation component that displays the current page's location in a hierarchical structure, allowing users to navigate back to parent pages.

Preview

Open in Storybook (opens in new tab)

Code

Install
npm install @fbin-web/neighborhood-core
Import
import { NbhdBreadcrumb } from '@fbin-web/neighborhood-core';
Usage
<nbhd-breadcrumb separator="arrow"> </nbhd-breadcrumb>

<script>
  document.querySelector('nbhd-breadcrumb').items = [
    {
      label: 'Home',
      href: '/',
    },
    {
      label: 'Category',
      href: '/product',
    },
    {
      label: 'Subcategory',
      href: '/product/faucet',
    },
    {
      label: 'Product',
      href: '/product/faucet/0001',
    },
  ];
</script>

Properties

PropertyAttributeTypeDefaultDescription
itemsitemsBreadcrumbContent[]—An array of objects with the following properties: label (for the text), href (for the link)
labellabelstringBreadcrumbAccessible name of the breadcrumb navigation landmark.
cssClasscss-classstring—Additional CSS class to apply to the component
separatorseparatorslasharrownoneslashType of separator to display between breadcrumb items
marginTopmargin-topnonesmallmediumlargenoneTop margin spacing
marginBottommargin-bottomnonesmallmediumlargenoneBottom margin spacing
paddingToppadding-topdefaultnonesmallmediumlargedefaultTop padding spacing
paddingBottompadding-bottomdefaultnonesmallmediumlargedefaultBottom padding spacing
surfacesurfacenoneprimarysecondaryinverseinverse-secondaryprimarySurface to apply to the component

The BreadcrumbContent interface defines the structure for individual breadcrumb items.

Events

Events emitted by the breadcrumb component.

NameDescriptionEvent Detail
nbhd-breadcrumb-clickFired when a breadcrumb link is clicked.{ from: "breadcrumb", label: string, href?: string, originalEvent: Event }

CSS Parts

NameDescription
baseThe root nav element containing the breadcrumb items.
listThe
    list of breadcrumb items.
itemEach
  • , holding an item and its separator. The last item has aria-current="page".
  • separatorThe separator slot element rendered between breadcrumb items when the separator is not set to none.
    linkThe nbhd-link elements rendered for breadcrumb items with an href.
    textThe nbhd-text elements rendered for breadcrumb items without an href.
    nbhd-breadcrumb::part(base) {
      /* your styles */
    }

    CSS Properties

    Set these on nbhd-breadcrumb or an ancestor to override the defaults. Token is the design token a default comes from and Value is what it resolves to in core Neighborhood; brands may override them. Properties that adapt to surface follow the light or inverse surface they sit on until you set them.

    PropertyTokenValue Copy
    --nbhd-breadcrumb-alignItems—center
    --nbhd-breadcrumb-display—flex
    --nbhd-breadcrumb-flexDirection—row
    --nbhd-breadcrumb-flexWrap—wrap
    --nbhd-breadcrumb-gap--nbhd-space-312px
    --nbhd-breadcrumb-host-display—block
    --nbhd-breadcrumb-inlineSize—100%
    --nbhd-breadcrumb-paddingBlock--nbhd-space-00px
    --nbhd-breadcrumb-paddingInline--nbhd-space-00px
    --nbhd-breadcrumb-separator-small-fontSize--nbhd-typography-bodySmall-fontSize0.875rem

    Dependencies

    Child components <nbhd-breadcrumb> renders internally. Import them too when you tree-shake.

    Used by

    Esc
    ↑ ↓ to move↵ to open