opensourceui
GitHubTwitter/X
  1. Home
  2. Components
  3. Dashboard
  4. Industry Insights Card
Back to Dashboard

Components / Dashboard

Industry Insights Card

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

Dark industry insights summary card with highlighted metric and source selector pills.

Preview

Industry Insights

CNBC data shows retail spending increased 4.2% in January as holiday demand extended into early 2025.

BCNBCMWRFT

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/dashboard/industry-insights-card.tsx in your project.

  4. 4

    Import and render:

    Example

    import { IndustryInsightsCard } from "@/components/dashboard/industry-insights-card";

    <IndustryInsightsCard highlight="retail spending increased 4.2%" />

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/dashboard/industry-insights-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
"use client";
 
import { forwardRef, type ComponentPropsWithoutRef } from "react";
 
import Link from "next/link";
 
import { ArrowUpRight, Sparkles } from "lucide-react";
 
import { cn } from "@/lib/cn";
 
export type InsightSource = Readonly<{
id: string;
label: string;
active?: boolean;
}>;
 
export type IndustryInsightsCardProps = Readonly<
{
title?: string;
highlight?: string;
beforeText?: string;
afterText?: string;
sources?: readonly InsightSource[];
href?: string;
} & ComponentPropsWithoutRef<"article">
>;
 
const DEFAULT_SOURCES: readonly InsightSource[] = [
{ id: "bloomberg", label: "B" },
{ id: "cnbc", label: "CNBC", active: true },
{ id: "mw", label: "MW" },
{ id: "reuters", label: "R" },
{ id: "ft", label: "FT" },
];
 
// Industry insights card — dark AI summary with source selector pills.
export const IndustryInsightsCard = forwardRef<
HTMLElement,
IndustryInsightsCardProps
>(
(
{
className,
title = "Industry Insights",
highlight = "retail spending increased 4.2%",
beforeText = "CNBC data shows",
afterText = "in January as holiday demand extended into early 2025.",
sources = DEFAULT_SOURCES,
href = "#",
...props
},
ref,
) => {
const actionClassName =
"flex size-9 shrink-0 items-center justify-center rounded-full bg-neutral-800 text-neutral-200 transition-colors hover:bg-neutral-700";
 
return (
<article
ref={ref}
data-slot="industry-insights-card"
className={cn(
"w-sm rounded-3xl border border-neutral-800 bg-neutral-900 p-5 font-sans text-white shadow-lg shadow-black/10",
className,
)}
{...props}
>
<header className="flex items-start justify-between gap-3">
<div className="flex items-center gap-2">
<Sparkles size={14} aria-hidden className="text-neutral-400" />
<h2 className="text-sm font-medium text-neutral-300">{title}</h2>
</div>
{href && href !== "#" ? (
<Link href={href} aria-label="Open insight" className={actionClassName}>
<ArrowUpRight size={15} aria-hidden />
</Link>
) : (
<button type="button" aria-label="Open insight" className={actionClassName}>
<ArrowUpRight size={15} aria-hidden />
</button>
)}
</header>
 
<p className="mt-5 text-sm leading-relaxed text-neutral-300">
{beforeText}{" "}
<span className="font-semibold text-white">{highlight}</span> {afterText}
</p>
 
<div className="mt-6 flex justify-center">
<div className="inline-flex items-center gap-1 rounded-full bg-neutral-950 px-2 py-1.5">
{sources.map((source) => (
<span
key={source.id}
className={cn(
"flex size-8 items-center justify-center rounded-full text-[10px] font-semibold",
source.active
? "bg-white text-neutral-900"
: "bg-neutral-800 text-neutral-400",
)}
>
{source.label}
</span>
))}
</div>
</div>
</article>
);
},
);
 
IndustryInsightsCard.displayName = "IndustryInsightsCard";
PreviousNext

On this

page

Jump to a section on this page.

  • lib/cn.ts
  • components/dashboard/industry-insights-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.