All Projects → PoslinskiNet → ember-introjs

PoslinskiNet / ember-introjs

Licence: MIT License
An Ember Component for intro.js

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
Handlebars
879 projects

Projects that are alternatives of or similar to ember-introjs

glimmer-apollo
Ember and Glimmer integration for Apollo Client.
Stars: ✭ 32 (-58.44%)
Mutual labels:  emberjs, ember-addon
ember-render-helpers
Complimentary render template helpers to the render modifiers
Stars: ✭ 19 (-75.32%)
Mutual labels:  emberjs, ember-addon
ember-breadcrumb-trail
Minimalistic but very flexible breadcrumb management solution for Ember applications.
Stars: ✭ 13 (-83.12%)
Mutual labels:  emberjs, ember-addon
ember-headlessui
gavinjoyce.github.io/ember-headlessui/
Stars: ✭ 76 (-1.3%)
Mutual labels:  emberjs, ember-addon
ember-event-helpers
Complimentary event template helpers to the {{on}} modifier
Stars: ✭ 33 (-57.14%)
Mutual labels:  emberjs, ember-addon
ember-gridstack
Ember components to build drag-and-drop multi-column grids powered by gridstack.js
Stars: ✭ 31 (-59.74%)
Mutual labels:  emberjs, ember-addon
ember-cli-g-maps
Deprecated Google Maps Addon
Stars: ✭ 58 (-24.68%)
Mutual labels:  emberjs, ember-addon
ember-await
Await component for Ember Applications. Resolve your data on demand, just when needed.
Stars: ✭ 54 (-29.87%)
Mutual labels:  emberjs, ember-addon
ember-link
Link primitive to pass around self-contained route references. It's {{link-to}}, but better!
Stars: ✭ 50 (-35.06%)
Mutual labels:  emberjs, ember-addon
ember-foxy-forms
Ember Addon for Making Foxy Forms
Stars: ✭ 27 (-64.94%)
Mutual labels:  emberjs, ember-addon
ember-addon-viewer
View information about addons used in your Ember app.
Stars: ✭ 14 (-81.82%)
Mutual labels:  emberjs, ember-addon
ember-changeset-conditional-validations
Conditional validations for ember-changeset-validations
Stars: ✭ 26 (-66.23%)
Mutual labels:  emberjs, ember-addon
ember-cli-string-helpers
Set of the String helpers extracted from DockYard's ember-composable-helpers.
Stars: ✭ 73 (-5.19%)
Mutual labels:  emberjs, ember-addon
ember-deep-tracked
Deep auto-tracking for when you just don't care, and want things to work (at the cost of performance in some situtations)
Stars: ✭ 20 (-74.03%)
Mutual labels:  emberjs, ember-addon
ember-google-maps
A friendly Ember addon for working with Google Maps.
Stars: ✭ 93 (+20.78%)
Mutual labels:  emberjs, ember-addon
ember-on-modifier
Implements the `{{on eventName this.someAction}}` element modifier from https://github.com/emberjs/rfcs/blob/master/text/0471-on-modifier.md
Stars: ✭ 37 (-51.95%)
Mutual labels:  emberjs, ember-addon
Ember Parachute
Improved Query Params for Ember
Stars: ✭ 200 (+159.74%)
Mutual labels:  emberjs, ember-addon
Ember Ajax
Service for making AJAX requests in Ember applications
Stars: ✭ 218 (+183.12%)
Mutual labels:  emberjs, ember-addon
ember-best-language
🏳 A FastBoot-enabled addon to detect the best language for your user.
Stars: ✭ 18 (-76.62%)
Mutual labels:  emberjs, ember-addon
ember-shadow-dom
Write templates for your components inside of a Shadow DOM root.
Stars: ✭ 26 (-66.23%)
Mutual labels:  emberjs, ember-addon

Ember Custom Actions Logo

Build Status Greenkeeper badge Ember Observer Score NPM package info for ember-introjs   License info

Ember IntroJS wraps introjs in an Ember Component to guide users through your app.

Compatibility

  • Ember.js v2.18 or above
  • Ember CLI v2.13 or above
  • Node.js v8 or above

Installation

ember install ember-introjs

Usage

1st option (recommended)

Use intro-js/step component as a wrapper

