dynamic-island-demo
cult-ui/dynamic-island-demoFreeComponent
cult/ui publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/nolly-studio/cult-ui/HEAD/apps/www/public/r/styles/default/dynamic-island-demo.jsonSource
1"use client"23import { createContext, useContext } from "react"4import {5 ArrowUpLeftSquareIcon,6 Loader,7 Mail,8 MessageCircle,9 MousePointerClickIcon,10 User,11 Waves,12} from "lucide-react"13import { motion, useReducedMotion } from "motion/react"1415import { Badge } from "@/components/ui/badge"16import { Button } from "@/components/ui/button"17import {18 DynamicContainer,19 DynamicDescription,20 DynamicDiv,21 DynamicIsland,22 DynamicIslandProvider,23 DynamicTitle,24 SizePresets,25 useDynamicIslandSize,26 useScheduledAnimations,27} from "@/registry/default/ui/dynamic-island"2829const DynamicAction = () => {30 const { state: blobState, setSize } = useDynamicIslandSize()3132 const blobStates: SizePresets[] = [33 "compact",34 "large",35 "tall",36 "long",37 "medium",38 ]3940 const cycleBlobStates = () => {41 const currentIndex = blobStates.indexOf(blobState.size)42 const nextIndex = (currentIndex + 1) % blobStates.length43 setSize(blobStates[nextIndex])44 }4546 useScheduledAnimations([47 { size: "compact", delay: 1000 },48 { size: "large", delay: 1200 },49 { size: "tall", delay: 1600 },50 { size: "long", delay: 1800 },51 { size: "medium", delay: 2200 },52 ])5354 // Provide dynamic detail in such a beautiful small place :)55 const renderCompactState = () => (56 <DynamicContainer className="flex items-center justify-center h-full w-full">57 <div className="relative w-full flex items-center">58 <DynamicDescription className="absolute left-4 my-auto text-lg font-medium tracking-tighter text-white ">59 <MessageCircle className=" h-5 w-5 fill-cyan-400 text-cyan-400" />60 </DynamicDescription>6162 <DynamicDescription className="absolute text-white right-4 my-auto text-lg font-bold tracking-tighter ">63 newcult.co64 </DynamicDescription>65 </div>66 </DynamicContainer>67 )6869 // Great for call to action, popping up in users face :)70 const renderLargeState = () => (71 <DynamicContainer className="flex items-center justify-center h-full w-full">72 <div className="relative flex w-full items-center justify-between gap-6 px-4">73 <Loader className="animate-spin h-12 w-12 text-yellow-300" />7475 <DynamicTitle className="my-auto text-2xl font-black tracking-tighter text-white ">76 loading77 </DynamicTitle>78 </div>79 </DynamicContainer>80 )8182 // Great for user onboarding, forms, etc83 const renderTallState = () => (84// … truncated
What it pulls in
Other registry items
Files it writes
More from cult/ui
All 157 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| ai-instructionsai-instructions | cult/ui | Components | Free | 2 deps | |
| ai-instructions-demoai-instructions-demo | cult/ui | Components | Free | no deps | |
| animated-numberanimated-number | cult/ui | Components | Free | 1 dep | |
| animated-number-demoanimated-number-demo | cult/ui | Components | Free | no deps | |
| bg-animate-buttonbg-animate-button | cult/ui | Components | Free | no deps | |
| bg-animate-button-demobg-animate-button-demo | cult/ui | Components | Free | no deps | |
| bg-animated-fractal-dot-gridbg-animated-fractal-dot-grid | cult/ui | Components | Free | 1 dep | |
| bg-animated-fractal-dot-grid-demobg-animated-fractal-dot-grid-demo | cult/ui | Components | Free | no deps |
