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.
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/dashboard/industry-insights-card.tsxin your project. - 4
Import and render:
Exampleimport { IndustryInsightsCard } from "@/components/dashboard/industry-insights-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/dashboard/industry-insights-card.tsx
"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 (<articleref={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) => (<spankey={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";