Stats 2
smoothui-registry/stats-2FreeBlock
Cards stats section block with icons and trends
Install it
npx shadcn@latest add https://www.smoothui.dev/r/stats-2.jsonSource
1"use client";23import { DollarSign, Smartphone, Star, Users } from "lucide-react";4import { motion, useInView, useReducedMotion } from "motion/react";5import React, { useRef } from "react";67const STAGGER_DELAY = 0.1;8const ICON_STAGGER_OFFSET = 0.2;9const VALUE_DELAY_OFFSET = 0.3;10const TREND_STAGGER_OFFSET = 0.5;1112interface StatsCardsProps {13 description?: string;14 stats?: Array<{15 value: string;16 label: string;17 description?: string;18 icon?: string;19 trend?: {20 value: string;21 direction: "up" | "down";22 };23 }>;24 title?: string;25}2627const iconMap = {28 DollarSign,29 Smartphone,30 Star,31 Users,32};3334export function StatsCards({35 title = "Key Metrics",36 description = "Track your success with these important numbers",37 stats = [38 {39 description: "Annual recurring revenue",40 icon: "DollarSign",41 label: "Revenue",42 trend: { direction: "up", value: "+12%" },43 value: "2.5M",44 },45 {46 description: "Happy customers worldwide",47 icon: "Users",48 label: "Customers",49 trend: { direction: "up", value: "+8%" },50 value: "45K",51 },52 {53 description: "Customer satisfaction rate",54 icon: "Star",55 label: "Satisfaction",56 trend: { direction: "up", value: "+2%" },57 value: "98%",58 },59 {60 description: "Total app downloads",61 icon: "Smartphone",62 label: "Downloads",63 trend: { direction: "up", value: "+15%" },64 value: "1.2M",65 },66 ],67}: StatsCardsProps) {68 const ref = useRef(null);69 const isInView = useInView(ref, { once: true });70 const shouldReduceMotion = useReducedMotion();7172 return (73 <section className="py-20">74 <div className="mx-auto max-w-7xl px-6">75 <motion.div76 className="mb-16 text-center"77 initial={shouldReduceMotion ? { opacity: 1 } : { opacity: 0, y: 20 }}78 transition={shouldReduceMotion ? { duration: 0 } : { duration: 0.6 }}79 viewport={{ once: true }}80 whileInView={81 shouldReduceMotion ? { opacity: 1 } : { opacity: 1, y: 0 }82 }83 >84 <h2 className="mb-4 font-bold text-3xl text-foreground lg:text-4xl">85 {title}86 </h2>87 <p className="mx-auto max-w-2xl text-foreground/70 text-lg">88 {description}89 </p>90 </motion.div>9192 <div93 className="grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-4"94 ref={ref}95 >96// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from SmoothUI Registry
All 178 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Chat Templatechat-template | SmoothUI Registry | Blocks | Free | 2 deps · 4 files | |
| Cta 1cta-1 | SmoothUI Registry | Blocks | Free | 1 dep | |
| Cta 2cta-2 | SmoothUI Registry | Blocks | Free | 1 dep | |
| Cta 3cta-3 | SmoothUI Registry | Blocks | Free | 1 dep | |
| Faq 1faq-1 | SmoothUI Registry | Blocks | Free | 2 deps | |
| Faq 2faq-2 | SmoothUI Registry | Blocks | Free | 1 dep | |
| Faq 3faq-3 | SmoothUI Registry | Blocks | Free | 2 deps | |
| Faq 4faq-4 | SmoothUI Registry | Blocks | Free | 2 deps |
