Breadcrumbs are a secondary navigation pattern that helps users understand their current location within a website or application hierarchy. They provide a clear path back to higher-level pages and improve overall navigation experience by showing the relationship between pages.
✅ Use breadcrumbs when:
- Your site or application has a deep hierarchical structure (3+ levels)
- Users need to understand their current location in the site structure
- You want to provide an easy way to navigate back to parent pages
- Working with multi-step processes or workflows
- Displaying content categorization (e.g., Products > Electronics > Smartphones)
- Building e-commerce product pages or content management systems
❌ Don't use breadcrumbs for:
- Single-level navigation (use primary navigation instead)
- Linear processes where users shouldn't skip steps
- Mobile-first designs where space is extremely limited
- Sites with flat information architecture
- When the primary navigation already provides clear hierarchy
A standard breadcrumb showing the page hierarchy with clickable links:
Customize the visual separator between breadcrumb items using the separator
slot:
Use the mobile
attribute to show only the first and last items on smaller screens:
Use the variant="inverted"
attribute for breadcrumbs on dark backgrounds:
Breadcrumbs are designed with accessibility in mind:
- Semantic HTML: Uses proper
<nav>
and<ol>
structure for screen readers - ARIA labeling: Supports
aria-label
andaria-labelledby
attributes - Current page indication: Automatically adds
aria-current="page"
to the last item - Keyboard navigation: Full keyboard support using Tab navigation
- Screen reader friendly: Proper list semantics and separator handling
<!-- Always provide an accessible name -->
<dap-ds-breadcrumb aria-label="You are here">
<!-- Or use aria-labelledby -->
<dap-ds-breadcrumb aria-labelledby="page-title">
<!-- Use descriptive link text -->
<dap-ds-breadcrumb-item href="/products">
All Products <!-- Instead of "Products" or "Back" -->
</dap-ds-breadcrumb-item>
Breadcrumbs automatically adapt to different screen sizes:
- Desktop: Shows full breadcrumb trail
- Mobile with
mobile
attribute: Shows only first and last items - Mobile without
mobile
: Allows horizontal scrolling
Design your URLs to support breadcrumb navigation:
// Good URL structure for breadcrumbs
/products/electronics/smartphones/iphone-15-pro
// Breadcrumb can be automatically generated from URL segments
Home > Products > Electronics > Smartphones > iPhone 15 Pro
// Example: Building breadcrumbs from route data
const routeSegments = [
{ name: 'Home', href: '/' },
{ name: 'Products', href: '/products' },
{ name: 'Electronics', href: '/products/electronics' },
{ name: 'Smartphones' } // Current page, no href
];
const breadcrumbHTML = html`
<dap-ds-breadcrumb aria-label="Page navigation">
${routeSegments.map(segment => html`
<dap-ds-breadcrumb-item href="${segment.href || nothing}">
${segment.name}
</dap-ds-breadcrumb-item>
`)}
</dap-ds-breadcrumb>
`;
- Keep breadcrumb trails reasonably short (5-7 levels maximum)
- Use semantic URLs that match the breadcrumb structure
- Consider implementing breadcrumb caching for complex hierarchies
- Avoid overly long breadcrumb item names that may wrap
import { DapDSBreadcrumb } from 'dap-design-system/dist/dds'
import { DapDSBreadcrumbReact } from 'dap-design-system/dist/react'
Property | Type | Default | Description |
---|---|---|---|
variant | string | 'normal' | |
mobile | boolean | false | Mobile version of the breadcrumb |
ariaLabelledBy | string , undefined | The aria-labelledby of the breadcrumb |
Name | Description |
---|---|
(default) | The content of the breadcrumb. |
separator | The separator between breadcrumb items. Default is '/'. |
No custom events available.
Part Name | Description |
---|---|
base | The main breadcrumb container. |
separator | The separator of the breadcrumb. |
Property Name | Description |
---|---|
--dds-breadcrumb-width | The width of the breadcrumb container. Default is 100%. |
--dds-breadcrumb-overflow-x | The horizontal overflow behavior of the breadcrumb. Default is auto. |
--dds-breadcrumb-transition | The transition property for the breadcrumb. Default is 'all 0.2s ease-in-out'. |
--dds-breadcrumb-list-display | The display property of the breadcrumb list. Default is flex. |
--dds-breadcrumb-list-flex-wrap | The flex-wrap property of the breadcrumb list. Default is nowrap. |
--dds-breadcrumb-list-align-items | The align-items property of the breadcrumb list. Default is center. |
--dds-breadcrumb-list-min-width | The minimum width of the breadcrumb list. Default is max-content. |
Property | Type | Default | Description |
---|---|---|---|
href | string , undefined | The URL of the breadcrumb item. | |
target | '_blank' , '_self' , '_parent' , '_top' | The target of the breadcrumb item. | |
rel | string | 'noreferrer noopener' | The rel of the breadcrumb item link. |
disabled | boolean | false | Whether the breadcrumb item is disabled. |
variant | 'normal' , 'inverted' | 'normal' | The variant of the breadcrumb item. |
Name | Description |
---|---|
(default) | The content of the breadcrumb item. |
separator | The separator between breadcrumb items. Default is an arrow-right-s-line icon. |
No custom events available.
Part Name | Description |
---|---|
base | The main breadcrumb item container. The li element. |
link | The link of the breadcrumb item. The dds-link component. |
link-base | The base part of the link part. The dds-link components base part. |
item-nolink | The item of the breadcrumb item without a link. The span element. |
separator | The separator of the breadcrumb item. |
Property Name | Description |
---|---|
--dds-breadcrumb-item-display | The display property of the breadcrumb item. Default is inline-flex. |
--dds-breadcrumb-item-flex-wrap | The flex-wrap property of the breadcrumb item. Default is nowrap. |
--dds-breadcrumb-item-align-items | The align-items property of the breadcrumb item. Default is center. |
--dds-breadcrumb-item-color | The text color of the breadcrumb item. Default is the design system's text-neutral-base. |
--dds-breadcrumb-item-transition | The transition property for the breadcrumb item. Default is 'all 0.2s ease-in-out'. |
--dds-breadcrumb-item-padding | The padding of the breadcrumb item. Default is the design system's spacing-200. |
--dds-breadcrumb-item-font-size | The font size of the breadcrumb item. Default is the design system's font-sm. |
--dds-breadcrumb-item-font-weight | The font weight of the breadcrumb item. Default is the design system's font-weight-medium. |
--dds-breadcrumb-item-font-weight-bold | The bold font weight of the breadcrumb item. Default is the design system's font-weight-bold. |
--dds-breadcrumb-item-separator-color | The color of the separator. Default is the design system's text-neutral-disabled. |
--dds-breadcrumb-item-link-color | The color of the link. Default is the design system's link-neutral-enabled. |
--dds-breadcrumb-item-inverted-color | The text color when inverted. Default is the design system's text-neutral-inverted. |
--dds-breadcrumb-item-inverted-link-color | The link color when inverted. Default is the design system's text-neutral-inverted. |