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

@synerise/ds-slider

v0.13.45

Published

Slider UI Component for the Synerise Design System

Downloads

1,438

Readme


id: slider title: Slider

Slider UI Component

Based on Ant Design Slider

Installation

npm i @synerise/ds-slider
or
yarn add @synerise/ds-slider

Usage

import Slider from '@synerise/ds-slider';

<Slider
  label="Label"
  max={100}
  min={0}
  range
  step={5}
  onAfterChange={props.onAfterChange}
  OnChange={props.onChange}
  tooltipPlacement="topLeft"
/>;

Slider Default

Slider Multiple Mode

API

| Property | Description | Type | Default | | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- | -------------------------------------------------------------------------------------- | | autoFocus | get focus when component mounted | boolean | false | | defaultValue | The default value of slider. When range is false, use number, otherwise, use [number, number] | number / number[] | 0 / [0, 0] | | disabled | If true, the slider will not be interactable. | boolean | false | | dots | Whether the thumb can drag over tick only. | boolean | false | | included | Make effect when marks not null, true means containment andfalsemeans coordinative | boolean | true | | marks | Tick mark of Slider, type of key must be number, and must in closed interval [min, max], each mark can declare its own style. | object | {number: string / ReactNode} / {number: {style: object, label: string or ReactNode}} | | max | The maximum value the slider can slide to | number | 100 | | min | The minimum value the slider can slide to. | number | 0 | | range | dual thumb mode | boolean | false | | step | The granularity the slider can step through values. Must greater than 0, and be divided by (max - min) . When marks no null, step can be null. | number / null | 1 | | tipFormatter | Slider will pass its value to tipFormatter, and display its value in Tooltip, and hide Tooltip when return value is null. | ((value: number) => React.ReactNode) / null | IDENTITY | | value | The value of slider. When range is false, use number, otherwise, use [number, number] | number / number[] | | | vertical | If true, the slider will be vertical. | Boolean | false | | onAfterChange | Fire when onmouseup is fired. | (value) | - | | onChange | Callback function that is fired when the user changes the slider's value. | (value) | - | | thick | Set thickness of the slider | Boolean | false | | type | Defines a way of handling slider ranges | default / allocation | default | | tooltipPlacement | Set Tooltip display position. Ref Tooltip. | string | | | tooltipVisible | If true, Tooltip will show always, or it will not show anyway, even if dragging or hovering. | Boolean | | | getTooltipPopupContainer | The DOM container of the Tooltip, the default behavior is to create a div element in body. | () => React.HTMLElement | () => document.body | | inverted | Allow to use slider in inverted mode. Applies only when value is number or [number, number] | Boolean | false | | useColorPalette | Allow the usage of predefined palette for slider tracks | Boolean | false | | tracksColorMap | Allow to import your 10 colors color map. | Object | | | handlers | Handlers config object for allocation slider. Allow to manipulate handlers e.g. enable to block handler. First handler index is 1. | HandlerConfig | - |

AllocationConfig

| Property | Description | Type | Default | | ------------------- | --------------------------------------------------------- | ---------------------------------------- | --------------- | | controlGroupEnabled | Enables treating the rest of the range as control group. | boolean | false | | controlGroupLabel | Label displayed over control group range | string / React.ReactNode | Control group | | controlGroupTooltip | Tooltip displayed when hovering over control group label. | string / React.ReactNode | CG | | variants | Whether the thumb can drag over tick only. | AllocationVariant[] | false | | onAllocationChange | Callback executed when user changes slider value. | (variants?: AllocationVariant[]) => void | false |

AllocationConfig

| Property | Description | Type | Default | | ------------------- | --------------------------------------------------------- | ---------------------------------------- | --------------- | | controlGroupEnabled | Enables treating the rest of the range as control group. | boolean | false | | controlGroupLabel | Label displayed over control group range | string / React.ReactNode | Control group | | controlGroupTooltip | Tooltip displayed when hovering over control group label. | string / React.ReactNode | CG | | variants | Whether the thumb can drag over tick only. | AllocationVariant[] | false | | onAllocationChange | Callback executed when user changes slider value. | (variants?: AllocationVariant[]) => void | false |