Lifeline 是一个 shadcn 注册表组件,用于构建水平和垂直的时间线,展示里程碑、事件和媒体,可通过 npx 安装并完全自定义。

Stars

153

7 天增长

暂无数据

Fork 数

1

开放 Issue

1

开源协议

MIT

最近更新

2026-07-27

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它作为 shadcn 注册表项发布,将可编辑的源代码直接放入你的代码库,并提供智能滚动捕获嵌入、响应式布局以及个人、公司或旅程等多种起始模板。

适合谁使用

  • 使用 shadcn/ui 的 Next.js 开发者
  • 需要交互式时间线组件的产品设计师
  • 记录职业、公司或项目历史的内容创作者

典型使用场景

  • 展示个人职业时间线,包含里程碑和图片
  • 绘制公司从创立至今的关键事件和产品发布
  • 以天为单位记录有期限的旅程(如旅行或项目)
  • 在现有页面中嵌入滚动叙事式时间线

项目优势

  • 通过 npx shadcn 一键安装:一条命令添加组件、数据助手和关键帧
  • 完全可自定义,因为源代码直接放入你的项目(每个缓动、断点、类名都可修改)
  • 响应式布局:桌面端自动为水平滚动,移动端为垂直滚动(md 断点)
  • 嵌入模式具有智能滚动捕获,时间线结束后将滚动控制权交还页面

使用前须知

  • 需要 Next.js App Router 和 Tailwind CSS(v3 或 v4),非独立库
  • 仅提供时间线组件,不含其他 UI 部件(除 shell 和主题切换器外)
  • 嵌入模式需手动设置高度,若容器过小可能会裁剪长内容

README 快速开始

Lifeline

A timeline component for the stories that unfold over time — a career, a company, a journey.

Lifeline lays milestones on a single rail: horizontal and scrubbed by scroll on desktop, vertical on mobile. Years carry events, links, and the people who mattered; media attaches as hover reveals or floating cards that expand into a lightbox. On first load, an intro draws the rail across the years.

It ships as a shadcn registry — the source lands in your codebase, so every easing, breakpoint, and class is yours to change.

Install

Starting from nothing? This gets you a page that runs, framing included:

npx shadcn@latest add evilrabbit/lifeline/page

Components, starter data, the shell, and a route at app/lifeline/page.tsx. If that route already exists, shadcn asks before touching it — answer no and nothing of yours is lost.

Already have a page? Take the shell without the route, so the rail still sits inset and aligned inside your own layout:

npx shadcn@latest add evilrabbit/lifeline/shell

Just want the data template? Pick the starter that matches your subject — each brings the component system plus a commented template file, and no framing:

npx shadcn@latest add evilrabbit/lifeline/personal   # a life, year by year
npx shadcn@latest add evilrabbit/lifeline/company    # founding to today
npx shadcn@latest add evilrabbit/lifeline/journey    # a bounded run, day by day

Or just the component system, no starter and no framing:

npx shadcn@latest add evilrabbit/lifeline/lifeline

The sun/moon toggle from the demo is its own item:

npx shadcn@latest add evilrabbit/lifeline/theme-switcher

Any item installs the components into components/lifeline/, the data helper into lib/lifeline-data.ts, adds the intro keyframes to your CSS, and installs lucide-react + next-themes. The registry is also served at https://evilrabbit.com/r/{name}.json if you prefer URLs.

Use

Define a timeline as milestones keyed by year, and render it:

import { Lifeline, LifelineLegend } from "@/components/lifeline"
import {
  LifelineFooter,
  LifelineNav,
  LifelineShell,
  LifelineStage,
} from "@/components/lifeline-shell"
import { defineLifeline } from "@/lib/lifeline-data"

const life = defineLifeline({
  slug: "web",
  name: "The World Wide We

项目描述

A timeline component for the stories that unfold over time. Ships as a shadcn registry.

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

TanStack
精选
TanStack GitHub avatar

router

TanStack Router is a type-safe, data-driven React router with built-in caching, prefetching, and nested layouts, while TanStack Start extends it into a full-stack SSR framework.

Web 开发前端框架
14,861
vercel-labs
精选
vercel-labs GitHub avatar

scriptc

scriptc compiles ordinary TypeScript into small, fast native executables without needing Node.js, V8, or any JavaScript runtime in the binary.

开发者工具代码质量与构建
1,985
Jakubantalik
精选
Jakubantalik GitHub avatar

thinking-orbs

A React component library that renders six hand-tuned animated thought orb loading indicators on a plain 2D canvas, with two purpose-tuned sizes and automatic theme detection for AI and agent UIs.

AI 与机器学习AI 智能体
1,191