UIPin
ComponentsIconsIllustrationsMotionTemplatesApps
Boards
UIPin

Free, open-source UI components, icons, illustrations, motion, templates and apps, in one search. Every item links to its source and licence.

UIPin is free. If it saved you time, you can keep it running:

Buy me a coffee
ComponentsIconsIllustrationsMotionTemplatesAppsLibrariesCompareNew this weekMCP for agentsBoardsPrivacy

Components, icons and artwork belong to their authors and are shown under their open-source licences.

SmoothUI/Stats 1

Data display
1 of 2
Compiling

Theme it

Every preview, live

Brand colour

Corner radius

Font

Recolours shadcn’s tokens, Tailwind’s accent colours and colours set in the code. Red, amber and green classes stay, since they usually mean error, warning or success.

2 versions·1 library

  • Stats 1
  • Stats 2

Stats 1

Grid stats section block with hover effects

npx shadcn@latest add https://smoothui.dev/r/stats-1.json
Open in v0 Docs Repo
Library
SmoothUI
License
MIT
Stack
React · Tailwind CSS · animated
Packages
motion
Size
135 lines

Code

components/smoothui/stats-1/index.tsx

"use client";

import { motion, useInView, useReducedMotion } from "motion/react";
import { useRef } from "react";

const STAGGER_DELAY = 0.1;
const VALUE_DELAY_OFFSET = 0.2;

interface StatsGridProps {
  description?: string;
  stats?: Array<{
    value: string;
    label: string;
    description?: string;
  }>;
  title?: string;
}

export function StatsGrid({
  title = "Our Impact in Numbers",
  description = "See how we're making a difference across the globe",
  stats = [
    {
      description: "Growing every day",
      label: "Active Users",
      value: "10M+",
    },
    {
      description: "Reliable service",
      label: "Uptime",
      value: "99.9%",
    },
    {
      description: "Worldwide reach",
      label: "Countries",
      value: "150+",
    },
    {
      description: "Always here to help",
      label: "Support",
      value: "24/7",
    },
  ],
}: StatsGridProps) {
  const ref = useRef(null);
  const isInView = useInView(ref, { once: true });
  const shouldReduceMotion = useReducedMotion();

  return (
    <section className="py-20">
      <div className="mx-auto max-w-7xl px-6">
        <motion.div
          className="mb-16 text-center"
          initial={shouldReduceMotion ? { opacity: 1 } : { opacity: 0, y: 20 }}
          transition={shouldReduceMotion ? { duration: 0 } : { duration: 0.6 }}
          viewport={{ once: true }}
          whileInView={
            shouldReduceMotion ? { opacity: 1 } : { opacity: 1, y: 0 }
          }
        >
          <h2 className="mb-4 font-bold text-3xl text-foreground lg:text-4xl">
            {title}
          </h2>
          <p className="mx-auto max-w-2xl text-foreground/70 text-lg">
            {description}
          </p>
        </motion.div>
        <div
          className="grid grid-cols-1 gap-8 md:grid-cols-2 lg:grid-cols-4"
          ref={ref}
        >
          {stats.map((stat, index) => (
            <motion.div
              animate={(() => {
                if (shouldReduceMotion) {
                  return { opacity: 1 };
                }
                return isInView ? { opacity: 1, y: 0 } : { opacity: 0, y: 30 };
              })()}
              className="group relative overflow-hidden rounded-2xl border border-border bg-background p-8 text-center transition-all hover:border-brand hover:shadow-lg"
              initial={
                shouldReduceMotion ? { opacity: 1 } : { opacity: 0, y: 30 }
              }
              key={stat.label}
              transition={
                shouldReduceMotion
                  ? { duration: 0 }
                  : { delay: index * STAGGER_DELAY, duration: 0.6 }
              }
            >
              <motion.div
                animate={(() => {
                  if (shouldReduceMotion) {
                    return { scale: 1 };
                  }
                  return isInView ? { scale: 1 } : { scale: 0.5 };
                })()}
                className="mb-2 font-bold text-4xl text-brand lg:text-5xl"
                initial={shouldReduceMotion ? { scale: 1 } : { scale: 0.5 }}
                transition={
                  shouldReduceMotion
                    ? { duration: 0 }
                    : {
                        delay: index * STAGGER_DELAY + VALUE_DELAY_OFFSET,
                        duration: 0.8,
                        stiffness: 200,
                        type: "spring" as const,
                      }
                }
              >
                {stat.value}
              </motion.div>
              <h3 className="mb-2 font-semibold text-foreground text-lg">
                {stat.label}
              </h3>
              {stat.description ? (
                <p className="text-foreground/70 text-sm">{stat.description}</p>
              ) : null}
              {/* Hover effect background */}
              <motion.div
                className="absolute inset-0 bg-gradient-to-br from-brand/5 to-transparent opacity-0 group-hover:opacity-100"
                initial={{ opacity: 0 }}
                transition={{ duration: 0.3 }}
                whileHover={{ opacity: 1 }}
              />
            </motion.div>
          ))}
        </div>
      </div>
    </section>
  );
}

export default StatsGrid;

More like this

Stats 2

SmoothUI·Data display

Animated Number

Motion Primitives·Text effects

Smooth Tab

Kokonut UI·Navigation

Features 2

SmoothUI·Cards

Uptime Card

Kokonut UI·Cards

Count Up

React Bits·Text effectsMIT+

Spending Ring

Kokonut UI·Inputs & forms

Chart

HextaUI·Data display

Footer 3

SmoothUI·Navigation

Cta 2

SmoothUI·Page sections

Footer 2

SmoothUI·Navigation

Scroll Area

shadcn/ui·Data display

Rainbow Button

Magic UI·Buttons

Bento Grid

Magic UI·Cards

Cool Mode

Magic UI·Buttons