Timeline

This is a Timeline component.

2023-01-01

Item 1 Content

2023-02-01

Item 2 Content

2023-03-01

Item 3 Content

2023-04-01

Item 4 Content

2023-05-01

Item 5 Content

Installation

1. Dependencies

npm install clsx tailwind-merge framer-motion

2. Paste inside @/lib/utils.ts

import { clsx } from "clsx";
import { twMerge } from "tailwind-merge";

export function cn(...inputs: Parameters<typeof clsx>) {
  return twMerge(clsx(...inputs));
}

3. Copy Timeline Code

Loading...

Copy Timeline Code

Timeline Props

NameTypeRequiredDefaultDescription
childrenReact.ReactNodeYesundefinedThe content of the timeline.
align"left" | "right" | "alternate"No"left"Alignment of the timeline.
classNamestringNoundefinedAdditional class names for styling.

TimelineItem Props

NameTypeRequiredDefaultDescription
childrenReact.ReactNodeYesundefinedThe content of the timeline item.
datestringNoundefinedThe date of the timeline item.
iconReact.ReactNodeNoundefinedThe icon to display in the timeline item.
colorstringNoundefinedThe background color of the timeline item.
align"left" | "right"No"left"Alignment of the timeline item.
classNamestringNoundefinedAdditional class names for styling.