stories2 / Angular-Onboarding

Onboarding library for angular 7
https://www.npmjs.com/package/story-onboarding
MIT License
1 stars 0 forks source link
angular-library angular-material angular7 onboarding onboarding-screen

Onboarding for angular7

demo

Show onboarding for angular 7.

How to use

<Ng7-Onboarding [story]="storyBoard" [gap]='20' (done)="endOfTutorial($event)"></Ng7-Onboarding>

story

gap

done

Optional

btnNextText

btnPrevText

btnDoneText

Story board data

storyBoard = [
    {
      id: 'h1Wellcome',
      text: 'This is wellcome',
      direction: 'bottom'
    },
    {
      id: 'angularIcon',
      text: 'This is icon',
      direction: 'right'
    },
    {
      id: 'angularIcon',
      text: 'This is icon',
      direction: 'left'
    },
    ...
    {
      id: 'cli',
      text: 'This is cli',
      direction: 'bottom'
    },
    {
      id: 'blog',
      text: 'This is blog',
      direction: 'bottom'
    }
  ] as StoryOnboardingModel[];

id

<h1 id="h1Wellcome"> <!-- h1Wellcome is id -->
    Welcome to {{ title }}!
</h1>

text

direction


app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';

import { OnboardingModule } from 'story-onboarding';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    OnboardingModule // <-- onboarding module
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

OR

app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';

import { MatButtonModule, MatCardModule } from '@angular/material';

import { OnboardingComponent } from 'story-onboarding';

@NgModule({
  declarations: [
    AppComponent,
    OnboardingComponent // <-- onboarding component
  ],
  imports: [
    BrowserModule,

    MatButtonModule, // <-- needed
    MatCardModule // <-- needed
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Build Library

ng build Onboarding

Publish Library

cd dist/onboarding
npm publish

Reference

How to create angular library link

CSS Spotlight link