• Stars
    star
    151
  • Rank 246,057 (Top 5 %)
  • Language
    CoffeeScript
  • License
    Other
  • Created almost 11 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A tooltip-tutorial / onboarding framework for Angular.js

ngOnboarding

ngOnboarding is a tooltip tutorial / onboarding framework for Angular.js that can help give your user a better onboarding experience. The API is still in flux and it is not well-tested, so be aware before using it in production.

ngOnboarding Screenshot

Dependencies

This library requires Angular.js 1.2 or greater along with any recent version of jQuery.

Demo

You can find a very simple example of ngOnboarding here.

The Basics

To use the library, add the JS and CSS file, then include the module in your app

app = angular.module("myApp", ["ngOnboarding"])

Next, you'll need to configure the steps for the onboarding experience. The configuration is an array of objects, each representing a single popover. Here is an example configuration containing 2 popovers:

$scope.onboardingSteps = [
  {
    title: "Welcome!",
    position: "centered",
    description: "Welcome to my app!",
    width: 300
  },
  {
    title: "Account Setup",
    position: "right",
    description: "This is the form for configuring your account.",
    attachTo: "#account_form",
    position: "bottom"
  }
];

The directive itself is called onboarding-popover. There are 2 required inline attributes.

  • enabled should be set to a boolean scope variable that controls whether the onboarding UX is displayed.
  • steps should point to the steps configuration.

There are also 2 optional inline attributes.

  • onFinishCallback should point to a function that will be called when the user either clicks the Close or Done button. This is a good place to set a cookie to disable showing the on-boarding UX every time.
  • stepIndex is an integer that controls the current step being shown. It will default to 0 if not set explicitly.
<onboarding-popover enabled="onboardingEnabled" steps="onboardingSteps" on-finish-callback='myCallbackFunction()' step-index='onboardingIndex'></onboarding-popover>

Step Configuration Options

There are a number of options that can be passed to each step in your on-boarding process. These are set in the array of step objects, as shown above.

Option Default
Title null Title of the popover
description null Content of the popover. May contain HTML.
attachTo null CSS selector for the element to attach to. Optional
position null Position of the tooltip relative to the attached element. Optional. Accepted values are 'left', 'right', 'top', 'bottom', or 'centered', All but centered require that attachTo is set.
width null Width of the popover. Defaults to the width of the content.
height null Height of the popover. Defaults to the height of the content.
top, right, bottom, left null Set the positioning of the popover explicitly.
height null Height of the popover. Defaults to the height of the content.
xOffset null Offset the horizontal position of the popover relative to the attached element.
yOffset null Offset the vertical position of the popover relative to the attached element.

Overriding Directive Defaults

You can also pre-configure some options during your app's configuration phase.

app.config(function(ngOnboardingDefaultsProvider) {
  ngOnboardingDefaultsProvider.set('option', 'value');
  // Or with a hash
  ngOnboardingDefaultsProvider.set({option: 'value', option2: 'value2'});
})
Option Default
overlay false Use a modal overlay for popovers by default
overlayOpacity 0.6 Opacity of the modal overlay
showbuttons true Show the next and previous buttons
showDoneButton true Show a 'Done' button on the last popover
showStepInfo true Shows 'Step X of Y' text on each popover
closeButtonText X Text/HTML used for the close button

The CSS classes used in the HTML are also configurable. Please see the source for more info.

Browser Support

So far, it has only been tested in Chrome. There is some CSS that is not compatible with with older browsers, including IE9.

Future Updates

  1. Test coverage
  2. Ability to add an enter and leave callback to every step.

Contributing

Contributions are welcome. Whenever possible, please include test coverage with your contribution.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

To get the project running, you'll need NPM and Bower. Run npm install and bower install to install all dependencies. Then run grunt in the project directory to watch and compile changes. And you can run karma start to watch for changes and auto-execute unit tests.

Credit

Much of the CSS consists of tweaked versions of several Bootstrap components. The API was partially inspired by a jQuery plugin called Guiders.js, though none of its code was used. And the styling was partially inspired by Tourist.js, though again, no code was used.

More Repositories

1

ngQuickDate

An Angular.js Date/Time picker directive that stresses speed of data entry and configuration
CoffeeScript
362
star
2

docx_replace

Find and replace variables inside a Microsoft Word document (.docx) template
Ruby
119
star
3

ngModal

Very basic modal dialog directive for Angular.js
CoffeeScript
115
star
4

angular-starter-kit

An opinionated starter template for crafting single-page web applications using Angular.js, Coffeescript, SCSS, Jade, Bootstrap, UI-Router, Font-Awesome and a few other carefully picked tools.
CoffeeScript
38
star
5

hacker-news-for-chrome

A simple chrome extension for displaying the latest from Hacker News
JavaScript
35
star
6

angular-date-picker-polyfill

HTML5 Date Input Polyfill for AngularJS
CoffeeScript
19
star
7

angular-currency-mask

Angular directive for adding commas and proper formatting to a currency input text field.
JavaScript
17
star
8

MarkerClusterer

This is a fork of Xiaoxi Wu's MarkerClusterer library for Google Maps V3
JavaScript
8
star
9

angular-pdf-viewer

An angular.js directive that displays PDF documents using Mozilla's PDF.js library.
CoffeeScript
7
star
10

angular-lib-template

Starter template for creating an Angular.js library, such as a directive or service. Includes auto-compilation for Coffeescript and Less as well as testing support.
CoffeeScript
5
star
11

pandora_plus

A Google Chrome extension for improving the user experience of Pandora.com.
JavaScript
4
star
12

can_i_get_a_receipt_with_that

This is a contestant for the Google-sponsored Data Viz Challenge, in which we visualize how our individual federal income taxes are spent.
JavaScript
3
star
13

mobile_fixed_header_test

1
star
14

aa_rails_template

This is my very basic starter template for all new Rails projects
Ruby
1
star
15

ngTreeNav

Vertical tree-structed nav menu directive for Angular.js
JavaScript
1
star
16

capybara-page-object-helper

Helper module for creating page objects using Capybara and Rspec
Ruby
1
star
17

DotVim

My .vim folder, including my vimrc and gvimrc files
Vim Script
1
star
18

capybara-request-spec-helpers

A number of useful methods for nicer-looking integration/request specs using Rspec and Capybara
Ruby
1
star
19

vim_config_for_windows

My vim configuration on Windows
Vim Script
1
star