Components / Travel
Flight Arrival
Free Travel React component — FlightArrivalWidget. MIT licensed, copy-paste ready for Next.js and Tailwind CSS.
Countdown to landing with departure and arrival airports and a plane moving along a progress bar. Built for travel dashboards and trip widgets.
Preview
Arrival in
53min
14:30
LHR London
16:30
IST India
Setup
How to use
Free for personal and commercial use. No UI attribution required. Include the MIT copyright notice when copying component source into your project. Read the MIT license.
- 1
Run in your terminal:
$npm install clsx tailwind-merge lucide-react - 2
Copy
lib/cn.tsbelow. Skip if you already havecn(). - 3
Copy the code below and create
components/travel/flight-arrival-widget.tsxin your project. - 4
Import and render:
Exampleimport { FlightArrivalWidget } from "@/components/travel/flight-arrival-widget";
lib/cn.ts
import { type ClassValue, clsx } from "clsx";import { twMerge } from "tailwind-merge";export function cn(...inputs: ClassValue[]) {return twMerge(clsx(inputs));}
components/travel/flight-arrival-widget.tsx
"use client";import { forwardRef, type ComponentPropsWithoutRef } from "react";import { cn } from "@/lib/cn";import { PlaneTakeoff } from "lucide-react";// Flight arrival countdown card — departure and arrival airports with minutes remaining.export type FlightArrivalWidgetProps = Readonly<{// Minutes until arrival — drives the countdown label.arrivalMinutes?: number;// Departure airport details shown on the left.departure?: { time: string; code: string; city: string };// Arrival airport details shown on the right.arrival?: { time: string; code: string; city: string };} & ComponentPropsWithoutRef<"div">>;export const FlightArrivalWidget = forwardRef<HTMLDivElement,FlightArrivalWidgetProps>(({className,arrivalMinutes = 53,departure = { time: "14:30", code: "LHR", city: "London" },arrival = { time: "16:30", code: "IST", city: "India" },...props},ref,) => (<divref={ref}data-slot="flight-arrival-widget"className={cn("flex h-44 w-44 flex-col justify-between rounded-3xl bg-neutral-900 p-4 font-sans text-white shadow-lg",className,)}{...props}><div><p className="text-[11px] text-neutral-400">Arrival in</p><p className="text-2xl font-bold">{arrivalMinutes}min</p></div><div className="space-y-2"><div className="flex justify-between text-[10px]"><div><p className="font-semibold">{departure.time}</p><p className="text-neutral-400">{departure.code} {departure.city}</p></div><div className="text-right"><p className="font-semibold">{arrival.time}</p><p className="text-neutral-400">{arrival.code} {arrival.city}</p></div></div><div className="relative flex items-center"><div className="h-1 flex-1 rounded-full bg-orange-500" /><div className="absolute left-1/2 flex h-6 w-6 -translate-x-1/2 items-center justify-center rounded-full bg-neutral-800"><PlaneTakeoff size={12} className="text-orange-400" /></div><div className="h-1 flex-1 rounded-full border border-dashed border-neutral-600 bg-transparent" /></div></div></div>),);FlightArrivalWidget.displayName = "FlightArrivalWidget";