Dock
more-shadcn-noair/dockFreeComponent
A macOS-style dock with magnification interaction.
Live preview
live · rendered by the registry
Rendered by more-shadcn-noair on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://more-shadcn.noair.fun/r/dock.jsonSource
1<script lang="ts">2 import { cn } from '$UTILS$';3 import { setDockContext } from './ctx';4 import { useMotionValue } from 'svelte-motion';5 import type { Snippet } from 'svelte';67 let {8 class: className,9 magnification = 60,10 distance = 140,11 children12 }: {13 class?: string;14 magnification?: number;15 distance?: number;16 children: Snippet;17 } = $props();1819 let mouseX = useMotionValue(Infinity);2021 setDockContext({22 mouseX,23 magnification,24 distance25 });2627 function handleMouseMove(e: MouseEvent) {28 mouseX.set(e.pageX);29 }3031 function handleMouseLeave() {32 mouseX.set(Infinity);33 }34</script>3536<div37 class={cn(38 'mx-auto flex h-[58px] w-max items-center gap-2 rounded-2xl border bg-white px-4 dark:bg-black',39 className40 )}41 onmousemove={handleMouseMove}42 onmouseleave={handleMouseLeave}43>44 {@render children()}45</div>
What it pulls in
Other registry items
More from more-shadcn-noair
All 43 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Audioaudio | more-shadcn-noair | Components | Free | no deps | |
| Audio Waveaudio-wave | more-shadcn-noair | Components | Free | no deps | |
| Autocompleteautocomplete | more-shadcn-noair | Components | Free | no deps | |
| Bannerbanner | more-shadcn-noair | Components | Free | no deps | |
| Big Calendarbig-calendar | more-shadcn-noair | Components | Free | no deps | |
| Bottom Navigationbottom-nav | more-shadcn-noair | Components | Free | no deps | |
| Canvascanvas | more-shadcn-noair | Components | Free | no deps | |
| Chipchip | more-shadcn-noair | Components | Free | no deps |
