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

@haltentech/halten-slider

v1.1.1

Published

A customizable slider component built with React and React Spring

Downloads

10

Readme

Halten Slider

Halten Slider is a customizable slider component built with React and React Spring.

Dependencies

React-Spring is a library for creating animations in React. It provides powerful and flexible tools for implementing animations with smooth transitions and reactive changes.

Installation

To install the component, run:

npm install @haltentech/halten-slider

Usage

Here's an example of how to use the Halten Slider:

Linear Mode

In this simple mode, the pictures line up.

import { HaltenSlider } from '@haltentech/halten-slider';

const images = [
  { src: pic_1, proportional_height: 90,},
  { src: pic_2, proportional_height: 30,},
  { src: pic_3, proportional_height: 45,},
  { src: pic_4, proportional_height: 80,},
  { src: pic_5, proportional_height: 50,},
  { src: pic_6, proportional_height: 80,},
  { src: pic_7, proportional_height: 35,},
  { src: pic_8, proportional_height: 40,},
  { src: pic_9, proportional_height: 45 },
  { src: pic_10, proportional_height: 35},
];

const App: React.FC = () => {
  return (
      <HaltenSlider
        mode="linear"
        images={images}
        imageSpacing={15}
        scrollSensitivity={1.5}
        height="500px"
        imgStyle={{ border: '10px solid black' }}
        align="top"
      />
  );
};

export default App;

interface HaltenSliderImage

  • proportional_height - mandatory attribute. Percentage of the height of the image in the parent container. Frames are not taken into account

interface HaltenSliderProps:

  • imageSpacing - distance in pixels between images, taking into account the border
  • scrollSensitivity - swipe sensitivity (speed).
  • height - slider container height.
  • imgStyle - styles that will be applied to the pictures.
  • align - Align only valid for "linear" mode ("top", "center", "bottom")

Mosaic Mode

Add additional pos_x and pos_y to the array with images indicating the position in the scrollable container.

Switch to mode="mosaic"

import { HaltenSlider } from '@haltentech/halten-slider';

const images = [
  { src: pic_1, proportional_height: 90, pos_x: 0, pos_y: 5 },
  { src: pic_2, proportional_height: 30, pos_x: 250, pos_y: 10 },
  { src: pic_3, proportional_height: 45, pos_x: 250, pos_y: 135 },
  { src: pic_4, proportional_height: 80, pos_x: 450, pos_y: 20 },
  { src: pic_5, proportional_height: 50, pos_x: 650, pos_y: 50 },
  { src: pic_6, proportional_height: 80, pos_x: 930, pos_y: 18 },
  { src: pic_7, proportional_height: 35, pos_x: 1285, pos_y: 10 },
  { src: pic_8, proportional_height: 40, pos_x: 1280, pos_y: 155 },
  { src: pic_9, proportional_height: 45, pos_x: 2700, pos_y: 138 },
  { src: pic_10, proportional_height: 35, pos_x: 1840, pos_y: 160 },
];

const App: React.FC = () => {
  return (
    <HaltenSlider
      mode="mosaic"
      images={images}
      scrollSensitivity={0.7}
      height={"500px"}
      imgStyle={{ border: "10px solid black" }}
    />
  );
};

export default App;