CTA Banner Section
tripled/cta-banner-section-shadcnuiFreeBlock
Animated call-to-action banner with gradient background and button animations
Install it
npx shadcn@latest add https://ui.tripled.work/r/cta-banner-section-shadcnui.jsonSource
1"use client";23import { Badge } from "@/components/ui/badge";4import { Button } from "@/components/ui/button";5import {6 AnimatePresence,7 motion,8 MotionConfig,9 useInView,10 useReducedMotion,11 type Variants,12} from "framer-motion";13import { ArrowRight, ChevronRight, Sparkles, Zap } from "lucide-react";14import { useId, useMemo, useRef, useState } from "react";15import { cn } from "@/lib/utils";1617const motionPresets = {18 smooth: { type: "spring" as const, bounce: 0.3, duration: 0.4 },19 bounce: { type: "spring" as const, bounce: 0.5, duration: 0.35 },20 fade: { type: "tween" as const, ease: [0.26, 0.08, 0.25, 1] as const, duration: 0.2 },21};222324const highlights = [25 { id: "highlight-free", label: "Free Forever", icon: Zap },26 { id: "highlight-credit", label: "No Credit Card", icon: Sparkles },27 { id: "highlight-oss", label: "Open Source", icon: ChevronRight },28];2930interface CTABannerSectionProps {31 motionPreset?: keyof typeof motionPresets;32 className?: string;33}3435export function CTABannerSection({36 motionPreset = "smooth",37 className,38}: CTABannerSectionProps) {39 const ref = useRef<HTMLDivElement | null>(null);40 const isInView = useInView(ref, { once: true, margin: "-10% 0px" });41 const shouldReduceMotion = useReducedMotion();42 const [hoveredButton, setHoveredButton] = useState<"primary" | "secondary" | null>(null);4344 const titleId = useId();45 const descriptionId = useMemo(() => `${titleId}-description`, [titleId]);4647 const reducedMotionVariants: Variants = {48 hidden: { opacity: 0 },49 visible: { opacity: 1 },50 };5152 const containerVariants: Variants = useMemo(53 () =>54 shouldReduceMotion55 ? reducedMotionVariants56 : {57 hidden: { opacity: 0 },58 visible: {59 opacity: 1,60 transition: {61 staggerChildren: 0.1,62 delayChildren: 0.2,63 },64 },65 },66 [shouldReduceMotion]67 );6869 const itemVariants: Variants = useMemo(70 () =>71 shouldReduceMotion72 ? reducedMotionVariants73 : {74 hidden: { opacity: 0, y: 20 },75 visible: {76 opacity: 1,77 y: 0,78 transition: { duration: 0.4 },79 },80 },81 [shouldReduceMotion]82 );8384 // Button micro-interaction variants85 const buttonVariants: Variants = {86 idle: { y: 0 },87 hover: { y: -4 },88 tap: { y: 0, scale: 0.98 },89 };9091 return (92 <MotionConfig93// … truncated
What it pulls in
npm packages
Files it writes
More from tripled
All 282 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| About Us Pageabout-us-page-shadcnui | tripled | Blocks | Free | 2 deps | |
| About Usabout-us-section-baseui | tripled | Blocks | Free | 2 deps | |
| About Usabout-us-section-shadcnui | tripled | Blocks | Free | 2 deps | |
| Auto-Revealing Headingauto-revealing-heading-shadcnui | tripled | Blocks | Free | 2 deps | |
| Bento Grid Blockbento-grid-block-baseui | tripled | Blocks | Free | 2 deps | |
| Bento Grid Blockbento-grid-block-shadcnui | tripled | Blocks | Free | 2 deps | |
| Blog Blockblog-block-baseui | tripled | Blocks | Free | 2 deps | |
| Blog Blockblog-block-shadcnui | tripled | Blocks | Free | 2 deps |
