UI Library for Design Engineers. Animated components and effects you can copy and paste into your apps. Free. Open Source.
Feat/arc timeline component (#739)
Arghya Dasb0d2a21e7b8a
diff --git a/__registry__/index.tsx b/__registry__/index.tsxindex d23da2ee..32693dda 100644--- a/__registry__/index.tsx+++ b/__registry__/index.tsx@@ -1673,6 +1673,30 @@ export const Index: Record<string, any> = {}),meta: undefined,},+ "arc-timeline": {+ name: "arc-timeline",+ description:+ "A curved timeline that elegantly visualizes key milestones, perfect for Web3 and AI roadmaps.",+ type: "registry:ui",+ registryDependencies: undefined,+ files: [+ {+ path: "registry/magicui/arc-timeline.tsx",+ type: "registry:ui",+ target: "components/magicui/arc-timeline.tsx",+ },+ ],+ component: React.lazy(async () => {+ const mod = await import("@/registry/magicui/arc-timeline.tsx");+ const exportName =+ Object.keys(mod).find(+ (key) =>+ typeof mod[key] === "function" || typeof mod[key] === "object",+ ) || item.name;+ return { default: mod.default || mod[exportName] };+ }),+ meta: undefined,+ },"magic-card-demo": {name: "magic-card-demo",description:@@ -4635,6 +4659,34 @@ export const Index: Record<string, any> = {}),meta: undefined,},+ "arc-timeline-demo": {+ name: "arc-timeline-demo",+ description: "Example showing an arc timeline component.",+ type: "registry:example",+ registryDependencies: ["https://magicui.design/r/arc-timeline"],+ files: [+ {+ path: "registry/example/arc-timeline-demo.tsx",+ type: "registry:example",+ target: "components/arc-timeline-demo.tsx",+ },+ {+ path: "registry/magicui/arc-timeline.tsx",+ type: "registry:ui",+ target: "components/magicui/arc-timeline.tsx",+ },+ ],+ component: React.lazy(async () => {+ const mod = await import("@/registry/example/arc-timeline-demo.tsx");+ const exportName =+ Object.keys(mod).find(+ (key) =>+ typeof mod[key] === "function" || typeof mod[key] === "object",+ ) || item.name;+ return { default: mod.default || mod[exportName] };+ }),+ meta: undefined,+ },utils: {name: "utils",description: "",diff --git a/config/docs.ts b/config/docs.tsindex 69f7ad8b..63aaa0f5 100644--- a/config/docs.ts+++ b/config/docs.ts@@ -264,6 +264,12 @@ export const docsConfig: DocsConfig = {title: "Progressive Blur",href: `/docs/components/progressive-blur`,items: [],+ label: "",+ },+ {+ title: "Arc Timeline",+ href: `/docs/components/arc-timeline`,+ items: [],label: "New",},],diff --git a/content/docs/components/arc-timeline.mdx b/content/docs/components/arc-timeline.mdxnew file mode 100644index 00000000..f1d91891--- /dev/null+++ b/content/docs/components/arc-timeline.mdx@@ -0,0 +1,89 @@+---+title: Arc Timeline+date: 2025-02-13+description: A curved timeline that elegantly visualizes key milestones, perfect for Web3 and AI roadmaps.+author: hexi+published: true+---++<ComponentPreview name="arc-timeline-demo" />++## Installation++<Tabs defaultValue="cli">++<TabsList>+ <TabsTrigger value="cli">CLI</TabsTrigger>+ <TabsTrigger value="manual">Manual</TabsTrigger>+</TabsList>+<TabsContent value="cli">++```bash+npx shadcn@latest add "https://magicui.design/r/arc-timeline"+```++</TabsContent>++<TabsContent value="manual">++<Steps>++<Step>Copy and paste the following code into your project.</Step>++<ComponentSource name="arc-timeline" />++</Steps>++</TabsContent>++</Tabs>++## Usage++```tsx+import { ArcTimeline } from "@/components/magicui/arc-timeline";+```++```tsx+const data = [+ {+ time: "2025",+ steps: [+ { icon: <span>π</span>, content: "Launched v1" },+ { icon: <span>β¨</span>, content: "Improved UX" },+ ],+ },+ {+ time: "2026",+ steps: [{ icon: <span>π</span>, content: "Growth" }],+ },+];++<ArcTimeline data={data} />;+```++## Props++| Prop | Type | Default | Description |+| ----------------------------------------- | ------------------- | -------------- | ---------------------------------------------------------------------------- |+| `className` | `string` | `-` | The class name to apply to the component. |+| `data` | `ArcTimelineItem[]` | `-` | The data of the arc timeline. |+| `arcConfig.circleWidth` | `number` | `5000` | The width of the circle. |+| `arcConfig.angleBetweenMinorSteps` | `number` | `0.35` | The angle between minor steps. |+| `arcConfig.lineCountFillBetweenSteps` | `number` | `10` | The number of lines to fill between steps. |+| `arcConfig.boundaryPlaceholderLinesCount` | `number` | `50` | The number of lines to fill in before the first step and after the last step |+| `defaultActiveStep.time` | `string` | `data[0].time` | The time of the default active step. |+| `defaultActiveStep.stepIndex` | `number` | `0` | The index of the default active step. |++## CSS Variables++| Variable | Default | Description |+| ---------------------------- | --------------------------------- | ------------------------------------ |+| `--step-line-active-color` | light: `#888888`, dark: `#9780ff` | The color of the active step line. |+| `--step-line-inactive-color` | light: `#b1b1b1`, dark: `#737373` | The color of the inactive step line. |+| `--placeholder-line-color` | light: `#a1a1a1`, dark: `#737373` | The color of the placeholder line. |+| `--time-active-color` | light: `#555555`, dark: `#d4d4d4` | The color of the active time. |+| `--time-inactive-color` | light: `#a3a3a3`, dark: `#a3a3a3` | The color of the inactive time. |+| `--description-color` | light: `#555555`, dark: `#d4d4d4` | The color of the description. |+| `--icon-active-color` | light: `#555555`, dark: `#d4d4d4` | The color of the active icon. |+| `--icon-inactive-color` | light: `#a3a3a3`, dark: `#a3a3a3` | The color of the inactive icon. |diff --git a/public/r/arc-timeline-demo.json b/public/r/arc-timeline-demo.jsonnew file mode 100644index 00000000..49162a30--- /dev/null+++ b/public/r/arc-timeline-demo.json@@ -0,0 +1,24 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "arc-timeline-demo",+ "type": "registry:example",+ "title": "Arc Timeline Demo",+ "description": "Example showing an arc timeline component.",+ "registryDependencies": [+ "https://magicui.design/r/arc-timeline"+ ],+ "files": [+ {+ "path": "registry/example/arc-timeline-demo.tsx",+ "content": "import { ArcTimeline, ArcTimelineItem } from \"@/registry/magicui/arc-timeline\";\nimport {\n RocketIcon,\n CubeIcon,\n LockClosedIcon,\n GlobeIcon,\n GearIcon,\n LightningBoltIcon,\n StarIcon,\n MagicWandIcon,\n} from \"@radix-ui/react-icons\";\n\nexport default function ArcTimelineDemo() {\n return (\n <ArcTimeline\n // className={cn(\n // \"[--step-line-active-color:#888888] dark:[--step-line-active-color:#9780ff]\",\n // \"[--step-line-inactive-color:#b1b1b1] dark:[--step-line-inactive-color:#737373]\",\n // \"[--placeholder-line-color:#a1a1a1] dark:[--placeholder-line-color:#737373]\",\n // \"[--icon-active-color:#555555] dark:[--icon-active-color:#d4d4d4]\",\n // \"[--icon-inactive-color:#a3a3a3] dark:[--icon-inactive-color:#a3a3a3]\",\n // \"[--time-active-color:#555555] dark:[--time-active-color:#d4d4d4]\",\n // \"[--time-inactive-color:#a3a3a3] dark:[--time-inactive-color:#a3a3a3]\",\n // \"[--description-color:#555555] dark:[--description-color:#d4d4d4]\"\n // )}\n data={TIMELINE}\n defaultActiveStep={{ time: \"2025 Q2\", stepIndex: 0 }}\n arcConfig={{\n circleWidth: 4500,\n angleBetweenMinorSteps: 0.4,\n lineCountFillBetweenSteps: 8,\n boundaryPlaceholderLinesCount: 50,\n }}\n />\n );\n}\n\nconst TIMELINE: ArcTimelineItem[] = [\n {\n time: \"2022\",\n steps: [\n {\n icon: <RocketIcon width={20} height={20} />,\n content:\n \"Founded Visionary Tech, a cutting-edge AI development company.\",\n },\n {\n icon: <CubeIcon width={20} height={20} />,\n content:\n \"Launched first AI-powered mobile app for personalized recommendations.\",\n },\n ],\n },\n {\n time: \"2023\",\n steps: [\n {\n icon: <LockClosedIcon width={20} height={20} />,\n content: \"Raised $3M seed round at a $20M valuation.\",\n },\n {\n icon: <GlobeIcon width={20} height={20} />,\n content:\n \"Expanded to global markets with localized app versions in 5 countries.\",\n },\n {\n icon: <GearIcon width={20} height={20} />,\n content:\n \"Implemented enhanced machine learning algorithms for data prediction.\",\n },\n ],\n },\n {\n time: \"2024\",\n steps: [\n {\n icon: <RocketIcon width={20} height={20} />,\n content:\n \"Introduced AI-powered virtual assistant for customer service.\",\n },\n {\n icon: <GlobeIcon width={20} height={20} />,\n content:\n \"Partnered with several tech giants to enhance app capabilities.\",\n },\n {\n icon: <MagicWandIcon width={20} height={20} />,\n content:\n \"Launched AR-based features for more immersive user experiences.\",\n },\n ],\n },\n {\n time: \"2025 Q1\",\n steps: [\n {\n icon: <StarIcon width={20} height={20} />,\n content:\n \"Rolled out AI-driven marketplace for personalized product discovery.\",\n },\n {\n icon: <LightningBoltIcon width={20} height={20} />,\n content: \"Introduced blockchain integration for secure transactions.\",\n },\n {\n icon: <RocketIcon width={20} height={20} />,\n content:\n \"Showcased at CES with revolutionary AI-powered consumer products.\",\n },\n ],\n },\n {\n time: \"2025 Q2\",\n steps: [\n {\n icon: <GearIcon width={20} height={20} />,\n content: \"Rebranded company with new logo and visual identity.\",\n },\n {\n icon: <StarIcon width={20} height={20} />,\n content:\n \"Launched AI-driven content creation tool for marketing teams.\",\n },\n {\n icon: <CubeIcon width={20} height={20} />,\n content:\n \"Acquired a competitor in the AI space to strengthen market position.\",\n },\n ],\n },\n {\n time: \"2025 Q3\",\n steps: [\n {\n icon: <CubeIcon width={20} height={20} />,\n content: \"Launched self-driving AI platform for industrial automation.\",\n },\n {\n icon: <MagicWandIcon width={20} height={20} />,\n content: \"Added virtual reality integration to the product suite.\",\n },\n ],\n },\n {\n time: \"2025 Q4\",\n steps: [\n {\n icon: <StarIcon width={20} height={20} />,\n content:\n \"Introduced AI-driven analytics dashboard for enterprise clients.\",\n },\n {\n icon: <LightningBoltIcon width={20} height={20} />,\n content:\n \"Launched international expansion into Asian and European markets.\",\n },\n {\n icon: <RocketIcon width={20} height={20} />,\n content: \"Hosted first global conference showcasing AI innovations.\",\n },\n ],\n },\n {\n time: \"2026 Q1\",\n steps: [\n {\n icon: <GearIcon width={20} height={20} />,\n content:\n \"Released API for developers to integrate AI into their applications.\",\n },\n {\n icon: <StarIcon width={20} height={20} />,\n content:\n \"Launched new AI-powered voice assistant with multi-language support.\",\n },\n {\n icon: <GlobeIcon width={20} height={20} />,\n content:\n \"Partnered with government agencies for AI-driven policy making.\",\n },\n ],\n },\n {\n time: \"2026 Q2\",\n steps: [\n {\n icon: <GearIcon width={20} height={20} />,\n content: \"Unveiled new AI-powered robotics platform for manufacturing.\",\n },\n {\n icon: <MagicWandIcon width={20} height={20} />,\n content:\n \"Introduced machine learning models for sustainable energy solutions.\",\n },\n ],\n },\n];\n",+ "type": "registry:example",+ "target": "components/arc-timeline-demo.tsx"+ },+ {+ "path": "registry/magicui/arc-timeline.tsx",+ "content": "\"use client\";\nimport { cn } from \"@/lib/utils\";\nimport { ComponentPropsWithoutRef, ReactNode, useState } from \"react\";\n\nexport interface ArcTimelineItem {\n time: ReactNode;\n steps: Array<{\n icon: ReactNode;\n content: ReactNode;\n }>;\n}\ninterface ArcTimelineProps extends ComponentPropsWithoutRef<\"div\"> {\n /**\n * Optional CSS class name to apply custom styles\n */\n className?: string;\n /**\n * The data of the arc timeline\n */\n data: ArcTimelineItem[];\n /**\n * The configuration of the arc timeline\n */\n arcConfig?: {\n /**\n * The width of the circle, default is 5000\n */\n circleWidth?: number;\n /**\n * The angle between minor steps, default is 0.35\n */\n angleBetweenMinorSteps?: number;\n /**\n * The number of lines to fill between steps, default is 10\n */\n lineCountFillBetweenSteps?: number;\n /**\n * The number of lines to fill in before the first step and after the last step\n */\n boundaryPlaceholderLinesCount?: number;\n };\n /**\n * The default active step\n */\n defaultActiveStep?: {\n /**\n * The time of the default active step\n */\n time?: string;\n /**\n * The index of the default active step\n */\n stepIndex?: number;\n };\n}\n\nexport function ArcTimeline(props: ArcTimelineProps) {\n const {\n className,\n children,\n data,\n arcConfig = {},\n defaultActiveStep = {},\n ...restProps\n } = props;\n\n const {\n circleWidth = 5000,\n angleBetweenMinorSteps = 0.35,\n lineCountFillBetweenSteps = 10,\n boundaryPlaceholderLinesCount = 50,\n } = arcConfig;\n\n const {\n time: defaultActiveTime = data[0].time,\n stepIndex: defaultActiveStepIndex = 0,\n } = defaultActiveStep || {};\n\n const [circleContainerRotateDeg, setCircleContainerRotateDeg] = useState(\n () => {\n let count = 0;\n for (const timelineItem of data) {\n if (timelineItem.time === defaultActiveTime) {\n count += defaultActiveStepIndex;\n break;\n } else {\n count += timelineItem.steps.length;\n }\n }\n return (\n -1 * count * angleBetweenMinorSteps * (lineCountFillBetweenSteps + 1) -\n angleBetweenMinorSteps * boundaryPlaceholderLinesCount\n );\n },\n );\n\n return (\n <div\n {...restProps}\n className={cn(\"relative h-[380px] w-full overflow-hidden\", className)}\n >\n <div\n style={{\n transform: `translateX(-50%) rotate(${circleContainerRotateDeg}deg)`,\n width: `${circleWidth}px`,\n }}\n className=\"absolute left-1/2 top-28 aspect-square origin-center rounded-full transition-all duration-500 ease-in-out\"\n >\n {data.map((line, lineIndex) => {\n return (\n <div key={`${lineIndex}`}>\n {line.steps.map((step, stepIndex) => {\n // calc the angle of the step\n const angle =\n angleBetweenMinorSteps *\n (lineCountFillBetweenSteps + 1) *\n (data\n .slice(0, lineIndex)\n .map((item) => item.steps.length)\n .reduce((prev, current) => prev + current, 0) +\n stepIndex) +\n angleBetweenMinorSteps * boundaryPlaceholderLinesCount;\n const isLastStep =\n lineIndex === data.length - 1 &&\n stepIndex === line.steps.length - 1;\n const isFirstStep = lineIndex === 0 && stepIndex === 0;\n // check if the step is active\n const isActive =\n Math.abs(angle + circleContainerRotateDeg) < 0.01;\n return (\n <div key={`${lineIndex}-${stepIndex}`}>\n {/* placeholder lines before the first step */}\n {isFirstStep && (\n <PlaceholderLines\n isFirstStep={true}\n isLastStep={false}\n angle={angle}\n angleBetweenMinorSteps={angleBetweenMinorSteps}\n lineCountFillBetweenSteps={lineCountFillBetweenSteps}\n boundaryPlaceholderLinesCount={\n boundaryPlaceholderLinesCount\n }\n lineIndex={lineIndex}\n stepIndex={stepIndex}\n circleWidth={circleWidth}\n circleContainerRotateDeg={circleContainerRotateDeg}\n />\n )}\n <div\n className={cn(\n \"absolute left-1/2 top-0 -translate-x-1/2 cursor-pointer transition-all duration-200\",\n isActive ? \"h-[120px] w-[2px]\" : \"h-16 w-[1.5px]\",\n )}\n style={{\n transformOrigin: `50% ${circleWidth / 2}px`,\n transform: `rotate(${angle}deg)`,\n }}\n onClick={() => {\n setCircleContainerRotateDeg(-1 * angle);\n }}\n >\n <div\n className={cn(\n \"h-full w-full transition-colors duration-200\",\n isActive\n ? \"bg-[var(--step-line-active-color,#888888)] dark:bg-[var(--step-line-active-color,#9780ff)]\"\n : \"bg-[var(--step-line-inactive-color,#b1b1b1)] dark:bg-[var(--step-line-inactive-color,#737373)]\",\n )}\n style={{\n transformOrigin: \"center top\",\n transform: `rotate(${\n -1 * angle - circleContainerRotateDeg\n }deg)`,\n }}\n >\n <div\n className={cn(\n \"absolute bottom-0 left-1/2 aspect-square -translate-x-1/2\",\n isActive\n ? \"translate-y-[calc(100%_+_14px)] scale-[1.2] text-[var(--icon-active-color,#555555)] dark:text-[var(--icon-active-color,#d4d4d4)]\"\n : \"translate-y-[calc(100%_+_4px)] scale-100 text-[var(--icon-inactive-color,#a3a3a3)] dark:text-[var(--icon-inactive-color,#a3a3a3)]\",\n )}\n >\n {step.icon}\n </div>\n <p\n className={cn(\n \"absolute bottom-0 left-1/2 line-clamp-3 flex w-[240px] -translate-x-1/2 translate-y-[calc(100%_+_42px)] items-center justify-center text-center text-sm transition-opacity duration-300 ease-in\",\n \"text-[var(--description-color,#555555)] dark:text-[var(--description-color,#d4d4d4)]\",\n isActive ? \"opacity-100\" : \"opacity-0\",\n )}\n >\n {step.content}\n </p>\n </div>\n {stepIndex === 0 && (\n <div\n className={cn(\n \"absolute left-1/2 top-0 z-10 -translate-x-1/2 translate-y-[calc(-100%-24px)] whitespace-nowrap\",\n isActive\n ? \"text-[var(--time-active-color,#555555)] dark:text-[var(--time-active-color,#d4d4d4)]\"\n : \"text-[var(--time-inactive-color,#a3a3a3)] dark:text-[var(--time-inactive-color,#a3a3a3)]\",\n )}\n >\n {line.time}\n </div>\n )}\n </div>\n\n {/* fill lines between steps, in the last step, fill the placeholder lines */}\n <PlaceholderLines\n isFirstStep={false}\n isLastStep={isLastStep}\n angle={angle}\n angleBetweenMinorSteps={angleBetweenMinorSteps}\n lineCountFillBetweenSteps={lineCountFillBetweenSteps}\n boundaryPlaceholderLinesCount={\n boundaryPlaceholderLinesCount\n }\n lineIndex={lineIndex}\n stepIndex={stepIndex}\n circleWidth={circleWidth}\n circleContainerRotateDeg={circleContainerRotateDeg}\n />\n </div>\n );\n })}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\ninterface PlaceholderLinesProps {\n isFirstStep: boolean;\n angleBetweenMinorSteps: number;\n angle: number;\n lineCountFillBetweenSteps: number;\n boundaryPlaceholderLinesCount: number;\n isLastStep: boolean;\n lineIndex: number;\n stepIndex: number;\n circleWidth: number;\n circleContainerRotateDeg: number;\n}\nfunction PlaceholderLines(props: PlaceholderLinesProps) {\n const {\n isFirstStep,\n isLastStep,\n angle,\n angleBetweenMinorSteps,\n lineCountFillBetweenSteps,\n boundaryPlaceholderLinesCount,\n lineIndex,\n stepIndex,\n circleWidth,\n circleContainerRotateDeg,\n } = props;\n\n const getAngle = (index: number) => {\n if (isFirstStep) {\n return index * angleBetweenMinorSteps;\n } else {\n return angle + (index + 1) * angleBetweenMinorSteps;\n }\n };\n\n return (\n <>\n {Array(\n isLastStep || isFirstStep\n ? boundaryPlaceholderLinesCount\n : lineCountFillBetweenSteps,\n )\n .fill(\"\")\n .map((_, fillIndex) => {\n const fillAngle = getAngle(fillIndex);\n return (\n <div\n key={`${lineIndex}-${stepIndex}-${fillIndex}`}\n className=\"absolute left-1/2 top-0 h-[34px] w-[1px] -translate-x-1/2\"\n style={{\n transformOrigin: `50% ${circleWidth / 2}px`,\n transform: `rotate(${fillAngle}deg)`,\n }}\n >\n <div\n className=\"h-full w-full bg-[var(--placeholder-line-color,#a1a1a1)] dark:bg-[var(--placeholder-line-color,#737373)]\"\n style={{\n transformOrigin: \"center top\",\n transform: `rotate(${\n -1 * fillAngle - circleContainerRotateDeg\n }deg)`,\n }}\n ></div>\n </div>\n );\n })}\n </>\n );\n}\n",+ "type": "registry:ui",+ "target": "components/magicui/arc-timeline.tsx"+ }+ ]+}\ No newline at end of filediff --git a/public/r/arc-timeline.json b/public/r/arc-timeline.jsonnew file mode 100644index 00000000..1ad62a97--- /dev/null+++ b/public/r/arc-timeline.json@@ -0,0 +1,15 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "arc-timeline",+ "type": "registry:ui",+ "title": "Arc Timeline",+ "description": "A curved timeline that elegantly visualizes key milestones, perfect for Web3 and AI roadmaps.",+ "files": [+ {+ "path": "registry/magicui/arc-timeline.tsx",+ "content": "\"use client\";\nimport { cn } from \"@/lib/utils\";\nimport { ComponentPropsWithoutRef, ReactNode, useState } from \"react\";\n\nexport interface ArcTimelineItem {\n time: ReactNode;\n steps: Array<{\n icon: ReactNode;\n content: ReactNode;\n }>;\n}\ninterface ArcTimelineProps extends ComponentPropsWithoutRef<\"div\"> {\n /**\n * Optional CSS class name to apply custom styles\n */\n className?: string;\n /**\n * The data of the arc timeline\n */\n data: ArcTimelineItem[];\n /**\n * The configuration of the arc timeline\n */\n arcConfig?: {\n /**\n * The width of the circle, default is 5000\n */\n circleWidth?: number;\n /**\n * The angle between minor steps, default is 0.35\n */\n angleBetweenMinorSteps?: number;\n /**\n * The number of lines to fill between steps, default is 10\n */\n lineCountFillBetweenSteps?: number;\n /**\n * The number of lines to fill in before the first step and after the last step\n */\n boundaryPlaceholderLinesCount?: number;\n };\n /**\n * The default active step\n */\n defaultActiveStep?: {\n /**\n * The time of the default active step\n */\n time?: string;\n /**\n * The index of the default active step\n */\n stepIndex?: number;\n };\n}\n\nexport function ArcTimeline(props: ArcTimelineProps) {\n const {\n className,\n children,\n data,\n arcConfig = {},\n defaultActiveStep = {},\n ...restProps\n } = props;\n\n const {\n circleWidth = 5000,\n angleBetweenMinorSteps = 0.35,\n lineCountFillBetweenSteps = 10,\n boundaryPlaceholderLinesCount = 50,\n } = arcConfig;\n\n const {\n time: defaultActiveTime = data[0].time,\n stepIndex: defaultActiveStepIndex = 0,\n } = defaultActiveStep || {};\n\n const [circleContainerRotateDeg, setCircleContainerRotateDeg] = useState(\n () => {\n let count = 0;\n for (const timelineItem of data) {\n if (timelineItem.time === defaultActiveTime) {\n count += defaultActiveStepIndex;\n break;\n } else {\n count += timelineItem.steps.length;\n }\n }\n return (\n -1 * count * angleBetweenMinorSteps * (lineCountFillBetweenSteps + 1) -\n angleBetweenMinorSteps * boundaryPlaceholderLinesCount\n );\n },\n );\n\n return (\n <div\n {...restProps}\n className={cn(\"relative h-[380px] w-full overflow-hidden\", className)}\n >\n <div\n style={{\n transform: `translateX(-50%) rotate(${circleContainerRotateDeg}deg)`,\n width: `${circleWidth}px`,\n }}\n className=\"absolute left-1/2 top-28 aspect-square origin-center rounded-full transition-all duration-500 ease-in-out\"\n >\n {data.map((line, lineIndex) => {\n return (\n <div key={`${lineIndex}`}>\n {line.steps.map((step, stepIndex) => {\n // calc the angle of the step\n const angle =\n angleBetweenMinorSteps *\n (lineCountFillBetweenSteps + 1) *\n (data\n .slice(0, lineIndex)\n .map((item) => item.steps.length)\n .reduce((prev, current) => prev + current, 0) +\n stepIndex) +\n angleBetweenMinorSteps * boundaryPlaceholderLinesCount;\n const isLastStep =\n lineIndex === data.length - 1 &&\n stepIndex === line.steps.length - 1;\n const isFirstStep = lineIndex === 0 && stepIndex === 0;\n // check if the step is active\n const isActive =\n Math.abs(angle + circleContainerRotateDeg) < 0.01;\n return (\n <div key={`${lineIndex}-${stepIndex}`}>\n {/* placeholder lines before the first step */}\n {isFirstStep && (\n <PlaceholderLines\n isFirstStep={true}\n isLastStep={false}\n angle={angle}\n angleBetweenMinorSteps={angleBetweenMinorSteps}\n lineCountFillBetweenSteps={lineCountFillBetweenSteps}\n boundaryPlaceholderLinesCount={\n boundaryPlaceholderLinesCount\n }\n lineIndex={lineIndex}\n stepIndex={stepIndex}\n circleWidth={circleWidth}\n circleContainerRotateDeg={circleContainerRotateDeg}\n />\n )}\n <div\n className={cn(\n \"absolute left-1/2 top-0 -translate-x-1/2 cursor-pointer transition-all duration-200\",\n isActive ? \"h-[120px] w-[2px]\" : \"h-16 w-[1.5px]\",\n )}\n style={{\n transformOrigin: `50% ${circleWidth / 2}px`,\n transform: `rotate(${angle}deg)`,\n }}\n onClick={() => {\n setCircleContainerRotateDeg(-1 * angle);\n }}\n >\n <div\n className={cn(\n \"h-full w-full transition-colors duration-200\",\n isActive\n ? \"bg-[var(--step-line-active-color,#888888)] dark:bg-[var(--step-line-active-color,#9780ff)]\"\n : \"bg-[var(--step-line-inactive-color,#b1b1b1)] dark:bg-[var(--step-line-inactive-color,#737373)]\",\n )}\n style={{\n transformOrigin: \"center top\",\n transform: `rotate(${\n -1 * angle - circleContainerRotateDeg\n }deg)`,\n }}\n >\n <div\n className={cn(\n \"absolute bottom-0 left-1/2 aspect-square -translate-x-1/2\",\n isActive\n ? \"translate-y-[calc(100%_+_14px)] scale-[1.2] text-[var(--icon-active-color,#555555)] dark:text-[var(--icon-active-color,#d4d4d4)]\"\n : \"translate-y-[calc(100%_+_4px)] scale-100 text-[var(--icon-inactive-color,#a3a3a3)] dark:text-[var(--icon-inactive-color,#a3a3a3)]\",\n )}\n >\n {step.icon}\n </div>\n <p\n className={cn(\n \"absolute bottom-0 left-1/2 line-clamp-3 flex w-[240px] -translate-x-1/2 translate-y-[calc(100%_+_42px)] items-center justify-center text-center text-sm transition-opacity duration-300 ease-in\",\n \"text-[var(--description-color,#555555)] dark:text-[var(--description-color,#d4d4d4)]\",\n isActive ? \"opacity-100\" : \"opacity-0\",\n )}\n >\n {step.content}\n </p>\n </div>\n {stepIndex === 0 && (\n <div\n className={cn(\n \"absolute left-1/2 top-0 z-10 -translate-x-1/2 translate-y-[calc(-100%-24px)] whitespace-nowrap\",\n isActive\n ? \"text-[var(--time-active-color,#555555)] dark:text-[var(--time-active-color,#d4d4d4)]\"\n : \"text-[var(--time-inactive-color,#a3a3a3)] dark:text-[var(--time-inactive-color,#a3a3a3)]\",\n )}\n >\n {line.time}\n </div>\n )}\n </div>\n\n {/* fill lines between steps, in the last step, fill the placeholder lines */}\n <PlaceholderLines\n isFirstStep={false}\n isLastStep={isLastStep}\n angle={angle}\n angleBetweenMinorSteps={angleBetweenMinorSteps}\n lineCountFillBetweenSteps={lineCountFillBetweenSteps}\n boundaryPlaceholderLinesCount={\n boundaryPlaceholderLinesCount\n }\n lineIndex={lineIndex}\n stepIndex={stepIndex}\n circleWidth={circleWidth}\n circleContainerRotateDeg={circleContainerRotateDeg}\n />\n </div>\n );\n })}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\ninterface PlaceholderLinesProps {\n isFirstStep: boolean;\n angleBetweenMinorSteps: number;\n angle: number;\n lineCountFillBetweenSteps: number;\n boundaryPlaceholderLinesCount: number;\n isLastStep: boolean;\n lineIndex: number;\n stepIndex: number;\n circleWidth: number;\n circleContainerRotateDeg: number;\n}\nfunction PlaceholderLines(props: PlaceholderLinesProps) {\n const {\n isFirstStep,\n isLastStep,\n angle,\n angleBetweenMinorSteps,\n lineCountFillBetweenSteps,\n boundaryPlaceholderLinesCount,\n lineIndex,\n stepIndex,\n circleWidth,\n circleContainerRotateDeg,\n } = props;\n\n const getAngle = (index: number) => {\n if (isFirstStep) {\n return index * angleBetweenMinorSteps;\n } else {\n return angle + (index + 1) * angleBetweenMinorSteps;\n }\n };\n\n return (\n <>\n {Array(\n isLastStep || isFirstStep\n ? boundaryPlaceholderLinesCount\n : lineCountFillBetweenSteps,\n )\n .fill(\"\")\n .map((_, fillIndex) => {\n const fillAngle = getAngle(fillIndex);\n return (\n <div\n key={`${lineIndex}-${stepIndex}-${fillIndex}`}\n className=\"absolute left-1/2 top-0 h-[34px] w-[1px] -translate-x-1/2\"\n style={{\n transformOrigin: `50% ${circleWidth / 2}px`,\n transform: `rotate(${fillAngle}deg)`,\n }}\n >\n <div\n className=\"h-full w-full bg-[var(--placeholder-line-color,#a1a1a1)] dark:bg-[var(--placeholder-line-color,#737373)]\"\n style={{\n transformOrigin: \"center top\",\n transform: `rotate(${\n -1 * fillAngle - circleContainerRotateDeg\n }deg)`,\n }}\n ></div>\n </div>\n );\n })}\n </>\n );\n}\n",+ "type": "registry:ui",+ "target": "components/magicui/arc-timeline.tsx"+ }+ ]+}\ No newline at end of filediff --git a/public/registry.json b/public/registry.jsonindex fd01d520..04aed234 100644--- a/public/registry.json+++ b/public/registry.json@@ -1328,6 +1328,19 @@}]},+ {+ "name": "arc-timeline",+ "type": "registry:ui",+ "title": "Arc Timeline",+ "description": "A curved timeline that elegantly visualizes key milestones, perfect for Web3 and AI roadmaps.",+ "files": [+ {+ "path": "registry/magicui/arc-timeline.tsx",+ "type": "registry:ui",+ "target": "components/magicui/arc-timeline.tsx"+ }+ ]+ },{"name": "magic-card-demo","type": "registry:example",@@ -3383,6 +3396,27 @@}]},+ {+ "name": "arc-timeline-demo",+ "type": "registry:example",+ "title": "Arc Timeline Demo",+ "description": "Example showing an arc timeline component.",+ "registryDependencies": [+ "https://magicui.design/r/arc-timeline"+ ],+ "files": [+ {+ "path": "registry/example/arc-timeline-demo.tsx",+ "type": "registry:example",+ "target": "components/arc-timeline-demo.tsx"+ },+ {+ "path": "registry/magicui/arc-timeline.tsx",+ "type": "registry:ui",+ "target": "components/magicui/arc-timeline.tsx"+ }+ ]+ },{"name": "utils","type": "registry:lib",diff --git a/registry.json b/registry.jsonindex fd01d520..04aed234 100644--- a/registry.json+++ b/registry.json@@ -1328,6 +1328,19 @@}]},+ {+ "name": "arc-timeline",+ "type": "registry:ui",+ "title": "Arc Timeline",+ "description": "A curved timeline that elegantly visualizes key milestones, perfect for Web3 and AI roadmaps.",+ "files": [+ {+ "path": "registry/magicui/arc-timeline.tsx",+ "type": "registry:ui",+ "target": "components/magicui/arc-timeline.tsx"+ }+ ]+ },{"name": "magic-card-demo","type": "registry:example",@@ -3383,6 +3396,27 @@}]},+ {+ "name": "arc-timeline-demo",+ "type": "registry:example",+ "title": "Arc Timeline Demo",+ "description": "Example showing an arc timeline component.",+ "registryDependencies": [+ "https://magicui.design/r/arc-timeline"+ ],+ "files": [+ {+ "path": "registry/example/arc-timeline-demo.tsx",+ "type": "registry:example",+ "target": "components/arc-timeline-demo.tsx"+ },+ {+ "path": "registry/magicui/arc-timeline.tsx",+ "type": "registry:ui",+ "target": "components/magicui/arc-timeline.tsx"+ }+ ]+ },{"name": "utils","type": "registry:lib",diff --git a/registry/example/arc-timeline-demo.tsx b/registry/example/arc-timeline-demo.tsxnew file mode 100644index 00000000..02346d21--- /dev/null+++ b/registry/example/arc-timeline-demo.tsx@@ -0,0 +1,197 @@+import { ArcTimeline, ArcTimelineItem } from "@/registry/magicui/arc-timeline";+import {+ RocketIcon,+ CubeIcon,+ LockClosedIcon,+ GlobeIcon,+ GearIcon,+ LightningBoltIcon,+ StarIcon,+ MagicWandIcon,+} from "@radix-ui/react-icons";++export default function ArcTimelineDemo() {+ return (+ <ArcTimeline+ // className={cn(+ // "[--step-line-active-color:#888888] dark:[--step-line-active-color:#9780ff]",+ // "[--step-line-inactive-color:#b1b1b1] dark:[--step-line-inactive-color:#737373]",+ // "[--placeholder-line-color:#a1a1a1] dark:[--placeholder-line-color:#737373]",+ // "[--icon-active-color:#555555] dark:[--icon-active-color:#d4d4d4]",+ // "[--icon-inactive-color:#a3a3a3] dark:[--icon-inactive-color:#a3a3a3]",+ // "[--time-active-color:#555555] dark:[--time-active-color:#d4d4d4]",+ // "[--time-inactive-color:#a3a3a3] dark:[--time-inactive-color:#a3a3a3]",+ // "[--description-color:#555555] dark:[--description-color:#d4d4d4]"+ // )}+ data={TIMELINE}+ defaultActiveStep={{ time: "2025 Q2", stepIndex: 0 }}+ arcConfig={{+ circleWidth: 4500,+ angleBetweenMinorSteps: 0.4,+ lineCountFillBetweenSteps: 8,+ boundaryPlaceholderLinesCount: 50,+ }}+ />+ );+}++const TIMELINE: ArcTimelineItem[] = [+ {+ time: "2022",+ steps: [+ {+ icon: <RocketIcon width={20} height={20} />,+ content:+ "Founded Visionary Tech, a cutting-edge AI development company.",+ },+ {+ icon: <CubeIcon width={20} height={20} />,+ content:+ "Launched first AI-powered mobile app for personalized recommendations.",+ },+ ],+ },+ {+ time: "2023",+ steps: [+ {+ icon: <LockClosedIcon width={20} height={20} />,+ content: "Raised $3M seed round at a $20M valuation.",+ },+ {+ icon: <GlobeIcon width={20} height={20} />,+ content:+ "Expanded to global markets with localized app versions in 5 countries.",+ },+ {+ icon: <GearIcon width={20} height={20} />,+ content:+ "Implemented enhanced machine learning algorithms for data prediction.",+ },+ ],+ },+ {+ time: "2024",+ steps: [+ {+ icon: <RocketIcon width={20} height={20} />,+ content:+ "Introduced AI-powered virtual assistant for customer service.",+ },+ {+ icon: <GlobeIcon width={20} height={20} />,+ content:+ "Partnered with several tech giants to enhance app capabilities.",+ },+ {+ icon: <MagicWandIcon width={20} height={20} />,+ content:+ "Launched AR-based features for more immersive user experiences.",+ },+ ],+ },+ {+ time: "2025 Q1",+ steps: [+ {+ icon: <StarIcon width={20} height={20} />,+ content:+ "Rolled out AI-driven marketplace for personalized product discovery.",+ },+ {+ icon: <LightningBoltIcon width={20} height={20} />,+ content: "Introduced blockchain integration for secure transactions.",+ },+ {+ icon: <RocketIcon width={20} height={20} />,+ content:+ "Showcased at CES with revolutionary AI-powered consumer products.",+ },+ ],+ },+ {+ time: "2025 Q2",+ steps: [+ {+ icon: <GearIcon width={20} height={20} />,+ content: "Rebranded company with new logo and visual identity.",+ },+ {+ icon: <StarIcon width={20} height={20} />,+ content:+ "Launched AI-driven content creation tool for marketing teams.",+ },+ {+ icon: <CubeIcon width={20} height={20} />,+ content:+ "Acquired a competitor in the AI space to strengthen market position.",+ },+ ],+ },+ {+ time: "2025 Q3",+ steps: [+ {+ icon: <CubeIcon width={20} height={20} />,+ content: "Launched self-driving AI platform for industrial automation.",+ },+ {+ icon: <MagicWandIcon width={20} height={20} />,+ content: "Added virtual reality integration to the product suite.",+ },+ ],+ },+ {+ time: "2025 Q4",+ steps: [+ {+ icon: <StarIcon width={20} height={20} />,+ content:+ "Introduced AI-driven analytics dashboard for enterprise clients.",+ },+ {+ icon: <LightningBoltIcon width={20} height={20} />,+ content:+ "Launched international expansion into Asian and European markets.",+ },+ {+ icon: <RocketIcon width={20} height={20} />,+ content: "Hosted first global conference showcasing AI innovations.",+ },+ ],+ },+ {+ time: "2026 Q1",+ steps: [+ {+ icon: <GearIcon width={20} height={20} />,+ content:+ "Released API for developers to integrate AI into their applications.",+ },+ {+ icon: <StarIcon width={20} height={20} />,+ content:+ "Launched new AI-powered voice assistant with multi-language support.",+ },+ {+ icon: <GlobeIcon width={20} height={20} />,+ content:+ "Partnered with government agencies for AI-driven policy making.",+ },+ ],+ },+ {+ time: "2026 Q2",+ steps: [+ {+ icon: <GearIcon width={20} height={20} />,+ content: "Unveiled new AI-powered robotics platform for manufacturing.",+ },+ {+ icon: <MagicWandIcon width={20} height={20} />,+ content:+ "Introduced machine learning models for sustainable energy solutions.",+ },+ ],+ },+];diff --git a/registry/magicui/arc-timeline.tsx b/registry/magicui/arc-timeline.tsxnew file mode 100644index 00000000..a7ca958a--- /dev/null+++ b/registry/magicui/arc-timeline.tsx@@ -0,0 +1,303 @@+"use client";+import { cn } from "@/lib/utils";+import { ComponentPropsWithoutRef, ReactNode, useState } from "react";++export interface ArcTimelineItem {+ time: ReactNode;+ steps: Array<{+ icon: ReactNode;+ content: ReactNode;+ }>;+}+interface ArcTimelineProps extends ComponentPropsWithoutRef<"div"> {+ /**+ * Optional CSS class name to apply custom styles+ */+ className?: string;+ /**+ * The data of the arc timeline+ */+ data: ArcTimelineItem[];+ /**+ * The configuration of the arc timeline+ */+ arcConfig?: {+ /**+ * The width of the circle, default is 5000+ */+ circleWidth?: number;+ /**+ * The angle between minor steps, default is 0.35+ */+ angleBetweenMinorSteps?: number;+ /**+ * The number of lines to fill between steps, default is 10+ */+ lineCountFillBetweenSteps?: number;+ /**+ * The number of lines to fill in before the first step and after the last step+ */+ boundaryPlaceholderLinesCount?: number;+ };+ /**+ * The default active step+ */+ defaultActiveStep?: {+ /**+ * The time of the default active step+ */+ time?: string;+ /**+ * The index of the default active step+ */+ stepIndex?: number;+ };+}++export function ArcTimeline(props: ArcTimelineProps) {+ const {+ className,+ children,+ data,+ arcConfig = {},+ defaultActiveStep = {},+ ...restProps+ } = props;++ const {+ circleWidth = 5000,+ angleBetweenMinorSteps = 0.35,+ lineCountFillBetweenSteps = 10,+ boundaryPlaceholderLinesCount = 50,+ } = arcConfig;++ const {+ time: defaultActiveTime = data[0].time,+ stepIndex: defaultActiveStepIndex = 0,+ } = defaultActiveStep || {};++ const [circleContainerRotateDeg, setCircleContainerRotateDeg] = useState(+ () => {+ let count = 0;+ for (const timelineItem of data) {+ if (timelineItem.time === defaultActiveTime) {+ count += defaultActiveStepIndex;+ break;+ } else {+ count += timelineItem.steps.length;+ }+ }+ return (+ -1 * count * angleBetweenMinorSteps * (lineCountFillBetweenSteps + 1) -+ angleBetweenMinorSteps * boundaryPlaceholderLinesCount+ );+ },+ );++ return (+ <div+ {...restProps}+ className={cn("relative h-[380px] w-full overflow-hidden", className)}+ >+ <div+ style={{+ transform: `translateX(-50%) rotate(${circleContainerRotateDeg}deg)`,+ width: `${circleWidth}px`,+ }}+ className="absolute left-1/2 top-28 aspect-square origin-center rounded-full transition-all duration-500 ease-in-out"+ >+ {data.map((line, lineIndex) => {+ return (+ <div key={`${lineIndex}`}>+ {line.steps.map((step, stepIndex) => {+ // calc the angle of the step+ const angle =+ angleBetweenMinorSteps *+ (lineCountFillBetweenSteps + 1) *+ (data+ .slice(0, lineIndex)+ .map((item) => item.steps.length)+ .reduce((prev, current) => prev + current, 0) ++ stepIndex) ++ angleBetweenMinorSteps * boundaryPlaceholderLinesCount;+ const isLastStep =+ lineIndex === data.length - 1 &&+ stepIndex === line.steps.length - 1;+ const isFirstStep = lineIndex === 0 && stepIndex === 0;+ // check if the step is active+ const isActive =+ Math.abs(angle + circleContainerRotateDeg) < 0.01;+ return (+ <div key={`${lineIndex}-${stepIndex}`}>+ {/* placeholder lines before the first step */}+ {isFirstStep && (+ <PlaceholderLines+ isFirstStep={true}+ isLastStep={false}+ angle={angle}+ angleBetweenMinorSteps={angleBetweenMinorSteps}+ lineCountFillBetweenSteps={lineCountFillBetweenSteps}+ boundaryPlaceholderLinesCount={+ boundaryPlaceholderLinesCount+ }+ lineIndex={lineIndex}+ stepIndex={stepIndex}+ circleWidth={circleWidth}+ circleContainerRotateDeg={circleContainerRotateDeg}+ />+ )}+ <div+ className={cn(+ "absolute left-1/2 top-0 -translate-x-1/2 cursor-pointer transition-all duration-200",+ isActive ? "h-[120px] w-[2px]" : "h-16 w-[1.5px]",+ )}+ style={{+ transformOrigin: `50% ${circleWidth / 2}px`,+ transform: `rotate(${angle}deg)`,+ }}+ onClick={() => {+ setCircleContainerRotateDeg(-1 * angle);+ }}+ >+ <div+ className={cn(+ "h-full w-full transition-colors duration-200",+ isActive+ ? "bg-[var(--step-line-active-color,#888888)] dark:bg-[var(--step-line-active-color,#9780ff)]"+ : "bg-[var(--step-line-inactive-color,#b1b1b1)] dark:bg-[var(--step-line-inactive-color,#737373)]",+ )}+ style={{+ transformOrigin: "center top",+ transform: `rotate(${+ -1 * angle - circleContainerRotateDeg+ }deg)`,+ }}+ >+ <div+ className={cn(+ "absolute bottom-0 left-1/2 aspect-square -translate-x-1/2",+ isActive+ ? "translate-y-[calc(100%_+_14px)] scale-[1.2] text-[var(--icon-active-color,#555555)] dark:text-[var(--icon-active-color,#d4d4d4)]"+ : "translate-y-[calc(100%_+_4px)] scale-100 text-[var(--icon-inactive-color,#a3a3a3)] dark:text-[var(--icon-inactive-color,#a3a3a3)]",+ )}+ >+ {step.icon}+ </div>+ <p+ className={cn(+ "absolute bottom-0 left-1/2 line-clamp-3 flex w-[240px] -translate-x-1/2 translate-y-[calc(100%_+_42px)] items-center justify-center text-center text-sm transition-opacity duration-300 ease-in",+ "text-[var(--description-color,#555555)] dark:text-[var(--description-color,#d4d4d4)]",+ isActive ? "opacity-100" : "opacity-0",+ )}+ >+ {step.content}+ </p>+ </div>+ {stepIndex === 0 && (+ <div+ className={cn(+ "absolute left-1/2 top-0 z-10 -translate-x-1/2 translate-y-[calc(-100%-24px)] whitespace-nowrap",+ isActive+ ? "text-[var(--time-active-color,#555555)] dark:text-[var(--time-active-color,#d4d4d4)]"+ : "text-[var(--time-inactive-color,#a3a3a3)] dark:text-[var(--time-inactive-color,#a3a3a3)]",+ )}+ >+ {line.time}+ </div>+ )}+ </div>++ {/* fill lines between steps, in the last step, fill the placeholder lines */}+ <PlaceholderLines+ isFirstStep={false}+ isLastStep={isLastStep}+ angle={angle}+ angleBetweenMinorSteps={angleBetweenMinorSteps}+ lineCountFillBetweenSteps={lineCountFillBetweenSteps}+ boundaryPlaceholderLinesCount={+ boundaryPlaceholderLinesCount+ }+ lineIndex={lineIndex}+ stepIndex={stepIndex}+ circleWidth={circleWidth}+ circleContainerRotateDeg={circleContainerRotateDeg}+ />+ </div>+ );+ })}+ </div>+ );+ })}+ </div>+ </div>+ );+}++interface PlaceholderLinesProps {+ isFirstStep: boolean;+ angleBetweenMinorSteps: number;+ angle: number;+ lineCountFillBetweenSteps: number;+ boundaryPlaceholderLinesCount: number;+ isLastStep: boolean;+ lineIndex: number;+ stepIndex: number;+ circleWidth: number;+ circleContainerRotateDeg: number;+}+function PlaceholderLines(props: PlaceholderLinesProps) {+ const {+ isFirstStep,+ isLastStep,+ angle,+ angleBetweenMinorSteps,+ lineCountFillBetweenSteps,+ boundaryPlaceholderLinesCount,+ lineIndex,+ stepIndex,+ circleWidth,+ circleContainerRotateDeg,+ } = props;++ const getAngle = (index: number) => {+ if (isFirstStep) {+ return index * angleBetweenMinorSteps;+ } else {+ return angle + (index + 1) * angleBetweenMinorSteps;+ }+ };++ return (+ <>+ {Array(+ isLastStep || isFirstStep+ ? boundaryPlaceholderLinesCount+ : lineCountFillBetweenSteps,+ )+ .fill("")+ .map((_, fillIndex) => {+ const fillAngle = getAngle(fillIndex);+ return (+ <div+ key={`${lineIndex}-${stepIndex}-${fillIndex}`}+ className="absolute left-1/2 top-0 h-[34px] w-[1px] -translate-x-1/2"+ style={{+ transformOrigin: `50% ${circleWidth / 2}px`,+ transform: `rotate(${fillAngle}deg)`,+ }}+ >+ <div+ className="h-full w-full bg-[var(--placeholder-line-color,#a1a1a1)] dark:bg-[var(--placeholder-line-color,#737373)]"+ style={{+ transformOrigin: "center top",+ transform: `rotate(${+ -1 * fillAngle - circleContainerRotateDeg+ }deg)`,+ }}+ ></div>+ </div>+ );+ })}+ </>+ );+}diff --git a/registry/registry-examples.ts b/registry/registry-examples.tsindex deaf3a60..e6ccae06 100644--- a/registry/registry-examples.ts+++ b/registry/registry-examples.ts@@ -1800,4 +1800,23 @@ export const examples: Registry["items"] = [],dependencies: ["rough-notation"],},+ {+ name: "arc-timeline-demo",+ type: "registry:example",+ title: "Arc Timeline Demo",+ description: "Example showing an arc timeline component.",+ registryDependencies: ["https://magicui.design/r/arc-timeline"],+ files: [+ {+ path: "registry/example/arc-timeline-demo.tsx",+ type: "registry:example",+ target: "components/arc-timeline-demo.tsx",+ },+ {+ path: "registry/magicui/arc-timeline.tsx",+ type: "registry:ui",+ target: "components/magicui/arc-timeline.tsx",+ },+ ],+ },];diff --git a/registry/registry-ui.ts b/registry/registry-ui.tsindex b973dfe8..4b72bace 100644--- a/registry/registry-ui.ts+++ b/registry/registry-ui.ts@@ -1259,4 +1259,18 @@ export const ui: Registry["items"] = [],dependencies: ["rough-notation"],},+ {+ name: "arc-timeline",+ type: "registry:ui",+ title: "Arc Timeline",+ description:+ "A curved timeline that elegantly visualizes key milestones, perfect for Web3 and AI roadmaps.",+ files: [+ {+ path: "registry/magicui/arc-timeline.tsx",+ type: "registry:ui",+ target: "components/magicui/arc-timeline.tsx",+ },+ ],+ },];