npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

alpinejs-steps

v1.0.0

Published

A controller for stepwise UI components.

Downloads

12

Readme

alpinejs-steps

A controller for creating stepwise UI. Inspired by ember-steps.

Installation

$ npm i alpinejs-steps

What's included

With the download you'll find the following directoryies and files, with both compiled and minified versions.

```text
debug-console/dist/
├── steps.bundle.js
├── steps.bundle.js.map
├── steps.bundle.min.js
├── steps.bundle.min.js.map
├── steps.esm.js
├── steps.esm.js.map
├── steps.esm.min.js
├── steps.esm.min.js.map
├── steps.js
├── steps.js.map
├── steps.min.js
└── steps.min.js.map
```

Usage

node app.js

import Alpine from `alpinejs`
import { StepsComponent } from 'alpinejs-steps';

Alpine.data('steps', StepsComponent)
// OR
Alpine.data('tabs', StepsComponent)
// OR
Alpine.data('wizard', StepsComponent)
// OR
Alpine.data('carousel', StepsComponent)

Alpine.start()

browser indext.html

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <script
      src="https://unpkg.com/[email protected]/dist/cdn.min.js"
      defer="true"
    ></script>
    <script src="https://unpkg.com/alpinejs-steps@latest/dist/steps.bundle.min.js"></script>
  </head>
  <body>
    <section>
      <h3>Basic usage</h3>

      <div x-data="steps(['first step', 'second step', 'third step'])">
        <div>
          <div x-show="isActive('first step')">first step</div>
          <div x-show="isActive('second step')">second step</div>
          <div x-show="isActive('third step')">third step</div>
        </div>
        <div>
          <button x-on:click="transitionToPrevious()" type="button">
            Previous
          </button>
          <button x-on:click="transitionToNext()" type="button">Next</button>
        </div>
      </div>
    </section>
    <script>
      document.addEventListener("alpine:init", () => {
        Alpine.data("steps", AlpineSteps.StepsComponent);
      });
    </script>
  </body>
</html>

Tutorials

The above examples show the basic idea, but there're other ways to use it. Take a look at the tutorials for some examples.

Even though it is built with AlpineJs in mind. Because of how decoupled it is, integration with other projects focused on server rendered html, like Stimulus.

Copyright and license

Code copyright 2021–2022. Code released under the MIT License.