opensourceui
GitHubTwitter/X
  1. Home
  2. Components
  3. Text
  4. Daily Motivation
Back to Text

Components / Text

Daily Motivation

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

Editorial poster with multi-line headline, flower icon, tilted polaroid, and a GOOD DAY sticker. Morning routine apps and wellness newsletters.

Preview

Your daily

motivation

for this Week

Woman holding flowers

GOOD DAY!

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/daily-motivation-card.tsx in your project.

  4. 4

    Import and render:

    Example

    import { DailyMotivationCard } from "@/components/text/daily-motivation-card";

    <DailyMotivationCard />

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/daily-motivation-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
import { forwardRef, type ComponentPropsWithoutRef } from "react";
import Image from "next/image";
 
import { cn } from "@/lib/cn";
import { Flower } from "lucide-react";
 
type DailyMotivationCardOwnProps = {
image?: string;
imageAlt?: string;
lineOne?: string;
lineTwo?: string;
lineThree?: string;
lineFour?: string;
stickerText?: string;
};
 
export type DailyMotivationCardProps = Readonly<DailyMotivationCardOwnProps> &
ComponentPropsWithoutRef<"div">;
 
// Production-ready Daily Motivation component — styled with Tailwind CSS.
export const DailyMotivationCard = forwardRef<
HTMLDivElement,
DailyMotivationCardProps
>(
(
{
className,
image = "/iphone-wallpaper.png",
imageAlt = "Woman holding flowers",
lineOne = "Your daily",
lineTwo = "motivation",
lineThree = "for this Week",
stickerText = "GOOD DAY!",
...props
},
ref,
) => (
<div
ref={ref}
data-slot="daily-motivation-card"
className={cn(
"relative h-100 w-96 overflow-hidden bg-[#f4f4ea] px-6 pt-6 pb-5 font-sans",
className,
)}
{...props}
>
<div className="relative z-10 max-w-44 space-y-1 font-serif text-[1.85rem] leading-[0.92] tracking-tight text-[#2d3e40]">
<p>{lineOne}</p>
<p>{lineTwo}</p>
<p>{lineThree}</p>
</div>
 
<div className="absolute top-6 right-7 z-20 overflow-visible p-1">
<Flower size={58} color="#2d3e40" />
</div>
 
<div className="absolute right-3 bottom-4 z-10 w-37 rotate-12">
<div className="bg-white p-2 pb-7 shadow-[0_12px_28px_rgba(45,62,64,0.14)]">
<div className="relative aspect-4/5 w-full overflow-hidden bg-neutral-100">
<Image
src={image}
alt={imageAlt}
fill
sizes="148px"
className="object-cover"
/>
</div>
</div>
 
<div className="absolute -bottom-1 -left-5 z-20 -rotate-6 rounded-full border-4 border-[#9f93b8] bg-[#e2d9f3] px-3.5 py-1.5">
<p className="font-sans text-[10px] font-bold tracking-wide text-[#474253]">
{stickerText}
</p>
</div>
</div>
</div>
),
);
 
DailyMotivationCard.displayName = "DailyMotivationCard";
PreviousNext

On this

page

Jump to a section on this page.

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