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

@kne/timeline

v1.0.1

Published

滚动驱动动画的 React 时间线组件,基于 framer-motion,支持响应式布局和国际化

Downloads

188

Readme

timeline

描述

滚动驱动动画的 React 时间线组件,基于 framer-motion,支持响应式布局和国际化

安装

npm i --save @kne/timeline

概述

概述

Timeline 是一个滚动驱动动画的时间线组件,基于 framer-motion 实现,随着页面滚动自动展示时间线进度动画效果。

主要特性

  • 滚动驱动动画:基于 framer-motion 的 useScrolluseTransform,随页面滚动自动展示进度动画
  • 响应式布局:适配桌面端和移动端,桌面端标题侧边固定显示,移动端标题内联显示
  • 国际化支持:内置中英文语言包,支持多语言切换
  • 自定义内容:每条时间线项目支持任意 ReactNode 作为内容渲染

示例

示例代码

  • 基础用法
  • 展示时间线组件的基本用法,支持滚动驱动的进度动画和自定义内容渲染
  • _Timeline(@kne/current-lib_timeline)[import * as _Timeline from "@kne/timeline"],(@kne/current-lib_timeline/dist/index.css)
const { default: Timeline } = _Timeline;

const BaseExample = () => {
  const data = [
    {
      title: '2024',
      content: 'Built and launched Aceternity UI and Aceternity UI Pro from scratch',
      images: [
        { src: 'https://assets.aceternity.com/templates/startup-1.webp', alt: 'startup template' },
        { src: 'https://assets.aceternity.com/templates/startup-2.webp', alt: 'startup template' },
        { src: 'https://assets.aceternity.com/templates/startup-3.webp', alt: 'startup template' },
        { src: 'https://assets.aceternity.com/templates/startup-4.webp', alt: 'startup template' }
      ]
    },
    {
      title: 'Early 2023',
      content: 'I usually run out of copy, but when I see content this big, I try to integrate lorem ipsum. Lorem ipsum is for people who are too lazy to write copy. But we are not. Here are some more example of beautiful designs I built.',
      images: [
        { src: 'https://assets.aceternity.com/pro/hero-sections.png', alt: 'hero template' },
        { src: 'https://assets.aceternity.com/features-section.png', alt: 'feature template' },
        { src: 'https://assets.aceternity.com/pro/bento-grids.png', alt: 'bento template' },
        { src: 'https://assets.aceternity.com/cards.png', alt: 'cards template' }
      ]
    },
    {
      title: 'Changelog',
      content: 'Deployed 5 new components on Aceternity today',
      images: [
        { src: 'https://assets.aceternity.com/pro/hero-sections.png', alt: 'hero template' },
        { src: 'https://assets.aceternity.com/features-section.png', alt: 'feature template' }
      ],
      extra: (
        <div>
          <div style={{ display: 'flex', alignItems: 'center', gap: 8, fontSize: 14 }}>
            ✅ Card grid component
          </div>
          <div style={{ display: 'flex', alignItems: 'center', gap: 8, fontSize: 14 }}>
            ✅ Startup template Aceternity
          </div>
          <div style={{ display: 'flex', alignItems: 'center', gap: 8, fontSize: 14 }}>
            ✅ Random file upload lol
          </div>
          <div style={{ display: 'flex', alignItems: 'center', gap: 8, fontSize: 14 }}>
            ✅ Himesh Reshammiya Music CD
          </div>
          <div style={{ display: 'flex', alignItems: 'center', gap: 8, fontSize: 14 }}>
            ✅ Salman Bhai Fan Club registrations open
          </div>
        </div>
      )
    }
  ];
  return (
    <div style={{ position: 'relative', width: '100%', overflow: 'clip' }}>
      <Timeline
        data={data}
        title="Changelog from my journey"
        description="I've been working on Aceternity for the past 2 years. Here's a timeline of my journey."
      />
    </div>
  );
};

render(<BaseExample />);

API

Timeline

时间线组件,用于展示按时间顺序排列的事件记录,支持滚动驱动的进度动画效果。

属性

|| 属性 | 类型 | 默认值 | 说明 | ||------|------|--------|------| || data | Array<TimelineItem> | - | 时间线数据列表 | || title | string | - | 时间线标题,不传则不显示标题区域 | || description | string | - | 时间线描述文案,不传则不显示描述区域 |

TimelineItem

|| 属性 | 类型 | 默认值 | 说明 | ||------|------|--------|------| || title | string | - | 时间节点标题 | || content | string | - | 时间节点文本内容 | || images | Array<string \| { src: string, alt?: string }> | - | 图片列表,支持字符串URL或对象格式,组件内部负责布局展示,最多展示4张 | || extra | ReactNode | - | 额外扩展内容,用于自定义渲染 |