Timeline Steps
abui/timeline-stepsFreeComponent
A component for displaying chronological events, activities, or steps
Live preview
live · rendered by the registry
Rendered by abui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://abui.io/r/timeline-steps.jsonSource
1import * as React from "react"2import { cva, type VariantProps } from "class-variance-authority"34import { cn } from "@/lib/utils"56/* -----------------------------------------------------------------------------7 * Timeline (root container)8 * -------------------------------------------------------------------------- */910const timelineStepsVariants = cva("flex", {11 variants: {12 orientation: {13 vertical: "flex-col",14 horizontal: "flex-row overflow-x-auto",15 },16 position: {17 left: "",18 right: "",19 alternate: "",20 },21 },22 defaultVariants: {23 orientation: "vertical",24 position: "left",25 },26})2728interface TimelineStepsProps extends React.ComponentProps<"div">, VariantProps<typeof timelineStepsVariants> {}2930function TimelineSteps({ className, orientation, position, ...props }: TimelineStepsProps) {31 return (32 <div33 data-slot="timeline-steps"34 data-orientation={orientation}35 data-position={position}36 className={cn(timelineStepsVariants({ orientation, position }), className)}37 {...props}38 />39 )40}4142/* -----------------------------------------------------------------------------43 * TimelineItem44 * -------------------------------------------------------------------------- */4546const timelineStepsItemVariants = cva("relative flex flex-col", {47 variants: {48 orientation: {49 vertical: "pb-8 last:pb-0",50 horizontal: "flex-1 items-center",51 },52 status: {53 default: "",54 completed: "",55 current: "",56 upcoming: "opacity-60",57 },58 },59 defaultVariants: {60 orientation: "vertical",61 status: "default",62 },63})6465interface TimelineStepsItemProps extends React.ComponentProps<"div">, VariantProps<typeof timelineStepsItemVariants> {}6667function TimelineStepsItem({ className, orientation, status, ...props }: TimelineStepsItemProps) {68 return (69 <div70 data-slot="timeline-steps-item"71 data-status={status}72 className={cn(timelineStepsItemVariants({ orientation, status }), className)}73 {...props}74 />75 )76}7778/* -----------------------------------------------------------------------------79 * TimelineConnector (the line connecting items)80 * -------------------------------------------------------------------------- */8182const timelineStepsConnectorVariants = cva("", {83 variants: {84 orientation: {85 vertical:86// … truncated
What it pulls in
npm packages
Files it writes
More from abui
All 20 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordion Multiselectaccordion-multiselect | abui | Components | Free | 3 deps | |
| Breakpoint Displaybreakpoint-display | abui | Components | Free | no deps | |
| Color Swatch Selectorcolor-swatch-selector | abui | Components | Free | no deps | |
| Label Selectorlabel-selector | abui | Components | Free | 2 deps | |
| Radio Rowsradio-rows | abui | Components | Free | no deps | |
| Radio Tabsradio-tabs | abui | Components | Free | no deps | |
| Scroll Progressscroll-progress | abui | Components | Free | 1 dep | |
| Spinnerspinner | abui | Components | Free | 1 dep |
