Stats Minimal
Stats Minimal is a React and Tailwind CSS data component from UI Layouts, licensed MIT. Copy it and paste it into your project.
UI Layouts
MIT
data
What it is
Stats Minimal is a React and Tailwind CSS data component from UI Layouts, licensed MIT. Copy it and paste it into your project.
How to use it
Open it in the catalogue, press copy, and paste it into your project. The prompt you copy carries the code and the rules that tell your agent to reproduce it without changing anything.
Five free copies a month. No card.
Needs
npm i motion
Licence
This component comes from UI Layouts and is redistributed under the MIT licence, which permits commercial use. The copyright notice travels with the code.
Stats Minimal
import React from 'react'
const stats = [
{ label: 'Active Users', value: '1.2M+' },
{ label: 'Uptime', value: '99.9%' },
{ label: 'Response Time', value: '42ms' },
{ label: 'Global Edge', value: '250+' },
]
export const MinimalStats = () => {
return (
<section className="bg-white min-h-screen flex flex-col justify-center font-manrope">
<div className="max-w-7xl mx-auto px-5">
<div className="flex justify-between">
{stats.map((stat) => (
<div
key={stat.label}
className="flex flex-col gap-1 border-l border-zinc-200 px-6 py-2 hover:bg-zinc-200"
>
<p className="text-3xl font-bold tracking-tight text-zinc-900 ">
{stat.value}
</p>
<p className="text-xs font-medium text-zinc-500 uppercase tracking-widest">
{stat.label}
</p>
</div>
))}
</div>
</div>
</section>
)
}
import type { Variants } from 'motion/react';
import { type HTMLMotionProps, motion, useInView } from 'motion/react';
import type React from 'react';
type TimelineContentProps<T extends keyof HTMLElementTagNameMap> = {
children?: React.ReactNode;
animationNum: number;
className?: string;
timelineRef: React.RefObject<HTMLElement | null>;
as?: T;
customVariants?: Variants;
once?: boolean;
} & HTMLMotionProps<T>;
export const TimelineAnimation = <T extends keyof HTMLElementTagNameMap = 'div'>({
children,
animationNum,
timelineRef,
className,
as,
customVariants,
once = true,
...props
}: TimelineContentProps<T>) => {
const defaultSequenceVariants = {
visible: (i: number) => ({
filter: 'blur(0px)',
y: 0,
opacity: 1,
transition: {
delay: i * 0.5,
duration: 0.5,
},
}),
hidden: {
filter: 'blur(20px)',
y: 0,
opacity: 0,
},
};
const sequenceVariants = customVariants || defaultSequenceVariants;
const isInView = useInView(timelineRef, {
once,
});
const MotionComponent = motion[as || 'div'] as React.ElementType;
return (
<MotionComponent
initial='hidden'
animate={isInView ? 'visible' : 'hidden'}
custom={animationNum}
variants={sequenceVariants}
className={className}
{...props}
>
{children}
</MotionComponent>
);
};