dock-demo
cult-ui/dock-demoUnverifiedComponent
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/dock-demo.jsonSource
1"use client"23import { useEffect, useState } from "react"4import {5 BlocksIcon,6 CircleIcon,7 HexagonIcon,8 OctagonIcon,9 PentagonIcon,10 SquareIcon,11 TriangleIcon,12} from "lucide-react"1314import {15 Dock,16 DockCard,17 DockCardInner,18 DockDivider,19} from "@/registry/default/ui/dock"2021function useIsMobile() {22 const [isMobile, setIsMobile] = useState(false)2324 useEffect(() => {25 const userAgent = navigator.userAgent26 const isSmall = window.matchMedia("(max-width: 768px)").matches27 const isMobile = Boolean(28 /Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile|WPDesktop/i.exec(29 userAgent30 )31 )3233 const isDev = process.env.NODE_ENV !== "production"34 if (isDev) setIsMobile(isSmall || isMobile)3536 setIsMobile(isSmall && isMobile)37 }, [])3839 return isMobile40}4142// Main component to display the dock with cards43let gradients = [44 "https://products.ls.graphics/mesh-gradients/images/03.-Snowy-Mint_1-p-130x130q80.jpeg",45 "https://products.ls.graphics/mesh-gradients/images/04.-Hopbush_1-p-130x130q80.jpeg",46 "https://products.ls.graphics/mesh-gradients/images/06.-Wisteria-p-130x130q80.jpeg",47 "https://products.ls.graphics/mesh-gradients/images/09.-Light-Sky-Blue-p-130x130q80.jpeg",48 "https://products.ls.graphics/mesh-gradients/images/12.-Tumbleweed-p-130x130q80.jpeg",49 "https://products.ls.graphics/mesh-gradients/images/15.-Perfume_1-p-130x130q80.jpeg",50 null,51 "https://products.ls.graphics/mesh-gradients/images/36.-Pale-Chestnut-p-130x130q80.jpeg",52]5354function DockAnimation() {55 let openIcons = [56 <CircleIcon className="h-8 w-8 fill-black stroke-black rounded-full" />,57 <TriangleIcon className="h-8 w-8 fill-black stroke-black rounded-full" />,58 <SquareIcon className="h-8 w-8 fill-black stroke-black rounded-full" />,59 <PentagonIcon className="h-8 w-8 fill-black stroke-black rounded-full" />,60 <HexagonIcon className="h-8 w-8 fill-black stroke-black rounded-full" />,61 <OctagonIcon className="h-8 w-8 fill-black stroke-black rounded-full" />,62 null, // skip63 <BlocksIcon className="h-8 w-8 fill-black stroke-black rounded-full" />,64 ]6566 const isMobile = useIsMobile()6768 const responsiveOpenIcons = isMobile69 ? openIcons.slice(3, openIcons.length)70 : openIcons71 const responsiveGradients = isMobile72 ? gradients.slice(3, gradients.length)73 : gradients7475 return (76 <div className=" w-full flex items-center justify-center">77 <Dock>78// … 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 | Unverified | 2 deps | |
| ai-instructions-demoai-instructions-demo | cult/ui | Components | Unverified | no deps | |
| animated-numberanimated-number | cult/ui | Components | Unverified | 1 dep | |
| animated-number-demoanimated-number-demo | cult/ui | Components | Unverified | no deps | |
| bg-animate-buttonbg-animate-button | cult/ui | Components | Unverified | no deps | |
| bg-animate-button-demobg-animate-button-demo | cult/ui | Components | Unverified | no deps | |
| bg-animated-fractal-dot-gridbg-animated-fractal-dot-grid | cult/ui | Components | Unverified | 1 dep | |
| bg-animated-fractal-dot-grid-demobg-animated-fractal-dot-grid-demo | cult/ui | Components | Unverified | no deps |
