Breadcrumb
Displays a breadcrumb navigation with responsive behavior (truncated on mobile, full on desktop).
Props
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
items | BreadcrumbItem[] | Yes | - | Array of breadcrumb items |
className | string | No | - | Additional CSS classes |
BreadcrumbItem Interface
interface BreadcrumbItem {
label: string;
href?: string;
}Usage
import Breadcrumb from '@/components/molecules/Breadcrumb';
<Breadcrumb
items={[
{ label: "Home", href: "/" },
{ label: "Blog", href: "/blog" },
{ label: "Current Post" }
]}
/>Features
- Responsive: Shows full breadcrumb on desktop, truncated (last 2 items) on mobile
- Schema.org markup: Includes proper microdata for SEO
- Accessible: Uses semantic HTML with ARIA labels
- Mobile optimization: Shows ellipsis (...) for truncated items on mobile
- Last item: Current page is not clickable (no href)
Behavior
- Desktop: Shows all breadcrumb items
- Mobile: Shows ellipsis + last 2 items if more than 2 items exist
- Last item is always non-clickable and styled differently
- Items are separated by ">" character
Notes
- Client-side component (uses
'use client') - Uses
useMemofor performance optimization - Includes schema.org BreadcrumbList markup for SEO