opensourceui
GitHubTwitter/X
  1. Home
  2. Components
  3. Resources
  4. Resource Links Panel
Back to Resources

Components / Resources

Resource Links Panel

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

Resource link list with logo, name, description, and domain per row — same layout as the homepage Resources section. Copy and pass title + items.

Preview

Resources

  • Cursor / For Editor

    Cursor/For Editor
    cursor.com
  • D

    Dither.it / For making images better

    Dither.it/For making images better
    ditherit.com
  • Flaticon / For image PNGs

    Flaticon/For image PNGs
    flaticon.com
  • Lucide / For icons

    Lucide/For icons
    lucide.dev
  • Manu sir / For inspiration

    Manu sir/For inspiration
    manuarora.in
  • PostHog / For tracking

    PostHog/For tracking
    posthog.com

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/resources/resource-links-panel.tsx in your project.

  4. 4

    Import and render:

    Example

    import { ResourceLinksPanel } from "@/components/resources/resource-links-panel";

    <ResourceLinksPanel title="Resources" items={[{ name: "Lucide", description: "For icons", href: "https://lucide.dev", imageSrc: "/lucide-logo.svg" }]} />

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/resources/resource-links-panel.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
import Image from "next/image";
import {
forwardRef,
type ComponentPropsWithoutRef,
type ComponentType,
type SVGProps,
} from "react";
 
import { cn } from "@/lib/cn";
 
export type ResourceLinkItem = Readonly<{
name: string;
description: string;
shortDescription?: string;
href: string;
domain?: string;
color?: string;
Icon?: ComponentType<SVGProps<SVGSVGElement> & { size?: number | string }>;
imageSrc?: string;
letter?: string;
}>;
 
const DEMO_ITEMS: ResourceLinkItem[] = [
{
name: "Cursor",
description: "For Editor",
href: "https://cursor.com",
imageSrc: "/cursor.webp",
},
{
name: "Dither.it",
description: "For making images better",
href: "https://ditherit.com",
letter: "D",
color: "text-rose-400",
},
{
name: "Lucide",
description: "For icons",
href: "https://lucide.dev",
imageSrc: "/lucide-logo.svg",
},
{
name: "Manu sir",
description: "For inspiration",
href: "https://www.manuarora.in",
imageSrc: "/manu.webp",
},
{
name: "PostHog",
description: "For tracking",
href: "https://posthog.com",
imageSrc: "/posthog.png",
},
{
name: "Flaticon",
description: "For image PNGs",
href: "https://www.flaticon.com",
imageSrc: "/flaticon.png",
},
];
 
export type ResourceLinksPanelProps = Readonly<
{
title?: string;
items?: readonly ResourceLinkItem[];
sortItems?: boolean;
} & ComponentPropsWithoutRef<"div">
>;
 
function getDomain(href: string) {
try {
return new URL(href).hostname.replace(/^www\./, "");
} catch {
return href;
}
}
 
function ListIcon({ item }: { item: ResourceLinkItem }) {
const { Icon, imageSrc, letter, color } = item;
const iconColor = color ?? "text-neutral-800";
const letterColor = color ?? "text-neutral-600";
 
return (
<div className="flex h-5 w-5 shrink-0 items-center justify-center overflow-hidden">
{imageSrc ? (
<Image
src={imageSrc}
alt=""
width={20}
height={20}
className="h-5 w-5 rounded object-contain"
/>
) : Icon ? (
<Icon size={16} className={iconColor} />
) : (
<span className={`font-sans text-[16px] font-semibold ${letterColor}`}>{letter}</span>
)}
</div>
);
}
 
function ListRow({ item }: { item: ResourceLinkItem }) {
const domain = item.domain ?? getDomain(item.href);
const mobileDescription = item.shortDescription ?? item.description;
 
return (
<li className="min-w-0">
<a
href={item.href}
target="_blank"
rel="noopener noreferrer"
className="group flex min-w-0 items-center gap-2.5 py-0.5 max-[499px]:gap-2"
>
<ListIcon item={item} />
<div className="flex min-w-0 flex-1 items-center gap-3 max-[499px]:gap-2">
<p className="hidden min-w-0 flex-1 truncate font-sans text-sm leading-snug min-[500px]:block">
<span className="font-semibold text-neutral-900 group-hover:text-neutral-700">
{item.name}
</span>
<span className="text-neutral-300"> / </span>
<span className="text-neutral-500">{item.description}</span>
</p>
 
<div className="flex min-w-0 flex-1 items-baseline overflow-hidden min-[500px]:hidden">
<span className="shrink-0 font-sans text-xs leading-snug font-semibold text-neutral-900 group-hover:text-neutral-700">
{item.name}
</span>
<span className="shrink-0 px-1 font-sans text-xs text-neutral-300">/</span>
<span className="min-w-0 truncate font-sans text-xs leading-snug text-neutral-500">
{mobileDescription}
</span>
</div>
 
<span className="shrink-0 font-mono text-sm text-neutral-400 group-hover:text-neutral-500 max-[499px]:text-[11px]">
{domain}
</span>
</div>
</a>
</li>
);
}
 
// Resource link list — same row layout as the homepage Resources section. Copy, pass title + items.
export const ResourceLinksPanel = forwardRef<HTMLDivElement, ResourceLinksPanelProps>(
function ResourceLinksPanel(
{ title = "Resources", items = DEMO_ITEMS, sortItems = true, className, ...props },
ref,
) {
const rows = sortItems ? [...items].sort((a, b) => a.name.localeCompare(b.name)) : items;
 
return (
<div
ref={ref}
className={cn("min-w-0 max-[499px]:overflow-hidden", className)}
{...props}
>
<section>
<h3 className="font-sans text-sm font-semibold text-neutral-900">{title}</h3>
<ul className="mt-4 flex flex-col gap-2.5">
{rows.map((item) => (
<ListRow key={item.name} item={item} />
))}
</ul>
</section>
</div>
);
},
);
 
ResourceLinksPanel.displayName = "ResourceLinksPanel";
PreviousNext

On this

page

Jump to a section on this page.

  • lib/cn.ts
  • components/resources/resource-links-panel.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.