opensourceui
GitHubTwitter/X
  1. Home
  2. Components
  3. Text
  4. Magazine Cover
Back to Text

Components / Text

Magazine Cover

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

Tall magazine cover with issue badge, category, title, author, and read time. Hover zoom on the cover image — editorial hero material.

Preview

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/text/magazine-cover-card.tsx in your project.

  4. 4

    Import and render:

    Example

    import { MagazineCoverCard } from "@/components/text/magazine-cover-card";

    <MagazineCoverCard />

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/text/magazine-cover-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
"use client";
 
import {
forwardRef,
type ComponentPropsWithoutRef,
type ReactNode,
} from "react";
import Image from "next/image";
 
import { cn } from "@/lib/cn";
import { ArrowRight } from "lucide-react";
 
export type MagazineCoverCardProps = Readonly<
{
badge?: string;
issue?: string;
category?: string;
title?: string;
subtitle?: string;
author?: string;
readTime?: string;
image?: string;
imageAlt?: string;
arrowIcon?: ReactNode;
onClick?: () => void;
} & ComponentPropsWithoutRef<"button">
>;
 
// Production-ready Magazine Cover component — styled with Tailwind CSS.
export const MagazineCoverCard = forwardRef<
HTMLButtonElement,
MagazineCoverCardProps
>(
(
{
className,
badge = "Featured",
issue = "Issue #24",
category = "Design",
title = "The Art of Minimal Interfaces",
subtitle = "Minimal Interfaces",
author = "Bidyut Kundu",
readTime = "8 min read",
image = "/wallpaper-3.png",
imageAlt = "Magazine cover",
arrowIcon,
onClick,
...props
},
ref,
) => {
return (
<button
ref={ref}
data-slot="magazine-cover-card"
onClick={onClick}
className={cn(
"group relative h-96 w-72 cursor-pointer overflow-hidden rounded-2xl shadow-lg",
className,
)}
{...props}
>
{/* Cover image */}
<Image
src={image}
alt={imageAlt}
fill
sizes="288px"
className="object-cover transition-transform duration-700 group-hover:scale-105"
/>
 
{/* Gradient overlay */}
<div className="absolute inset-0 bg-linear-to-t from-black/80 via-black/20 to-transparent" />
 
{/* Badge */}
<div className="absolute top-4 left-4">
<span className="inline-block rounded-full border border-white/20 bg-white/15 px-2.5 pt-1 pb-0.5 text-[10px] font-medium tracking-widest text-white uppercase backdrop-blur-md">
{badge}
</span>
</div>
 
<div className="absolute right-0 bottom-0 left-0 p-5">
<p className="mb-2 font-mono text-[10px] tracking-[0.25em] text-white/60 uppercase">
{issue} · {category}
</p>
 
<h3 className="mb-3 text-xl leading-tight font-light tracking-tight text-white">
{title.split(" ").slice(0, -2).join(" ")}
<br />
<span className="font-semibold">{subtitle}</span>
</h3>
 
<div className="flex items-center justify-between">
<p className="text-xs text-white/50">
By {author} · {readTime}
</p>
 
<div className="flex h-8 w-8 items-center justify-center rounded-full border border-white/20 bg-white/15 text-white backdrop-blur-md transition-all duration-300 group-hover:bg-white group-hover:text-neutral-900">
{arrowIcon ?? <ArrowRight size={14} />}
</div>
</div>
</div>
</button>
);
},
);
 
MagazineCoverCard.displayName = "MagazineCoverCard";
PreviousNext

On this

page

Jump to a section on this page.

  • lib/cn.ts
  • components/text/magazine-cover-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.