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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@severfam/horizontally-slider

v0.0.1

Published

Angular standalone component for horizontal scrolling with arrow navigation, mouse drag, wheel and touch support

Readme

Horizontally Slider

Angular standalone component for horizontal scrolling with arrow navigation, mouse drag, wheel and touch support.

Installation

npm install @severfam/horizontally-slider

Peer Dependencies

  • @angular/common ^21.2.0
  • @angular/core ^21.2.0

Usage

import { HorizontallySliderComponent } from '@severfam/horizontally-slider';

@Component({
  selector: 'app-root',
  imports: [HorizontallySliderComponent],
  template: `
    <lib-horizontally-slider [showAlwaysArrows]="true">
      <div left-arrow class="arrow arrow--left">
        <svg>...</svg>
      </div>

      <div slider class="track">
        @for (item of items; track item) {
          <div class="item">{{ item.name }}</div>
        }
      </div>

      <div right-arrow class="arrow arrow--right">
        <svg>...</svg>
      </div>
    </lib-horizontally-slider>
  `,
})
export class App {}

Inputs

| Name | Type | Default | Description | |------|------|---------|-------------| | dragStep | number | 5 | Scroll step (px) on wheel event | | clickStep | number | 100 | Scroll step (px) on arrow click | | wheelStep | number | 100 | Scroll step (px) on wheel | | showAlwaysArrows | boolean | false | Always show arrows regardless of scroll position | | showArrowsOnMobile | boolean | false | Show arrows on touch devices (<=740px) | | noGap | boolean | false | Remove gap between items | | scrollRefresh$ | Subject<void> | new Subject() | Emit to recalculate arrow visibility |

Outputs

| Name | Type | Description | |------|------|-------------| | selectedChange | number | Emits index of clicked item |

Content Projection

The component uses ng-content with attribute selectors for three projection slots:

| Attribute | Description | |-----------|-------------| | [left-arrow] | Left arrow content | | [slider] | Main scrollable content | | [right-arrow] | Right arrow content |

Each slot is a required div with the corresponding attribute:

<div left-arrow>...</div>
<div slider>...</div>
<div right-arrow>...</div>

CSS Classes (BEM)

Block

.horizontally-slider__track — scrollable container with hidden scrollbar

Modifiers

| Class | Description | |-------|-------------| | .horizontally-slider__track--no-gap | Remove gap between items |

Arrows

| Class | Description | |-------|-------------| | .horizontally-slider__arrow | Arrow wrapper (hidden by default) | | .horizontally-slider__arrow--left | Left arrow position | | .horizontally-slider__arrow--right | Right arrow position | | .horizontally-slider__arrow--visible | Show arrow (applied automatically) |

Default Styles

:host {
  width: 100%;
  position: relative;
  display: block;
}

.horizontally-slider__track {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;

  &::-webkit-scrollbar {
    display: none;
  }
}

.horizontally-slider__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: none;
  align-items: center;
  justify-content: center;

  &--visible {
    display: flex;
  }

  &--left { left: 0; }
  &--right { right: 0; }
}

Interface

interface SliderPhoto {
  url: string | SafeResourceUrl;
  name: string;
  alt: string;
  disabled?: boolean;
}

Features

  • Standalone component (no module required)
  • Mouse drag scrolling (1:1 ratio)
  • Arrow key / click / long-touch navigation
  • Wheel scrolling
  • Touch device support
  • Safari-compatible scroll handling
  • Automatic arrow visibility based on scroll position
  • Window resize reactive
  • ChangeDetectionStrategy.OnPush with Angular signals

License

MIT