Breadcrumb Component — Astro
Navigation breadcrumbs with separator customization and responsive behavior
Breadcrumb Component
An accessible breadcrumb navigation component. Supports custom separators (chevron, slash, arrow, or custom character) and responsive truncation on small screens.
Add this component
The command below includes <strong>Breadcrumb</strong>—run it in your project directory to install this component (and the CSS if needed). No prompts.
Choose your package manager — click a tab to select, then copy the command.
Props
items(array, required) - Array of objects withlabeland optionalhref. The last item or any item withouthrefis shown as the current page.separator(string, optional) - One of'chevron'(default),'slash','arrow', or a custom character (e.g.'>','·')class(string, optional) - Additional CSS classes
Item Structure
label(string, required) - Link or current page texthref(string, optional) - URL for the link. Omit for the current page.
Basic Usage (Chevron Separator)
Usage
Full example for each framework (Astro, Vanilla, Svelte, Vue, React). Switch framework via View as or by clicking a Usage tab—both stay in sync.
Separator Variants
Slash
<Breadcrumb
separator="slash"
items={[
{ label: 'Home', href: '/' },
{ label: 'Docs', href: '/docs' },
{ label: 'Breadcrumb' },
]}
/> Arrow
Custom Character
<Breadcrumb
separator=">"
items={[
{ label: 'Home', href: '/' },
{ label: 'Blog', href: '/blog' },
{ label: 'Post Title' },
]}
/> Features
- Semantic markup -
<nav aria-label="Breadcrumb">with<ol>and<li> - Current page - Last item or item without
hrefusesaria-current="page"and is not a link - Separator customization - Chevron (icon), slash, arrow (›), or any custom character
- Responsive - On small screens (≤639px), long labels truncate with ellipsis; current page label is not truncated
- Theme-aware - Uses design system variables for color and spacing
- Accessible - Focus styles, hover states, and screen reader friendly