Catalog npm
Back to packageRELEASE DETAILS

1.1.0

npm

360-coachmark

## Why ??

Published8 Nov 2024
Direct dependencies2
Transitive dependenciesNot calculated

README

Current package documentation

CoachmarkJS

Why ??

Often while building amazing UIs, we forget to build an onboarding experience. Without onboarding, user might not know how to best use it. This package helps you to make a good onboaring experience, by making just a few changes in your document.

Installation

To install via npm run npm install coachmarkjs

Or yarn yarn add coachmarkjs

Usage

Import the package

    import Coachmark from 'coachmarkjs'

Add the data-attribute data-coachmark to your DOM element which you want to highlight. This attribute takes a number which lets you specify the order in which the elements would be highlighted. DOM Element with attribute data-coachmark = 0 will be highlighted before element with attribute data-coachmark = 1

Similarly, add the data-attribute data-coachmark-text to DOM element for the tooltip text.

As shown below,

    <article
        class="column"
        data-coachmark="4"
        data-coachmark-text="The tooltip text"
    >
        <div>
            <img src="..." alt="" />
        </div>
        <p class="__text">
            This is a text element
        </p>
    </article>

To initialize it

    Coachmark.init()

For React users,

    // Onboarding Component
    import Coachmark from 'coachmarkjs'
    class Onboarding extends React.Component {

        componentDidMount() {
            Coachmark.init()
        }

        componentWillUnmount() {
            Coachmark.destroy()
        }

        render() {
            return (
                <section data-coachmark="0" data-coachmark-text="Tap here for next image">
                    //.....
                </section>
            )
        }
    }

It uses dynamic style sheets which are created inly after Coachmark.init() is called and destroyed as soon as Coachmark.destroy() is called. This is a flexible approach, as it allows these styles to be overriden to suit the styling of the app.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 2

Native requirements
2 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
rollup
Environment
{
  "local_name": "rollup",
  "alias": false,
  "peer_metadata": null
}
^1.27.0development
rollup-plugin-terser
Environment
{
  "local_name": "rollup-plugin-terser",
  "alias": false,
  "peer_metadata": null
}
^5.1.2development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "b2af7a26e730b7a4f2023252dcca0b51f5e4e4e1",
  "tarball": "https://registry.npmjs.org/360-coachmark/-/360-coachmark-1.1.0.tgz",
  "fileCount": 8,
  "integrity": "sha512-u1Pnhk01GEsJ7OBAsF3rUx2CIVN6OvOaWll7iQ59rJHDzGQ0K/cmHTRbAmd2JXm+NBtrJrh0WQcf4IjhxE4jpA==",
  "signatures": [
    {
      "sig": "MEUCIFFjIzOYV747K2SLmCVc7tGXEdVyeoLm6RtHz5RkldY6AiEAneOJW5JzWPqqQUmDTZQtBWf9LIAJyp8GlbIi66+5xlU=",
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
    }
  ],
  "unpackedSize": 23845
}

Repository

PENDING
360suites-engineering/coachmarkjs

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:26 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:331f052e600ed507bcd12785fbb8de612c40a01bf5b8bf9e22b30342007e40b5

Other collected versions

1.2.08 NovView all collected versions →