New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

js-step-builder

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-step-builder

A lightweight, framework-agnostic step builder for JavaScript

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

js-step-builder

A lightweight, framework-agnostic step builder for JavaScript.

Features

  • Simple and intuitive API
  • Progress tracking
  • Customizable styling
  • Framework agnostic
  • TypeScript support
  • Event handling
  • Responsive design

Installation

npm install js-step-builder

Usage

import { StepBuilder } from "js-step-builder";

const stepBuilder = new StepBuilder({
  startsFrom: 1,
  onStepChange: () => {
    console.log("Step changed!");
  },
}).init("#steps");

Demo

Check out the live demo at: https://sametweb.github.io/js-step-builder/

The demo showcases:

  • Multi-step form with validation
  • Progress tracking
  • Form data collection
  • Summary view
  • Responsive design
  • Modern styling

API

Constructor Options

interface StepBuilderConfig {
  startsFrom?: number; // Starting step number (default: 1)
  onStepChange?: () => void; // Callback when step changes
  progressBar?: string; // Progress bar selector (default: "#progress")
  prevButton?: string; // Previous button selector (default: "#prev-btn")
  nextButton?: string; // Next button selector (default: "#next-btn")
  stepClass?: string; // Step element class (default: "step")
  activeClass?: string; // Active step class (default: "active")
}

Methods

  • init(selector: string): StepBuilder - Initialize the step builder
  • next(): void - Move to next step
  • prev(): void - Move to previous step
  • jump(step: number): void - Jump to specific step
  • getState(): StepState - Get current state

State Object

interface StepState {
  current: number; // Current step number
  size: number; // Total number of steps
  isLast: boolean; // Is current step the last step
  isFirst: boolean; // Is current step the first step
  hasPrev: boolean; // Can move to previous step
  hasNext: boolean; // Can move to next step
  progress: number; // Progress percentage (0-1)
}

License

MIT

Keywords

step

FAQs

Package last updated on 01 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts