Socket
Socket
Sign inDemoInstall

@zendeskgarden/container-slider

Package Overview
Dependencies
14
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @zendeskgarden/container-slider

Containers relating to Slider in the Garden Design System


Version published
Weekly downloads
5.1K
increased by6.98%
Maintainers
1
Install size
442 kB
Created
Weekly downloads
 

Readme

Source

@zendeskgarden/container-slider npm version

This package includes containers relating to Slider in the Garden Design System.

Installation

npm install @zendeskgarden/container-slider

Usage

Check out storybook for live examples.

useSlider

import { useSlider } from '@zendeskgarden/container-slider';

const Slider = () => {
  const trackRef = createRef();
  const minThumbRef = createRef();
  const maxThumbRef = createRef();
  const { getTrackProps, getMinThumbProps, getMaxThumbProps, minValue, maxValue } = useSlider({
    trackRef,
    minThumbRef,
    maxThumbRef
  });

  return (
    <div {...getTrackProps()} ref={trackRef}>
      <div {...getMinThumbProps()} minThumbRef={minThumbRef}>
        {minValue}
      </div>
      <div {...getMaxThumbProps()} maxThumbRef={maxThumbRef}>
        {maxValue}
      </div>
    </div>
  );
};

SliderContainer

import { SliderContainer } from '@zendeskgarden/container-slider';

const trackRef = createRef();
const minThumbRef = createRef();
const maxThumbRef = createRef();

<SliderContainer trackRef={trackRef} minThumbRef={minThumbRef} maxThumbRef={maxThumbRef}>
  {({ getTrackProps, getMinThumbProps, getMaxThumbProps, minValue, maxValue }) => (
    <div {...getTrackProps()} trackRef={trackRef}>
      <div {...getMinThumbProps()} minThumbRef={minThumbRef}>
        {minValue}
      </div>
      <div {...getMaxThumbProps()} maxThumbRef={maxThumbRef}>
        {maxValue}
      </div>
    </div>
  )}
</SliderContainer>;

Keywords

FAQs

Last updated on 26 Jan 2024

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc