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

svelte-steps-local

v2.3.5

Published

A customizable step component written in Svelte - local

Downloads

15

Readme

🐾 Svelte steps component 🐾

A customizable step component written in Svelte!

  • [x] Bootstrap color theme
  • [x] Icons
  • [x] Animate progress
  • [x] Horizontal and vertical
  • [x] Dumpbells and bar
  • [x] Custom size
  • [x] Custom color
  • [x] Custom font
  • [x] Circle, square and between
  • [x] Left and right

demo

Installation

npm install --saveDev svelte-steps

Example Usages

Clone this project and run it. Itself is an example. Take a look at the homepage here. The source file of the demo is at src/routes/index.svelte

Basic Usage

<script>
    import { Steps } from 'svelte-steps';
    let steps = [
        { text: 'step one' }, 
        { text: 'step two' }, 
        { text: 'the last step' }
    ];
</script>

<Steps {steps} />

Vertical Steps (NEW)

NOTE: needs svelte version 3.46.3 or newer

Add vertical props to Steps component.

<Steps vertical {steps} />

You can also use reverse to put text label to the left.

<Steps vertical reverse {steps}>

With Icons

let steps = [
    { text: 'step one', icon: IconMoney },
    { text: 'step two', icon: IconPaperClip },
    { text: 'the last step', icon: IconPerson }
]

Square Steps

<Steps {steps} borderRadius="0"/>

Custom Color

<Steps {steps} primary="#ff0000" secondary="#ffaaaa"/>

Custom Size

<Steps {steps} size="2rem" line="2px"/>

No Text

let steps = [
    { icon: IconMoney },
    { icon: IconPaperClip },
    { icon: IconPerson }
]

Bar

<Steps {steps} size="2rem" line="2rem"/>

Events

<Steps
    {steps}
    {current}
    on:click={(e) => {
        last = e.detail.last;
        current = e.detail.current;
    }}
/>

Use with Bootstrap

It by default uses --bs-primary, --bs-secondary, --bs-light, and --bs-dark css variables if they are defined. These css vars are defined in bootstrap css:

<!-- Include Bootstrap css in app.html <head></head> -->
<link
    href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
    rel="stylesheet"
    integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"
    crossorigin="anonymous"
/>

Props

  • steps:
    • Array of object. Length has to be more than 1
    • Required
    • Each item is a step object that can have:
      • text: The text displayed below each steps.
      • icon: A svelte component displayed inside each steps.
      • iconProps: An object that will be passed as props to the icon component.
  • current: current step index. Number. Default 0
  • size: size of the step buttons. String. Default "3rem" ("2rem" for vertical steps)
  • line: thickness of the connecting lines between the step buttons. String. Default "0.3rem" ("0.15rem" for vertical steps)
  • primary: Primary color of passed and current steps. String. Default 'var(--bs-primary, #3a86ff)'
  • secondary: Secondary color of future steps. String. Default 'var(--bs-secondary, #bbbbc0)'
  • light: Primary color of text color in passed anc current steps. String. Default 'var(--bs-light, white)'
  • dark: Secondary color of text color in future steps. String. Default 'var(--bs-dark, black)'
  • borderRadius: Border radius of the step buttons. String. Default '50%' (circle)
  • fontFamily: Font family of the component. String. Default "'Helvetica Neue', Helvetica, Arial, sans-serif"
  • vertical: Vertical steps. Default false
  • reverse: For horizontal steps, reverse the step from right to the left; for vertical steps, reverse puts text labels to the left. Default false
  • clickable: When set to false, Clicking icons and labels will not change step. You have to change current to change step. Default true

Events

  • on:click(e): click event. Event detail object has two keys:
    • e.detail.current: the index of current step
    • e.detail.last: the index of last step