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

antd-group-slider

v1.2.4

Published

Grouped slider based on ant-design

Downloads

168

Readme

antd-group-slider

Grouped-sliders based on ant-design

antd-group-slider provides a group of sliders that help to input multiple related range-data. It has data sync between sliders on every range change that which would help the user to avoid accidental missing range during actions.

Please first have a look at Ant Slider to have a general idea of the use case of this component.

Feel free to request a feature by opening an issue :)

NPM JavaScript Style Guide

Live demo

https://huyennbl.github.io/antd-group-slider/

Prerequisite

Ant Design v4

Install

npm install --save antd-group-slider

or

yarn add antd-group-slider

Usage

import React, { Component } from 'react'

import GroupSlider from 'antd-group-slider'
import 'antd-group-slider/dist/index.css'

class GroupSliderExample extends Component {
  render() {
    return <GroupSlider />
  }
}

Props

| Name | Type | Meaning | Posible values | Default value | | ------------------- | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | | min | number | Min value of range selection. This value takes place if initial ranges have value less than min. | Positive numbers | 0 | | max | number | Max value of range selection. This value takes place if initial ranges have value higher than max. | Positive numbers | 100 | | addButtonText | string | Display text of add range button | | 'Add more range' | | removeButtonText | string | Display text of remove range button | | 'Remove last range' | | onChange | function(data) | Callback when range or description changes Format of object of callback: - ranges: array of pairs of values of each range - descriptions: array of description, with order respectively to ranges - isFullRange: true if all the ranges from 0 to max is covered | | | | descriptionConfig | object | Object containing configuration of description fields. Format of object: - placeholder: string - description's placeholder string (*) - separator: string - separator between of a range pair values in placeholder - type: string - Type of description. 'none' value will hide the description section - leftText: string - Text to be displayed before description input (*) - rightText: string - Text to be displayed after description input (*) - leftAddonText: string - Text to be displayed as addon before of description input (*)(**) - rightAddonText: string - Text to be displayed as addon after of description input (*)(**) (*): If you want to put range values into the string, mark them as {{range}} inside your string (**): only applicable if type='input'. Refer to Ant-design Input to see addonBefore & addonAfter prop | type: 'input', 'none', 'textarea' | placeholder: 'Description for range {{range}}' separator: '-' (dash symbol) type: 'textarea' | | marks | object | Value indicator of sliders Refer to Ant-design Input to see the marks props | | 3 marks: - 0 - floor(max/2) - max | | initialValues | object | Initial data of component Format of object: - ranges: array of pairs of values of each range - descriptions: array of description, with order respectively to ranges | | ranges: [[0, max]] descriptions: [] | | initialValuesConfig | object | Format of object: - fillGaps: boolean - whether component should fill in the missing ranges of initial data | | fillGaps: true | | showDivider | boolean | Show Divider between each ranges | | false | | lineExtras | array | Additional components to show under each slider line | | [] |

License

MIT © huyennbl