{{#intro-js/step step=1 intro="Step Component"}}
  <h1>Hello!</h1>
{{/intro-js/step}}

You can customize wrapper using:

  • position="top"
  • intro="Welcome!"
  • tooltipClass="tooltip-class"
  • highlightClass="highlight-class"
  • position="top"
  • hint="Use it :)"
  • hintPosition="bottom-left"

Options are documented in the code as well as in IntroJS Docs

2nd option

1. Declare your steps:

You can declare an array in JavaScript in your controller or parent component:

// app/controllers/ticket.js
import Controller from '@ember/controller';
import { computed } from '@ember/object';

export default Controller.extend({
  steps: computed(function() {
    return [
      {
        element: $('#step1'),
        intro: 'Step 1!'
      },
      {
        element: $('#step2'),
        intro: 'Step2!'
      }
    ];
  })
});

2. Use intro-js component

Then to use the steps, you can use the steps in your handlebars template:

{{! app/templates/ticket }}
{{intro-js start-if=true}}

Action Hooks

IntroJS supports a series of hooks for getting notified for when users switch between steps or exit. You can subscribe to these actions using the typical actions hash in your Route or Controller:

// app/routes/ticket.js
import Ember from 'ember';

export default Ember.Route.extend({
  actions: {
    introBeforeChange(previousStep, nextStep, introJSComponent,
elementOfNewStep){
      // You could track user interactions here, e.g. analytics.
      this.sendAnalytics(prevStep);
    }
  }
});

Then pass the name of the action in the handlebars helper that renders the component below.

{{intro-js steps=steps start-if=true on-before-change=(action "introBeforeChange")}}

on-before-change (currentStep, nextStep, introJSComponent, nextElement)

Called when the user clicks next (or uses their keyboard). Called before on-change. Given the currentStep, the nextStep, the introJSComponent, and the DOM element of the next step.

on-change (step, introJSComponent, currentElement)

Called after on-before-change when the user moves a step (backwards or forward) in the introduction. Gives the current step, the introJS component isntance, and the element of the current step.

on-after-change (step, introJSComponent, currentElement)

Called after on-change when the user moves a step (backwards or forward) in the introduction. Gives the current step, the introJS component isntance, and the element of the current step.

on-before-exit (step, introJSComponent)

Called when the user quits the intro via the "Skip" button, hitting escape, or clicking outside the overlay. Given the current step, and the introJS component.

on-exit (step, introJSComponent)

Called after on-before-exit when the user quits the intro via the "Skip" button, hitting escape, or clicking outside the overlay. Given the current step, and the introJS component.

on-complete (step, introJSComponent)

Called when the user finishes the intro by clicking "Done" or hitting right on the keyboard until the end. Called with the last step and the introJS component instance.

Intro JS Options

Intro JS has a variety of options available to it. You can see the full list here, but we also provided the full list below. You'll notice that in the list below options all follow the dasherized convention of HTML and ember-cli filenames. The original list uses camelCase names, and so does IntroJS. Ember IntroJS will do the conversion for you.

You can also set other options using the Handlebars helper syntax: `

{{intro-js steps=steps show-bullets=true}}

Or you could extend your own base class to override defaults instead of specifying them every time in the Handlebars helper:

myapp/app/components/my-intro-js.js
import IntroJSComponent from 'ember-introjs/components/intro-js';

export default IntroJSComponent.extend({
  'exit-on-esc': true
});

You can also reopen the class:

import IntroJSComponent from 'ember-introjs/components/intro-js';

IntroJSComponent.reopen({
  'exit-on-esc': true
});
property description
steps For defining steps using JSON configuration (see this example)
next-label Next button label
prev-label Previous button label
skip-label Skip button label
done-label Done button label
tooltip-position Default tooltip position
tooltip-class Adding CSS class to all tooltips
highlight-class Additional CSS class for the helperLayer
exit-on-esc Exit introduction when pressing Escape button, true or false
exit-on-overlay-click Exit introduction when clicking on overlay layer, true or false
show-step-numbers Show steps number in the red circle or not, true or false
keyboard-navigation Navigating with keyboard or not, true or false
show-buttons Show introduction navigation buttons or not, true or false
show-bullets Show introduction bullets or not, true or false
show-progress Show introduction progress or not, true or false
scroll-to-element Auto scroll to highlighted element if it's outside of viewport, true or false
overlay-opacity Adjust the overlay opacity, Number
disable-interaction Disable an interaction inside element or not, true or false
helper-element-padding Set how much padding to be used around helper element

See setOption to see an example.

Testing Helpers

Ember IntroJS comes with a set of testing helpers.

To use them, first import them in your tests/test-helper.js file:

// tests/test-helpers.js
import './helpers/ember-introjs';

License

See the LICENSE file included in this repository.

Keep in mind that if you like to use Intro.JS for commercial use, you should buy a commercial license. You can find more information on the intro.js project site: https://introjs.com/#commercial

Contributing

See the Contributing guide for details.

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms, which can be found in the CODE_OF_CONDUCT.md file in this repository.

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].