BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/godui/dynamic-island

Dynamic Island

godui/dynamic-island
FreeComponent

An Apple-inspired pill that springs between size presets while its content cross-fades.

Install it

npx shadcn@latest add https://godui.design/r/dynamic-island.json

Source

packages/components/src/dynamic-island/dynamic-island.tsxgodui.design/r/dynamic-island.json
1"use client";
2
3import { AnimatePresence, motion, useReducedMotion } from "framer-motion";
4import * as React from "react";
5
6export type DynamicIslandSize =
7 | "compact"
8 | "default"
9 | "long"
10 | "tall"
11 | "large";
12
13export type DynamicIslandProps = React.HTMLAttributes<HTMLDivElement> & {
14 /** Shape preset the island morphs to. */
15 size?: DynamicIslandSize;
16 /**
17 * Identity of the current content. Change it to cross-fade the inner view;
18 * defaults to `size` so each shape transitions its content.
19 */
20 presenceKey?: React.Key;
21};
22
23const SIZES: Record<
24 DynamicIslandSize,
25 { width: number; height: number; radius: number }
26> = {
27 compact: { width: 140, height: 36, radius: 18 },
28 default: { width: 220, height: 44, radius: 22 },
29 long: { width: 360, height: 52, radius: 26 },
30 tall: { width: 260, height: 120, radius: 28 },
31 large: { width: 360, height: 200, radius: 36 },
32};
33
34// Underdamped so the shell settles with the signature rubbery overshoot.
35const SHELL_SPRING = {
36 type: "spring" as const,
37 stiffness: 520,
38 damping: 32,
39};
40
41const DynamicIsland = React.forwardRef<HTMLDivElement, DynamicIslandProps>(
42 (
43 { size = "default", presenceKey, className, style, children, ...props },
44 ref,
45 ) => {
46 const reduceMotion = useReducedMotion();
47 const dims = SIZES[size];
48 const key = presenceKey ?? size;
49
50 return (
51 <motion.div
52 ref={ref}
53 data-slot="dynamic-island"
54 layout
55 initial={false}
56 animate={{
57 width: dims.width,
58 height: dims.height,
59 borderRadius: dims.radius,
60 }}
61 transition={reduceMotion ? { duration: 0 } : SHELL_SPRING}
62 className={`relative flex items-center justify-center overflow-hidden bg-black text-white shadow-xl ${className ?? ""}`}
63 style={{ maxWidth: "100%", ...style }}
64 {...(props as React.ComponentProps<typeof motion.div>)}
65 >
66 <AnimatePresence mode="popLayout" initial={false}>
67 <motion.div
68 key={key}
69 initial={
70 reduceMotion
71 ? false
72 : { opacity: 0, scale: 0.9, filter: "blur(4px)" }
73 }
74 animate={{ opacity: 1, scale: 1, filter: "blur(0px)" }}
75 exit={
76 reduceMotion
77 ? undefined
78 : { opacity: 0, scale: 0.9, filter: "blur(4px)" }
79 }
80 transition={{ duration: 0.2, ease: "easeOut" }}
81// … truncated

What it pulls in

npm packages

  • framer-motion

Other registry items

  • @godui/godui-theme

Files it writes

  • packages/components/src/dynamic-island/dynamic-island.tsx

Facts

Registry
godui
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-03
Last confirmed
yesterday

Go to the source

godui.design LucasBassetti/godui on GitHub Raw registry item This item as JSON

More from godui

All 105 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
AccordionaccordiongoduiComponentsFree1 dep
Agent Flowagent-flowgoduiComponentsFree1 dep
Agent Timelineagent-timelinegoduiComponentsFree1 dep
Animated Beamanimated-beamgoduiComponentsFree1 dep
Animated Testimonialsanimated-testimonialsgoduiComponentsFree1 dep
Animated Tooltipanimated-tooltipgoduiComponentsFree1 dep
App Showcaseapp-showcasegoduiComponentsFree1 dep
Aurora Textaurora-textgoduiComponentsFreeno deps
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