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-input-multirange

v0.0.2

Published

## Create a new project (If you have not created one yet)

Downloads

3

Readme

Svelte Input Multi Range

Create a new project (If you have not created one yet)

Create new Svelte-kit project create-svelte or Svelte project

Install

npm i -D svelte-input-multirange

Usage

Import component and custom event.

import InputMultiRange from 'svelte-input-multirange'
import type RangeChanged from 'svelte-input-multirange/range-changed'

When render by using default properties.

<InputMultiRange />

When render with some properties and bind a event handler

function handleChangeRange(e: CustomEvent<RangeChanged>) {
  console.log(e.detail.from)
  console.log(e.detail.to)
}
<div style="height: 48px; width:200px;">
  <InputMultiRange
    key={'1'}
    barHeight={40}
    knobSize={42}
    rangeMin={-100}
    rangeMax={100}
    defaultFrom={10}
    defaultTo={25}
    throttole={10}
    on:range-changed={handleChangeRange}
  />
</div>

NOTE: The display size depends on the parent tag, so wrap it in any tag to control the size. (It is better to set the height slightly larger than the size of the bar or knob.)

Properties

properties are all optional. |name|type|description|default| |---|---|---|---| |key|string|sets value for identification, when using multiple components|empty string| |barHeight|number|height of a bar|20| |knobSize|number|diameter of the range-control knobs|20| |rangeMin|number|available range max value|0| |rangeMax|number|available range min value|100| |defaultFrom|number|initial from value of the range|0| |defaultTo|number|initial to values of the range|100| |rangeMinColor|string|color of range max value (hex)|#00bc9b| |rangeMaxColor|string|color of range max value (hex)|#5eaefd| |useDarkMode|bool|if set to true, color of the basebar will be dark|false| |throttole|number|throttle for a emits event 'change-range'|0|

Events

NOTE: The 'from' and 'to' values are calculated by the actual bar width and range values, so if the width and range are significantly different, it will be difficult to tweak the knobs.

| event name | | dispatch values example | | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- | | change-range | dispatches when the left or right knob position changes.'key' is same of the own property value'from' and 'to' are the current values | { key: 'input1', from: 3, to: 20 } |