This component no longer exists. It was in ondo-ui’s manifest when we first indexed it and is not there now — the registry served its inventory on 2026-08-09 and this item was not on it. The install command below will fail. It is kept here because a tutorial somewhere still tells people to run it.
timeline
ondo-ui/timelineRemovedComponent
A visual representation of events in chronological order.
Install it
npx shadcn@latest add https://ui.ondo.dou.so/r/timeline.jsonSource
1"use client"23import { createContext, useCallback, useContext, useState } from "react"4import { mergeProps } from "@base-ui/react/merge-props"5import { useRender } from "@base-ui/react/use-render"6import { cva, type VariantProps } from "class-variance-authority"78import { cn } from "@/lib/utils"910const timelineVariants = cva(11 "group/timeline flex [--timeline-rail:1rem] data-[orientation=horizontal]:w-full data-[orientation=horizontal]:flex-row data-[orientation=vertical]:flex-col",12 {13 variants: {14 size: {15 sm: "[--timeline-icon:0.5rem] [--timeline-indicator:0.75rem]",16 default: "[--timeline-icon:0.625rem] [--timeline-indicator:1rem]",17 lg: "[--timeline-icon:0.875rem] [--timeline-indicator:1.5rem]",18 },19 },20 defaultVariants: {21 size: "default",22 },23 }24)2526type TimelineContextValue = {27 activeStep: number28 setActiveStep: (step: number) => void29}3031const TimelineContext = createContext<TimelineContextValue | undefined>(32 undefined33)3435const useTimeline = () => {36 const context = useContext(TimelineContext)37 if (!context) {38 throw new Error("useTimeline must be used within a Timeline")39 }40 return context41}4243interface TimelineProps44 extends45 useRender.ComponentProps<"div">,46 VariantProps<typeof timelineVariants> {47 defaultValue?: number48 value?: number49 onValueChange?: (value: number) => void50 orientation?: "horizontal" | "vertical"51}5253function Timeline({54 defaultValue = 1,55 value,56 onValueChange,57 orientation = "vertical",58 size = "default",59 className,60 render,61 children,62 ...props63}: TimelineProps) {64 const [activeStep, setInternalStep] = useState(defaultValue)6566 const setActiveStep = useCallback(67 (step: number) => {68 if (value === undefined) {69 setInternalStep(step)70 }71 onValueChange?.(step)72 },73 [value, onValueChange]74 )7576 const currentStep = value ?? activeStep7778 const defaultProps = {79 className: cn(timelineVariants({ size }), className),80 "data-orientation": orientation,81 "data-size": size,82 "data-slot": "timeline",83 children,84 }8586 return (87 <TimelineContext.Provider88 value={{ activeStep: currentStep, setActiveStep }}89 >90 {useRender({91 defaultTagName: "div",92 render,93 props: mergeProps<"div">(defaultProps, props),94 })}95 </TimelineContext.Provider>96 )97}9899function TimelineContent({100 className,101 render,102 children,103 ...props104}: useRender.ComponentProps<"div">) {105// … truncated
What it pulls in
npm packages
Other registry items
