Pricing 1
smoothui-registry/pricing-1FreeBlock
Simple pricing block with single plan
Install it
npx shadcn@latest add https://www.smoothui.dev/r/pricing-1.jsonSource
1"use client";23import { cn } from "@/lib/utils";4import SmoothButton from "@/components/smoothui/smooth-button";5import { motion, useReducedMotion } from "motion/react";6import { useEffect, useRef, useState } from "react";78interface PriceFlowProps {9 className?: string;10 value: number;11}1213function PriceFlow({ value, className = "" }: PriceFlowProps) {14 const [prevValue, setPrevValue] = useState(value);15 const prevTensRef = useRef<HTMLSpanElement>(null);16 const nextTensRef = useRef<HTMLSpanElement>(null);17 const prevOnesRef = useRef<HTMLSpanElement>(null);18 const nextOnesRef = useRef<HTMLSpanElement>(null);1920 useEffect(() => {21 if (value !== prevValue) {22 const prevTens = prevTensRef.current;23 const nextTens = nextTensRef.current;24 const prevOnes = prevOnesRef.current;25 const nextOnes = nextOnesRef.current;2627 if (28 prevTens &&29 nextTens &&30 Math.floor(value / 10) !== Math.floor(prevValue / 10)31 ) {32 if (Math.floor(value / 10) > Math.floor(prevValue / 10)) {33 prevTens.classList.add("slide-out-up");34 nextTens.classList.add("slide-in-up");35 } else {36 prevTens.classList.add("slide-out-down");37 nextTens.classList.add("slide-in-down");38 }3940 const handleTensAnimationEnd = () => {41 prevTens.classList.remove("slide-out-up", "slide-out-down");42 nextTens.classList.remove("slide-in-up", "slide-in-down");43 prevTens.removeEventListener("animationend", handleTensAnimationEnd);44 };4546 prevTens.addEventListener("animationend", handleTensAnimationEnd);47 }4849 if (prevOnes && nextOnes && value % 10 !== prevValue % 10) {50 setTimeout(() => {51 if (value % 10 > prevValue % 10) {52 prevOnes.classList.add("slide-out-up");53 nextOnes.classList.add("slide-in-up");54 } else {55 prevOnes.classList.add("slide-out-down");56 nextOnes.classList.add("slide-in-down");57 }5859 const handleOnesAnimationEnd = () => {60 prevOnes.classList.remove("slide-out-up", "slide-out-down");61 nextOnes.classList.remove("slide-in-up", "slide-in-down");62 prevOnes.removeEventListener(63 "animationend",64 handleOnesAnimationEnd65 );66 };6768 prevOnes.addEventListener("animationend", handleOnesAnimationEnd);69 }, 50);70 }7172 setPrevValue(value);73 }74// … 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 |
