Elastic Line Demo
fancy/elastic-line-demoFreeBlock
A block component.
Install it
npx shadcn@latest add https://www.fancycomponents.dev/r/elastic-line-demo.jsonSource
1"use client"23import { motion, Variants } from "motion/react"45import ElasticLine from "@/components/fancy/physics/elastic-line"67export default function Preview() {8 const textVariants = {9 hidden: { opacity: 0, y: 10 },10 visible: (i: number) => ({11 opacity: 1,12 y: 0,13 transition: {14 delay: i * 0.3,15 type: "spring",16 stiffness: 300,17 damping: 30,18 },19 }),20 }2122 return (23 <div className="w-dvw h-dvh flex flex-row items-center justify-center font-overused-grotesk overflow-hidden bg-white text-foreground dark:text-muted">24 <div className="absolute left-0 top-0 w-full h-full px-6 sm:px-8 md:px-12 z-10">25 {/* Animated elastic line */}26 <ElasticLine27 releaseThreshold={50}28 strokeWidth={1}29 animateInTransition={{30 type: "spring",31 stiffness: 300,32 damping: 30,33 delay: 0.15,34 }}35 />36 </div>3738 {/* This is just fluff for the demo */}39 <div className="h-full flex flex-col py-6 w-full px-6 sm:px-8 md:px-12 font-light">40 <div className="h-1/2 py-8 w-full items-end flex">41 <motion.p42 variants={textVariants as Variants}43 initial="hidden"44 animate="visible"45 className="uppercase text-4xl sm:text-5xl md:text-6xl font-medium"46 custom={0}47 >48 FANCY COMPONENTS49 </motion.p>50 </div>51 <div className="flex flex-row pt-8 justify-between items-start gap-x-4">52 <motion.p53 variants={textVariants as Variants}54 initial="hidden"55 animate="visible"56 className="w-1/3 uppercase md:text-7xl hidden md:block text-orange-500"57 custom={0}58 >59 ✽60 </motion.p>61 <motion.p62 variants={textVariants as Variants}63 initial="hidden"64 animate="visible"65 className="w-full md:w-2/3 sm:text-left text-base sm:text-xl md:text-2xl"66 custom={1}67 >68 Ready to use, fancy, animated React components & microinteractions69 for creative developers.70 </motion.p>71 </div>7273 {/* <div className="h-1/3 flex items-center justify-end">74 <motion.p75 variants={textVariants}76 initial="hidden"77 animate="visible"78 custom={2}79 >8081 </motion.p>82// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from fancy
All 158 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Animated Gradient Demoanimated-gradient-demo | fancy | Blocks | Free | no deps | |
| Basic Number Ticker Demobasic-number-ticker-demo | fancy | Blocks | Free | no deps | |
| Box Carousel Autoplay Demobox-carousel-autoplay-demo | fancy | Blocks | Free | 1 dep | |
| Box Carousel Demobox-carousel-demo | fancy | Blocks | Free | 1 dep | |
| Box Carousel Video Demobox-carousel-video-demo | fancy | Blocks | Free | 1 dep | |
| Breathing Text Demobreathing-text-demo | fancy | Blocks | Free | no deps | |
| Circling Elements Democircling-elements-demo | fancy | Blocks | Free | no deps | |
| Circling Elements Easing Democircling-elements-easing-demo | fancy | Blocks | Free | no deps |
