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

tango-horizon-cw

v1.0.3

Published

A horizon scroll animation by ClayW

Readme

tango-horizon-cw

版本:1.0.3
支持:React 18.x/19.x & Next 14-16.x
作者:ClayW
创建时间:2026-02-05
更新时间:2026-04-29


简介

tango-horizon-cw 是一个用于 React / Next.js 的的横向滚动组件库,支持:

  • 快速实现横向滚动布局
  • 高度自定义配置

安装

npm install tango-horizon-cw

快速开始

import { Horizon } from "tango-horizon-cw";

export default function Demo() {
  return (
	<div style={{ width: "100vw", height: "100vh" }}>
	   <Horizon
		  topContent="HORIZON DEMO"
          bottomContent="SCROLL END"
		  middleHeight="100%"
	   />
	</div>
  );
}

组件会在自身容器内滚动,请给外层容器明确高度(如 100vh70vh600px)。


样式引入

通常构建工具会自动处理样式。如果你遇到样式未生效,可手动引入:

import "tango-horizon-cw/style.css";

使用范式

1) 顶部/底部传文本

<Horizon
  topContent="TOP TITLE AREA"
  bottomContent="BOTTOM TITLE AREA"
  damping={0.12}
  middleHeight="100%"
/>

2) 顶部/底部传组件(推荐业务场景)

const TopSection = () => <div style={{ padding: 24 }}>自定义顶部模块</div>;
const BottomSection = () => <div style={{ padding: 24 }}>自定义底部模块</div>;

<Horizon
  topContent={<TopSection />}
  bottomContent={<BottomSection />}
  topHeight={1200}
  bottomHeight={900}
  middleHeight="70vh"
/>

3) 自定义卡片内容

<Horizon
  boxCount={12}
  renderBox={(index) => <span>Card {index + 1}</span>}
/>

常用参数

  • topContent / bottomContent: ReactNode,支持字符串、JSX、组件。
  • topHeight / bottomHeight: 顶部与底部区域高度(number=px,string=CSS 长度)。
  • middleHeight: 中间区域可视高度(推荐使用);百分比基于 Horizon 容器高度,vh 基于浏览器视口。
  • damping: 滚动阻尼系数(0~1,越小越柔和,越大越跟手)。
  • stopThreshold: 动画停止阈值。
  • wheelIdleDelay: 滚轮停止判定延迟(ms)。
  • boxCount / boxWidth / boxHeight / boxGap: 横向卡片数量与尺寸间距。
  • middleBackground / middleOverlay / middleBorderColor: 中间区域视觉样式。
  • pageBackground / pageTextColor: 外层背景与文本色。
  • boxBackground / boxShadow / boxTextColor: 卡片视觉样式。
  • renderBox: 自定义卡片渲染函数,入参 index0 开始。

TypeScript

组件库已导出类型:

import { Horizon } from "tango-horizon-cw";
import type { HorizonProps } from "tango-horizon-cw";

兼容性说明

  • React:18.x / 19.x
  • 适用于 React、Next.js(App Router / Pages Router)等常见前端工程