opensourceui
GitHubTwitter/X
  1. Home
  2. Components
  3. Linkedin
  4. Linked In Post
Back to Linkedin

Components / Linkedin

Linked In Post

Free Linkedin React component — LinkedInPostCard. MIT licensed, copy-paste ready for Next.js and Tailwind CSS.

LinkedIn feed post with headline, body text, link preview card, reaction counts, and like/comment/repost/send actions.

Preview

User avatar

Bidyut Kundu

Software Developer · 1st

2h ·

Excited to share my latest open-source UI library — built with accessibility and performance in mind.
#OpenSource #UI #React #FrontendDev

nexticons.in

Minimal, performant UI components for modern apps.

842 reactions57 comments · 23 reposts

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. 1

    Run in your terminal:

    $npm install clsx tailwind-merge lucide-react
  2. 2

    Copy lib/cn.ts below. Skip if you already have cn().

  3. 3

    Copy the code below and create components/linkedin/linked-in-post-card.tsx in your project.

  4. 4

    Import and render:

    Example

    import { LinkedInPostCard } from "@/components/linkedin/linked-in-post-card";

    <LinkedInPostCard />

lib/cn.ts

1
2
3
4
5
6
import { type ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";
 
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}

components/linkedin/linked-in-post-card.tsx

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
"use client";
 
import {
forwardRef,
type ComponentPropsWithoutRef,
type ReactNode,
} from "react";
import Image from "next/image";
 
import { cn } from "@/lib/cn";
 
import {
Clock,
Ellipsis,
ThumbsUp,
MessageCircle,
Repeat,
Share2,
} from "lucide-react";
 
export type LinkedInPostCardProps = Readonly<
{
username?: string;
headline?: string;
timestamp?: string;
content?: string;
hashtags?: string;
websiteName?: string;
websiteDescription?: string;
reactions?: number;
comments?: number;
reposts?: number;
avatar?: string;
avatarAlt?: string;
menuIcon?: ReactNode;
likeIcon?: ReactNode;
commentIcon?: ReactNode;
repostIcon?: ReactNode;
sendIcon?: ReactNode;
onLike?: () => void;
onComment?: () => void;
onRepost?: () => void;
onSend?: () => void;
} & ComponentPropsWithoutRef<"div">
>;
 
// Production-ready Linked In Post component — styled with Tailwind CSS.
export const LinkedInPostCard = forwardRef<
HTMLDivElement,
LinkedInPostCardProps
>(
(
{
className,
username = "Bidyut Kundu",
headline = "Software Developer · 1st",
timestamp = "2h",
content = "Excited to share my latest open-source UI library — built with accessibility and performance in mind.",
hashtags = "#OpenSource #UI #React #FrontendDev",
websiteName = "nexticons.in",
websiteDescription = "Minimal, performant UI components for modern apps.",
reactions = 842,
comments = 57,
reposts = 23,
avatar = "/profile-picture.png",
avatarAlt = "User avatar",
menuIcon,
likeIcon,
commentIcon,
repostIcon,
sendIcon,
onLike,
onComment,
onRepost,
onSend,
...props
},
ref,
) => {
return (
<div
ref={ref}
data-slot="linkedin-post-card"
className={cn(
"w-sm rounded-xl border border-neutral-100 bg-white p-5 font-sans shadow-lg",
className,
)}
{...props}
>
{/* Post header */}
<div data-slot="linkedin-post-card-header" className="mb-3 flex gap-3">
<div className="flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-neutral-800">
<Image
src={avatar}
alt={avatarAlt}
width={32}
height={32}
className="w-8"
sizes="32px"
/>
</div>
 
<div>
<p
title={username}
className="text-sm font-semibold text-neutral-900"
>
{username}
</p>
 
<p title={headline} className="text-xs text-neutral-500">
{headline}
</p>
 
<p className="text-xs text-neutral-400">
{timestamp} · <Clock className="inline" size={12} />
</p>
</div>
 
<div className="ml-auto text-neutral-400">
{menuIcon ?? <Ellipsis size={15} />}
</div>
</div>
 
{/* Post content */}
<p
data-slot="linkedin-post-card-content"
className="mb-3 text-sm leading-relaxed text-neutral-800"
>
{content}
<br />
<span className="text-blue-600">{hashtags}</span>
</p>
 
{/* Link preview */}
<div
data-slot="linkedin-post-card-preview"
className="mb-3 rounded-lg border border-neutral-200 bg-neutral-50 p-3"
>
<p className="text-xs font-semibold text-neutral-800">
{websiteName}
</p>
 
<p className="text-xs text-neutral-500">{websiteDescription}</p>
</div>
 
{/* Engagement summary */}
<div
data-slot="linkedin-post-card-stats"
className="flex items-center justify-between border-t border-neutral-100 pt-3 text-xs text-neutral-500"
>
<span className="flex items-center gap-1">
{likeIcon ?? <ThumbsUp size={13} className="text-blue-600" />}
{reactions.toLocaleString()} reactions
</span>
 
<span>
{comments.toLocaleString()} comments · {reposts.toLocaleString()}{" "}
reposts
</span>
</div>
 
{/* Post actions */}
<div
data-slot="linkedin-post-card-actions"
className="mt-3 flex gap-1 border-t border-neutral-100 pt-3"
>
<button
type="button"
aria-label={`Like post from ${username}`}
onClick={onLike}
className="flex flex-1 cursor-pointer flex-col items-center gap-1 rounded-md py-1 text-[11px] font-medium text-neutral-500 transition-colors hover:bg-neutral-50 hover:text-neutral-900"
>
{likeIcon ?? <ThumbsUp size={14} />}
Like
</button>
 
<button
type="button"
aria-label={`Comment on post from ${username}`}
onClick={onComment}
className="flex flex-1 cursor-pointer flex-col items-center gap-1 rounded-md py-1 text-[11px] font-medium text-neutral-500 transition-colors hover:bg-neutral-50 hover:text-neutral-900"
>
{commentIcon ?? <MessageCircle size={14} />}
Comment
</button>
 
<button
type="button"
aria-label={`Repost post from ${username}`}
onClick={onRepost}
className="flex flex-1 cursor-pointer flex-col items-center gap-1 rounded-md py-1 text-[11px] font-medium text-neutral-500 transition-colors hover:bg-neutral-50 hover:text-neutral-900"
>
{repostIcon ?? <Repeat size={14} />}
Repost
</button>
 
<button
type="button"
aria-label={`Send post from ${username}`}
onClick={onSend}
className="flex flex-1 cursor-pointer flex-col items-center gap-1 rounded-md py-1 text-[11px] font-medium text-neutral-500 transition-colors hover:bg-neutral-50 hover:text-neutral-900"
>
{sendIcon ?? <Share2 size={14} />}
Send
</button>
</div>
</div>
);
},
);
 
LinkedInPostCard.displayName = "LinkedInPostCard";
PreviousNext

On this

page

Jump to a section on this page.

  • lib/cn.ts
  • components/linkedin/linked-in-post-card.tsx

Sponsor spot · demo preview

Logo

Your brand name

Your tagline or category

A short pitch about your product or service goes here. This is a preview of how sponsor cards will look in this sidebar.

Your call to action

This slot is available. Sponsor Opensource UI and reach developers browsing components every day.