Maxwell Barvian

Activity with Number Flow

Buttons 124

About

A component of social media sharing buttons with Number Flow animations

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Activity with Number Flow to your project and fits it to your theme.

Code

How Activity with Number Flow is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { useState } from "react"
import { Activity } from "@/components/ui/activity-with-number-flow"


function ActivityDemo() {
  const [stats, setStats] = useState({
    likes: 1523,
    reposts: 284,
    views: 15794,
    bookmarks: 432,
    liked: false,
    reposted: false,
    bookmarked: false,
  })

  const handleLike = () => {
    setStats(prev => ({
      ...prev,
      likes: prev.liked ? prev.likes - 1 : prev.likes + 1,
      liked: !prev.liked
    }))
  }

  const handleRepost = () => {
    setStats(prev => ({
      ...prev,
      reposts: prev.reposted ? prev.reposts - 1 : prev.reposts + 1,
      reposted: !prev.reposted
    }))
  }

  const handleBookmark = () => {
    setStats(prev => ({
      ...prev,
      bookmarks: prev.bookmarked ? prev.bookmarks - 1 : prev.bookmarks + 1,
      bookmarked: !prev.bookmarked
    }))
  }

  return (
    <div className="w-full max-w-xl rounded-lg border border-zinc-200 p-4 dark:border-zinc-800">
      <div className="mb-4 h-48 rounded-md bg-zinc-100 dark:bg-zinc-800" />
      <Activity 
        likes={stats.likes}
        reposts={stats.reposts}
        views={stats.views}
        bookmarks={stats.bookmarks}
        liked={stats.liked}
        reposted={stats.reposted}
        bookmarked={stats.bookmarked}
        onLike={handleLike}
        onRepost={handleRepost}
        onBookmark={handleBookmark}
      />
    </div>
  )
}

export default { ActivityDemo };

Dependencies

More by Maxwell Barvian

View all
  • Number Flow

    Number Flow

    529
  • Slider Number Flow

    Slider Number Flow

    502
  • Number Input

    Number Input

    98
  • Number Flow Trends

    Number Flow Trends

    4

More in Buttons

View all
  • Button Save

    Button Save

    46
  • Button

    Button

    20
  • Eclipse Button

    Eclipse Button

    5
  • Button

    Button

    6
  • Button

    Button

    14
  • Button Group

    Button Group

    37
  • Button

    Button

    32
  • Split Button

    Split Button

    32