All Projects → udayvunnam → Xng Breadcrumb

udayvunnam / Xng Breadcrumb

Licence: mit
A lightweight, configurable and reactive breadcrumbs for Angular 2+

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Xng Breadcrumb

AngularAI
💬 Angular 6 AI (localhost version is working correctly)
Stars: ✭ 50 (-52.83%)
Mutual labels:  ngx, angular6
Api Client Generator
Angular REST API client generator from Swagger YAML or JSON file with camel case settigs
Stars: ✭ 92 (-13.21%)
Mutual labels:  angular6, ngx
Ngx Daterangepicker Material
Pure Angular 2+ date range picker with material design theme, a demo here:
Stars: ✭ 169 (+59.43%)
Mutual labels:  angular6, ngx
Ngx Excel Export
Angular6 application with export data to excel file functionality.
Stars: ✭ 58 (-45.28%)
Mutual labels:  angular6, ngx
ngx-loading-mask
Angular 5+ simple loading-mask ui component.
Stars: ✭ 22 (-79.25%)
Mutual labels:  ngx, angular6
Ngx Masonry
Angular Module for displaying a feed of items in a masonry layout
Stars: ✭ 102 (-3.77%)
Mutual labels:  angular6, ngx
Vue 2 Breadcrumbs
Vue breadcrumbs
Stars: ✭ 76 (-28.3%)
Mutual labels:  breadcrumbs
Wordpress Seo
Yoast SEO for WordPress
Stars: ✭ 1,301 (+1127.36%)
Mutual labels:  breadcrumbs
Mean Stack Angular6 Crud Example
MEAN Stack Angular 6 CRUD Web Application
Stars: ✭ 69 (-34.91%)
Mutual labels:  angular6
Springbootangularhtml5
♨️ Spring Boot 2 + Angular 11 + HTML5 router mode + HTTP interceptor + Lazy loaded modules
Stars: ✭ 89 (-16.04%)
Mutual labels:  angular6
Ngx Tree Select
Angular select component with tree items
Stars: ✭ 59 (-44.34%)
Mutual labels:  ngx
Ngx Youtube Player
(ngx) A youtube component wrapped with Angular (typescript)
Stars: ✭ 89 (-16.04%)
Mutual labels:  angular6
Agm Direction
This is the directive for @agm/core (not official)
Stars: ✭ 77 (-27.36%)
Mutual labels:  angular6
Ng2 Flatpickr
Angular 2+ wrapper for flatpickr (https://github.com/chmln/flatpickr)
Stars: ✭ 91 (-14.15%)
Mutual labels:  angular6
Ngx Summernote
Summernote editor for Angular 😎
Stars: ✭ 76 (-28.3%)
Mutual labels:  angular6
Generator Ngx Rocket
🚀 Extensible Angular 11+ enterprise-grade project generator
Stars: ✭ 1,329 (+1153.77%)
Mutual labels:  ngx
Ng2 Breadcrumbs
A breadcrumb service for the Angular 7 router
Stars: ✭ 61 (-42.45%)
Mutual labels:  breadcrumbs
Ngx Lightbox
Lightbox2 use with angular >= 5
Stars: ✭ 84 (-20.75%)
Mutual labels:  angular6
Angular File Uploader
Angular file uploader is an Angular 2/4/5/6/7/8/9/10 + file uploader module with Real-Time Progress Bar, Responsive design, Angular Universal Compatibility, localization and multiple themes which includes Drag and Drop and much more.
Stars: ✭ 92 (-13.21%)
Mutual labels:  angular6
Ngx Papaparse
Papa Parse wrapper for Angular
Stars: ✭ 83 (-21.7%)
Mutual labels:  angular6

xng-breadcrumb

A lightweight, declarative and configurable breadcrumbs solution for Angular 6 and beyond. https://www.npmjs.com/package/xng-breadcrumb

npm version bundle size license npm downloads

CircleCI Twitter follow

About

  • In applications with deep navigation hierarchy, it is essential to have breadcrumbs.
  • Breadcrumbs easily allow going back to states higher up in the hierarchy.

Demo

Live Demo - A demo app showcasing xng-breadcrumb usage in an Angular app. Navigate through different links to see breadcrumbs behavior.

xng-breadcrumb usage

Features

  • Zero configuration: Just add <xng-breadcrumb></xng-breadcrumb> anywhere in the app. Breadcrumb labels will be auto-generated by analyzing Angular Route configuration in your App.

  • Custom labels: each route can have a custom label defined via Angular Route Config. The labels will be picked automatically while forming breadcrumbs

  • Update labels dynamically: Change breadcrumbs dynamically using BreadcrumbService.set(). You can either use route path or breadcrumb alias to change breadcrumb for a route.

  • Skip breadcrumb: Skip specific routes from displaying in breadcrumbs, conditionally.

  • Disable breadcrumb: Disable specific routes so that navigation is disbaled to intermediate routes.

  • Customization: Customize breadcrumb template to show icons as label prefix, use pipes on text, add i18n, etc.

  • Styling: Separator and Styles can be customized with ease.

  • QueryParams and Fragment: Preserves QueryParams and Fragemnet while navigating via breadcrumbs

Quickstart

  1. Install via npm or yarn
npm install --save xng-breadcrumb
//------------- OR --------------
yarn add xng-breadcrumb
  1. Import 'BreadcrumbModule' in your Application
import {BreadcrumbModule} from 'xng-breadcrumb';
@NgModule({
  ...
  imports: [BreadcrumbModule],
  ...
})
export class AppModule { }
  1. Add 'xng-breadcrumb' selector, wherever you plan to show breadcrumbs
<xng-breadcrumb></xng-breadcrumb>
  1. (Optional) Use BreadcrumbService, if you want to change breadcrumbs behavior(visibility, label, etc) dynamically.
import { BreadcrumbService } from 'xng-breadcrumb';

constructor(private breadcrumbService: BreadcrumbService) {}
// Code examples with BreadcrumbService are given below, under Usage section

🎉🎉 That's it. You should see auto-generated breadcrumbs appearing for each route.

Note: XngBreadcrumb has a peer dependency on @angular/router. Include RouterModule in App imports, if you haven't already.

Setup Guide

Provide breadcrumb labels via In App Route Config

  • define 'breadcrumb' within the data property of route.
  • a 'breadcrumb' can be defined as a string OR object OR function.
  • Use breadcrumb as a string if you are just providing breadcrumb text
  • Use breadcrumb as an object if you are providing additional properties like 'alias', 'skip', 'info', 'disable'. In you define breadcrumb as an object, label property denotes breadcrumb text.
  • Use breadcrumb as a function if you want to alter the auto-generated label as needed.

breadcrumb as a string

  {
    path: 'dashboard',
    loadChildren: './dashboard/dashboard.module#DashboardModule',
    data: { breadcrumb: 'Home' }
  },
  {
    path: 'add',
    component: MentorAddComponent,
    data: { breadcrumb: 'New' }
  }

breadcrumb as an object

  {
    path: 'dashboard',
    loadChildren: './dashboard/dashboard.module#DashboardModule',
    data: {
      breadcrumb: {
        label: 'Home',
        info: { myData: { icon: 'home', iconType: 'material' } }
      }
    }
  },
  {
    path: 'add',
    component: MentorAddComponent,
    data: { breadcrumb: { skip: true, alias: 'mentorAdd' } }
  }

breadcrumb as a function

{
  path: '/orders',
  children: [{
    ':id',
    data: {
      breadcrumb: (resolvedId: string) => `Viewing ${resolvedId} now`
    }
  }]
}

Update breadcrumb label dynamically

  • Breadcrumb label can be updated dynamically using route path or alias
  • For simple routes, route path is enough. Ex: breadcrumbService.set(<route path> , <breadcrumb label>)
  • For long deep routes, you can use alias instead.
  • Create an alias for a route in route config. Prefix alias with '@' while using the set() method. Ex: breadcrumbService.set(@<alias> , <breadcrumb label>)

using route path to update labels dynamically

  {
    path: 'mentors',
    component: MentorListComponent,
    children: [
      {
        path: ':id',
        component: MentorDetailsComponent
      }
    ]
  }

  // routepath can contain path params similar to how you define in routes
  breadcrumbService.set('mentors', 'Mentor View'); // path for MentorListComponent
  breadcrumbService.set('mentor/:id', 'Uday Vunnam'); // path for MentorDetailsComponent contains param (:id)

using alias to update labels dynamically

  {
    path: 'mentors',
    component: MentorListComponent,
    children: [
      {
        path: ':id',
          component: MentorDetailsComponent
          data: {
            breadcrumb: {
              alias: 'mentorName'
            }
          }
        }
    ]
  }

  breadcrumbService.set('@mentorName', 'Uday Vunnam');

Advanced Patterns

If you looking for customizing breadcrumb in different ways, refer to this guide

API

Detailed API for Breadcrumb Component and Breadcrumb Service

Accessibility

Accessibility is the firstclass concern for this library and is implemented with best practices

Angular version compatibility

xng-breadcrumb works will all versions of Angular. See the compatibility guide

Local Development Guide

If you wish to contribute to this library, refer to the local development guide

❤️ Become a Sponsor!

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Uday Vunnam

💻 📖 🚧

anthonythiry

💻

dedrazer

💻

Danny Feliz

📖

This project follows the all-contributors specification. Contributions of any kind welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].