Components / Instagram
Instagram Post
Free Instagram React component — InstagramPostCard. MIT licensed, copy-paste ready for Next.js and Tailwind CSS.
Full Instagram post layout — header, square image, action icons, like count, caption, and timestamp. Looks native, props for your content.
Preview
bidyut.dev
West Bengal, India

1,204 likes
bidyut.dev New card UI drop. Minimal, clean, and open-source. #uidesign #reactjs #webdev
2 hours ago
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/instagram/instagram-post-card.tsxin your project. - 4
Import and render:
Exampleimport { InstagramPostCard } from "@/components/instagram/instagram-post-card";
lib/cn.ts
import { type ClassValue, clsx } from "clsx";import { twMerge } from "tailwind-merge";export function cn(...inputs: ClassValue[]) {return twMerge(clsx(inputs));}
components/instagram/instagram-post-card.tsx
"use client";import {forwardRef,type ComponentPropsWithoutRef,type ReactNode,} from "react";import Image from "next/image";import { cn } from "@/lib/cn";import {Ellipsis,ThumbsUp,MessageCircle,Bookmark,Share2,} from "lucide-react";export type InstagramPostCardProps = Readonly<{username?: string;location?: string;likes?: number;caption?: string;hashtags?: string;timestamp?: string;avatar?: string;postImage?: string;avatarAlt?: string;imageAlt?: string;imagePriority?: boolean;likeIcon?: ReactNode;commentIcon?: ReactNode;shareIcon?: ReactNode;bookmarkIcon?: ReactNode;onLike?: () => void;onComment?: () => void;onShare?: () => void;onBookmark?: () => void;} & ComponentPropsWithoutRef<"div">>;// Production-ready Instagram Post component — styled with Tailwind CSS.export const InstagramPostCard = forwardRef<HTMLDivElement,InstagramPostCardProps>(({className,username = "bidyut.dev",location = "West Bengal, India",likes = 1204,caption = "New card UI drop. Minimal, clean, and open-source.",hashtags = "#uidesign #reactjs #webdev",timestamp = "2 hours ago",avatar = "/profile-picture.png",postImage = "/wallpaper-3.png",avatarAlt = "User avatar",imageAlt = "Instagram post image",imagePriority = false,likeIcon,commentIcon,shareIcon,bookmarkIcon,onLike,onComment,onShare,onBookmark,...props},ref,) => {return (<divref={ref}data-slot="instagram-post-card"className={cn("w-xs overflow-hidden rounded-xl border border-neutral-100 bg-white font-sans shadow-lg",className,)}{...props}>{/* Profile header */}<divdata-slot="instagram-post-card-header"className="flex items-center gap-2 px-3 py-2.5"><div className="h-8 w-8 rounded-full bg-linear-to-tr from-yellow-400 via-pink-500 to-blue-600 p-0.5"><div className="h-full w-full rounded-full bg-white p-0.5"><div className="flex h-full w-full items-center justify-center rounded-full bg-neutral-900"><Imagesrc={avatar}alt={avatarAlt}width={16}height={16}className="w-4"sizes="16px"/></div></div></div><div><ptitle={username}className="text-xs font-semibold text-neutral-900">{username}</p><p title={location} className="text-[10px] text-neutral-400">{location}</p></div><buttontype="button"aria-label="More options"className="ml-auto cursor-pointer text-neutral-400"><Ellipsis size={15} aria-hidden /></button></div>{/* Post image */}<div className="relative h-36 w-full"><Imagedata-slot="instagram-post-card-image"src={postImage}alt={imageAlt}fillclassName="object-cover"sizes="320px"priority={imagePriority}/></div>{/* Post content */}<div className="px-3 pt-2.5 pb-3">{/* Engagement actions */}<divdata-slot="instagram-post-card-actions"className="mb-2 flex items-center justify-between"><div className="flex items-center gap-3"><buttontype="button"aria-label={`Like post from ${username}`}onClick={onLike}className="cursor-pointer text-neutral-700 transition-colors hover:text-black">{likeIcon ?? <ThumbsUp size={15} />}</button><buttontype="button"aria-label={`Comment on post from ${username}`}onClick={onComment}className="cursor-pointer text-neutral-700 transition-colors hover:text-black">{commentIcon ?? <MessageCircle size={15} />}</button><buttontype="button"aria-label={`Share post from ${username}`}onClick={onShare}className="cursor-pointer text-neutral-700 transition-colors hover:text-black">{shareIcon ?? <Share2 size={15} />}</button></div><buttontype="button"aria-label={`Save post from ${username}`}onClick={onBookmark}className="cursor-pointer text-neutral-700 transition-colors hover:text-black">{bookmarkIcon ?? <Bookmark size={15} />}</button></div><p className="mb-1 text-xs font-semibold text-neutral-900">{likes.toLocaleString("en-US")} likes</p><p className="text-xs leading-relaxed text-neutral-800"><span className="font-semibold">{username}</span> {caption}{" "}<span className="text-blue-500">{hashtags}</span></p><p className="mt-1 text-[10px] tracking-wide text-neutral-400 uppercase">{timestamp}</p></div></div>);},);InstagramPostCard.displayName = "InstagramPostCard";