Socket
Socket
Sign inDemoInstall

@rosen-group/ngx-onboarding

Package Overview
Dependencies
Maintainers
2
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rosen-group/ngx-onboarding

Onboarding module for Angular applications


Version published
Weekly downloads
209
decreased by-27.43%
Maintainers
2
Weekly downloads
 
Created
Source

ngx-onboarding

An onboarding library for Angular applications.

Onboarding example image

Overview

The Onboarding library gives you the possibility to add a tutorial directly into your angular application. After that users learn easily how to use your application and the learning curve is not so high.

You can specify an onboarding element on every html element you want.

Features

  • Definition of several steps on each view.
  • Highlighting of every step.
  • Configurable on which position (top, bottom, left or right) the information text should be displayed.
  • Multiple language support
  • If onboarding is enabled, buttons are visible to switch to the next step or turn off onboarding
  • If a user has seen the onboarding of a view, it will be stored per default to the local storage of the browser.
  • Possibility to reset and turn on again the onboarding.

Installation

The library is published as a scoped NPM package in the NPMJS Rosen-Group account

npm install --save @rosen-group/ngx-onboarding

Peer Dependencies

For detailed information how to use Angular material please have a look at the Angular material getting started page and follow the installations instructions.

Usage

Add the rosen-onboarding-component anywhere to your main component, e.g. app.component

<rosen-onboarding></rosen-onboarding>

Add the material icons reference to the index.html

<link href="//fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

The onboarding contains a button component which provides a context menu for resetting and turning on again the onboarding feature. Place this button into your application where you want.

<rosen-onboarding-button title="ONBOARDING"></rosen-onboarding-button>

Add the OnboardingModule, the OnboardingService and it's dependencies to your module, e.g.

    imports: [
        BrowserModule,
        BrowserAnimationsModule,
        HttpClientModule,
        MatIconModule,
        MatButtonModule,
        OnboardingModule
    ],
    providers: [OnboardingService],

Add some styles, e.g. to your app.component.css ()

@import "~@angular/material/prebuilt-themes/indigo-pink.css";

And don't forget to bundle it to your output, e.g. in your angular.json

"styles": [
 "src/styles.css",
 "node_modules/@angular/material/prebuilt-themes/indigo-pink.css"
]

The messages will be configured in json files.

Place the json file(s) where you are able to load them on application runtime.

Example

[
    {
        "selector": "#logo-img",
        "group": "example0",
        "position": "top",
        "headline": "Angular Logo",
        "details": "This is the angular logo",
        "descriptions": [
            {
                "language": "de",
                "headline": "html tag headline de",
                "details": "htmp tag details de"
            }
        ]
    },
    {
        "selector": "#button-that-needs-onboarding",
        "group": "example1",
        "position": "right",
        "textAlign": "left",
        "headline": "What is behind me?",
        "details": "You have to learn a lot about this button",
        "descriptions": [
            {
                "language": "de",
                "headline": "html tag headline de",
                "details": "htmp tag details de"
            }
        ]
    }
]

(Use a selector that exists in your application, e.g. h2 in a plain Angular-CLI application)

Property descriptions

PropertyTypeDefault valueDescription
selectorstringnullThe css selector which identifies the html element you want to describe.
groupstringnullGroups in the same view will be displayed together
positiontop / bottom / right / leftbottomPositioning of the headline and details
textAlignleft / right / centercenterAlignment of the headline and details
headlinestringnullHeadline text for a single onboarding item
detailsstringnullDetails text for a single onboarding item
descriptionsArraynullCollection of additional translations for headline and detail text
-- languagestringnullLanguage key, e.g. en or de related to your translation definition
-- headlinestringnullTranslated headline text for a single onboarding item
-- detailsstringnullTranslated details text for a single onboarding item

Inject the OnboardingService into your component and load the configuration json file.

export class AppComponent implements OnInit, OnDestroy {
     private unregisterOnboarding: Function;
    
     constructor(private onboardingService: OnboardingService,
                 private httpClient: HttpClient) { 
     }
     
     public ngOnInit() {
         this.httpClient.get('assets/onboarding/example.json').subscribe((onboardingItems: Array<OnboardingItem>) => {
             this.unregisterOnboarding = this.onboardingService.register(onboardingItems);
         }, (error) => {
             // do your error handling
         });
     }
     
     public ngOnDestroy() {
         if (this.unregisterOnboarding) {
             this.unregisterOnboarding();
         }
     }
 }

Translations (I18N)

See I18N instructions

Browser Support

  • Chrome
  • Firefox
  • Edge
  • Internet Explorer 11 (with polyfills)

For Contributors

See CONTRIBUTING

Keywords

FAQs

Package last updated on 04 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc