@alevettih/ngx-route-breadcrumbs

November 25, 2025 · View on GitHub

An Angular service that simplifies the creation of breadcrumbs that use routing url and params as a basis.

Overview

@alevettih/ngx-route-breadcrumbs is an Angular library that provides a simple way to create breadcrumbs from routing information.

Features

  • ✅ Create breadcrumbs from routing info.
  • ✅ Provide routing data/params into breadcrumbs with interpolation.
  • ✅ Return metadata for implementing a "Back" button.
  • ✅ Programmatically manipulate breadcrumbs (changes are rolled back when the contributing component is destroyed).
  • ✅ Transform links based on route data (transformLink method).

API Overview

ServiceDescription
RouteBreadcrumbsServiceProvides APIs for building and manipulating breadcrumbs sourced from routing information.
MemberDescription
itemsSignal that exposes the current breadcrumb collection.
extend(params, destroyRef)Temporarily adds or patches breadcrumbs that fall back when the owning component is destroyed.
getBack(breadcrumbs)Helper that returns the breadcrumb to use for "Back" navigation.

For a more detailed reference, see the library README.

Project Structure

ngx-route-breadcrumbs/
├── projects/
│   └── ngx-route-breadcrumbs/        # Library source code
│       └── src/
│           └── lib/
│               ├── helpers/       # Helpers and type guards
│               ├── models/        # TypeScript models
│               ├── services/      # RouteBreadcrumbs service
│               └── types/         # TypeScript types
├── dist/                          # Build artifacts
└── package.json

Development

Requirements

  • Node.js 24+
  • npm 11+
  • Angular CLI 21+

Install Dependencies

npm install

Build the Library

npm run build

Or build in watch mode:

npm run watch

Testing

npm run test

Linting

Run lint checks:

npm run lint

Auto-fix issues:

npm run lint:fix

Formatting

Check formatting:

npm run format:check

Auto-format the code:

npm run format

Library Usage

For detailed usage guidelines, see the library README.

Tech Stack

  • Angular 21+
  • TypeScript 5.9+
  • RxJS 7.8+
  • es-toolkit 1.41+
  • Vitest 4+ (for testing)

License

This project is distributed under the MIT license.

Authors

@Alevettih