BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/brandonjt/image-zoom

Image Zoom

brandonjt/image-zoom
FreeBlock

An interactive image viewer for React apps. Easily zoom, drag, resize, and rotate images with smooth controls. Perfect for galleries, portfolios, or any UI where users need to explore images in detail.

Live preview

live · rendered by the registry
Rendered by brandonjt on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://brandonjuliothenaro.my.id/r/image-zoom.json

Source

registry/new-york/image-zoom/image-zoom.tsxbrandonjuliothenaro.my.id/r/image-zoom.json
1import { Button } from "@/components/ui/button";
2import {
3 Dialog,
4 DialogContent,
5 DialogDescription,
6 DialogHeader,
7 DialogTitle,
8 DialogTrigger,
9} from "@/components/ui/dialog";
10import {
11 IterationCwIcon,
12 MinusIcon,
13 PlusIcon,
14 RotateCwSquareIcon,
15} from "lucide-react";
16import { motion, useMotionValue, useSpring } from "motion/react";
17import Image, { type ImageProps } from "next/image";
18import React from "react";
19
20export const ImageZoom: React.ComponentType<ImageProps> = (imageProps) => {
21 return (
22 <Dialog>
23 <DialogTrigger asChild>
24 <Button
25 variant="ghost"
26 className="relative size-32 overflow-hidden"
27 size="icon"
28 >
29 <Image
30 {...imageProps}
31 alt={imageProps.alt || ""}
32 layout="fill"
33 className="object-cover"
34 />
35 </Button>
36 </DialogTrigger>
37 <DialogContent className="sm:max-w-[90vw]">
38 <DialogHeader>
39 <DialogTitle>Image Zoom</DialogTitle>
40 <DialogDescription>Image Zoom Description</DialogDescription>
41 </DialogHeader>
42 <ImageZoomManipulator
43 src={imageProps.src.toString()}
44 alt={imageProps.alt || ""}
45 />
46 </DialogContent>
47 </Dialog>
48 );
49};
50
51export const ImageZoomManipulator: React.ComponentType<
52 React.ComponentProps<typeof motion.img>
53> = (imageProps) => {
54 const [originalDragConstraints, setOriginalDragConstraints] = React.useState({
55 top: 0,
56 left: 0,
57 right: 0,
58 bottom: 0,
59 });
60
61 const [currentDragConstraints, setCurrentDragConstraints] = React.useState({
62 top: 0,
63 left: 0,
64 right: 0,
65 bottom: 0,
66 });
67
68 const containerRef = React.useRef<HTMLDivElement | null>(null);
69
70 const scale = useSpring(1, { visualDuration: 0.3, bounce: 0.35 });
71 scale.on("change", (value) => {
72 setCurrentDragConstraints({
73 top: originalDragConstraints.top * value * 0.7,
74 left: originalDragConstraints.left * value * 0.7,
75 right: originalDragConstraints.right * value * 0.7,
76 bottom: originalDragConstraints.bottom * value * 0.7,
77 });
78 });
79
80 const rotate = useSpring(0, { visualDuration: 0.35, bounce: 0.2 });
81
82 const x = useMotionValue(0);
83 const y = useMotionValue(0);
84
85 const [isMounted, setIsMounted] = React.useState(false);
86
87 React.useEffect(() => {
88 setIsMounted(true);
89 }, []);
90
91 return (
92 <motion.div
93 ref={(ref) => {
94 if (containerRef.current) return;
95
96// … truncated

What it pulls in

npm packages

  • motion
  • lucide-react

Other registry items

  • button
  • dialog

Files it writes

  • registry/new-york/image-zoom/image-zoom.tsx

Facts

Registry
brandonjt
Type
registry:block
Access
Free
Files written
1
Licence
the repository states none
In the index
at or before 2026-08-12
Last confirmed
today

Go to the source

Docs on brandonjt brandonjuliothenaro.my.id brandon-julio-t/personal-website-v4 on GitHub Raw registry item This item as JSON

More from brandonjt

All 2 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
iOS Mail Tabsios-mail-tabsbrandonjtBlocksFree2 deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex