BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/100xui/apple-gallery

Apple gallery

100xui/apple-gallery
FreeBlock

An elegant, interactive media gallery inspired by Apple's iPhone 17 landing page. Designed with smooth transitions, interactive playback controls, and a highly polished user experience.

Live preview

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

Install it

npx shadcn@latest add https://100xui.com/r/apple-gallery.json

Source

registry/100xui/blocks/apple-gallery/components/apple-gallery.tsx100xui.com/r/apple-gallery.json · first 6 KB
1"use client";
2
3import React from "react";
4import {
5 type HTMLMotionProps,
6 motion,
7 useScroll,
8 useTransform,
9 useMotionValue,
10 animate,
11} from "motion/react";
12import { PlayIcon, PauseIcon } from "lucide-react";
13
14import { Button } from "@/components/ui/button";
15import { cn } from "@/lib/utils";
16
17const AppleGalleryContext = React.createContext<null | {
18 slideCount: number;
19 isPlaying: boolean;
20 setActiveSlideIndex: React.Dispatch<React.SetStateAction<number>>;
21 containerRef: React.RefObject<HTMLDivElement | null>;
22 activeSlideIndex: number;
23 targetSlideIndexRef: React.RefObject<null | number>;
24 progressAnimationRef: React.RefObject<ReturnType<typeof animate> | null>;
25 setIsPlaying: React.Dispatch<React.SetStateAction<boolean>>;
26 scrollToSlide: (childIndex: number) => void;
27 durationInSec: number;
28}>(null);
29
30export function useAppleGallery() {
31 const ctx = React.useContext(AppleGalleryContext);
32 if (ctx === null) {
33 throw new Error("useAppleGallery must be used within an <AppleGallery />");
34 }
35 return ctx;
36}
37
38export function AppleGallery({
39 children,
40 durationInSec = 4,
41 className,
42 ...props
43}: {
44 children: React.ReactNode;
45 durationInSec?: number;
46} & React.ComponentProps<"div">) {
47 const [slideCount] = React.useState(
48 (
49 (React.Children.toArray(children)[0] as React.ReactElement).props as {
50 children: React.ReactElement[];
51 }
52 ).children.length
53 );
54
55 const [isPlaying, setIsPlaying] = React.useState(false);
56 const [activeSlideIndex, setActiveSlideIndex] = React.useState(0);
57
58 const containerRef = React.useRef<HTMLDivElement | null>(null);
59 const progressAnimationRef = React.useRef<ReturnType<typeof animate> | null>(
60 null
61 );
62 const targetSlideIndexRef = React.useRef<null | number>(activeSlideIndex);
63
64 const scrollToSlide = React.useCallback(
65 (childIndex: number) => {
66 if (containerRef.current) {
67 setIsPlaying(false);
68 setActiveSlideIndex(childIndex);
69 targetSlideIndexRef.current = childIndex;
70 progressAnimationRef.current = null;
71 containerRef.current.children[childIndex].scrollIntoView({
72 behavior: "smooth",
73 block: "nearest",
74 });
75 }
76 },
77 [targetSlideIndexRef, setIsPlaying]
78 );
79
80 return (
81 <AppleGalleryContext.Provider
82 value={{
83 slideCount,
84 isPlaying,
85 activeSlideIndex,
86 progressAnimationRef,
87 setActiveSlideIndex,
88 containerRef,
89 scrollToSlide,
90// … truncated

What it pulls in

npm packages

  • motion

Other registry items

  • button

Files it writes

  • registry/100xui/blocks/apple-gallery/components/apple-gallery.tsx

Facts

Registry
100xui
Type
registry:block
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-04
Last confirmed
today

Go to the source

Docs on 100xui 100xui.com YashwantOstwal/100xUI on GitHub Raw registry item This item as JSON

More from 100xui

All 14 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Chat bento cardchat-bento-card100xuiBlocksFree1 dep
demosdemos100xuiBlocksFreeno deps · 12 files
In-page navbarin-page-navbar100xuiBlocksFree1 dep · 2 files
internalsinternals100xuiBlocksFreeno deps · 4 files
iPhone 3D mockupiphone-3d-mockup100xuiBlocksFreeno deps
Menu wheelmenu-wheel100xuiBlocksFree1 dep
Morph modalmorph-modal100xuiBlocksFree1 dep
Motion Dockmotion-dock100xuiBlocksFree1 dep · 3 files
BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex