BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/beui/dynamic-island

Dynamic Island

beui/dynamic-island
FreeBlock

iOS-style island pill that morphs between live activity views with bouncy shell resize and blur crossfades.

Install it

npx shadcn@latest add https://beui.dev/r/dynamic-island.json

Source

components/motion/dynamic-island.tsxbeui.dev/r/dynamic-island.json · first 6 KB
1"use client";
2// beui.dev/components/blocks/dynamic-island
3
4import { AnimatePresence, motion, useReducedMotion } from "motion/react";
5import {
6 createContext,
7 useContext,
8 useEffect,
9 useLayoutEffect,
10 useMemo,
11 useRef,
12 useState,
13 type ReactNode,
14} from "react";
15import { EASE_OUT } from "@/lib/ease";
16import { cn } from "@/lib/utils";
17
18type IslandContextValue = {
19 view: string | null;
20};
21
22const IslandContext = createContext<IslandContextValue | null>(null);
23
24// Shell physics in Apple's duration/bounce form one long perceptual glide with barely-there bounce, identical in
25// both directions. The shell animates real width/height (not transforms), so
26// slots are never scale-distorted.
27const SHELL_SPRING = {
28 type: "spring",
29 duration: 0.8,
30 bounce: 0.2,
31} as const;
32
33// Content gets a touch more life than the shell.
34const CONTENT_SPRING = {
35 type: "spring",
36 duration: 0.8,
37 bounce: 0.35,
38} as const;
39
40// Constant radius — never animated. The browser clamps it to half the shell
41// height, so the pill-to-rounded-rect morph falls out of the resize for free
42// with zero chance of corner glitches.
43const RADIUS = 32;
44
45// iPhone pill dimensions. Also the shell's pre-measure animate target: if the
46// first commit already has a view active (e.g. a click replayed after
47// hydration), the shell blooms from the pill instead of rendering expanded
48// with no animation. Lives in `animate`, not `initial`, so server and client
49// markup agree.
50const PILL_WIDTH = 126;
51const PILL_HEIGHT = 37;
52
53/** Tracks the natural size of the content so the shell can spring to it. */
54function useContentSize() {
55 const ref = useRef<HTMLDivElement | null>(null);
56 const [size, setSize] = useState<{ width: number; height: number } | null>(
57 null,
58 );
59
60 // Synchronous mount measure: the shell must own explicit dimensions before
61 // the first interaction. ResizeObserver fires async after mount — a quick
62 // first press could beat it, leaving the shell auto-sized so the view
63 // snapped open instead of springing.
64 useLayoutEffect(() => {
65 const el = ref.current;
66 if (!el) return;
67 setSize({ width: el.offsetWidth, height: el.offsetHeight });
68 }, []);
69
70 useEffect(() => {
71 const el = ref.current;
72 if (!el || typeof ResizeObserver === "undefined") return;
73 const observer = new ResizeObserver(() => {
74 setSize({ width: el.offsetWidth, height: el.offsetHeight });
75 });
76 observer.observe(el);
77 return () => observer.disconnect();
78 }, []);
79
80// … truncated

What it pulls in

npm packages

  • clsx
  • motion
  • tailwind-merge

Files it writes

  • components/motion/dynamic-island.tsx
  • lib/ease.ts
  • lib/utils.ts

Facts

Registry
beui
Type
registry:block
Access
Free
Files written
3
Licence
the repository states none
First indexed
2026-08-12
Last confirmed
today

Go to the source

beui.dev Raw registry item This item as JSON

More from beui

All 104 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
File Upload Attachment Uploadattachment-uploadbeuiBlocksFree4 deps · 5 files
Availability Scheduleravailability-schedulerbeuiBlocksFree4 deps · 15 files
Bloom Menubloom-menubeuiBlocksFree4 deps · 3 files
Command Palettecommand-palettebeuiBlocksFree4 deps · 3 files
Expandable Action Barexpandable-action-barbeuiBlocksFree3 deps · 2 files
Expandable Tabsexpandable-tabsbeuiBlocksFree3 deps · 3 files
Feedback Widgetfeedback-widgetbeuiBlocksFree4 deps · 9 files
File Upload Upload Queuefile-uploadbeuiBlocksFree4 deps · 3 files
BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

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.

BlockDex

BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

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.

BlockDex

BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

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.

BlockDex