---
title: "Dynamic Island"
description: "A pill at an edge of the screen that grows to fit a notice, a call, or a song, like the Dynamic Island on iPhone, then shrinks back."
url: https://gelatinui.com/components/dynamic-island
markdown_url: https://gelatinui.com/components/dynamic-island.md
access: free
install: "npx shadcn@latest add @gelatin-ui/dynamic-island"
registry_item: https://gelatinui.com/r/dynamic-island.json
version: "2026-11-10"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Dynamic Island

> A pill at an edge of the screen that grows to fit a notice, a call, or a song, like the Dynamic Island on iPhone, then shrinks back.

Page: https://gelatinui.com/components/dynamic-island

## When to use it

Best for: A live status that grows into a notice or a card and shrinks back, at an edge of the screen.

- Use it when one place on the page shows a live status that changes, and the shape must grow from the old content to the new one.
- Give each view a name. The app sets `view` to the name, or to `null` for the idle shape.
- Use `dismissAfterMs` for a notice that goes by itself. A new `key` on the view shows the same notice again with the full time.

## When not to use it

- For a stack of messages that can show at the same time, use a [Toast](https://gelatinui.com/components/toast.md).
- For a message that must stay on the page, use an [Alert](https://gelatinui.com/components/alert.md).

## Notes for agents

- The app owns the state: pass `view` and `onViewChange`. Each `DynamicIslandView` shows while `view` equals its `name`.
- Size a view through its content (a width class such as `w-80`, or `DynamicIslandCompact`). Text that must truncate needs a width.
- Leave `dismissTo` out on a view that a page button shows again: the press of that button is outside the island and would close the view first.
- Give each `DynamicIslandTrigger` an `aria-label` that says what the press shows.

## Anatomy

```text
DynamicIsland
├─ DynamicIslandView (0..n)
├─ DynamicIslandCompact (0..n)
├─ DynamicIslandLeading (0..n)
├─ DynamicIslandTrailing (0..n)
├─ DynamicIslandTrigger (0..n)
└─ DynamicIslandBubble (0..n)
```

## API reference

### DynamicIsland

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `view` | `string \| null` |  | The name of the active `DynamicIslandView` (controlled). `null`: the idle pill. |
| `defaultView` | `string \| null` | null | The view at first render when `view` is not set (uncontrolled). Default: `null`, the idle pill. |
| `onViewChange` | `function` |  | Called with the next view: a `DynamicIslandTrigger` press, or a dismiss (Escape, a press outside). |
| `placement` | `"bottom" \| "top"` | "top" | The edge the island hangs from. `top` (default): it grows down from the top center, as on iOS. `bottom`: it grows up from the bottom center (a phone page with the island above the home bar), and a swipe down closes a view. Place the root at that edge. |
| `align` | `"center" \| "end" \| "start"` | "center" | Where across the root the shape grows from. `center` (default): from the middle, as on iOS. `start` and `end`: from that side (right to left aware), for a shape in a corner (a notice at the top end of a desktop app, a button at the bottom end that grows into a panel). With `end`, a `DynamicIslandBubble` leaves from the start side. |
| `idle` | `"hidden" \| "pill"` | "pill" | The shape at rest with no view. `pill` (default): the 126 × 37 idle pill stays. `hidden`: the idle size is 0, so a view grows out of nothing and folds back to nothing (a notice or a status on a page with no camera). The root then takes no space in the page. |
| `scheme` | `"dark" \| "inherit"` | "dark" | The color scheme of the content. `dark` (default): the content takes the dark look of the components on the black shape. `inherit`: the page scheme, for a light surface (`data-[scheme=inherit]:[--dynamic-island-surface:var(--popover)]` on the root). |

### DynamicIslandView

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `name` | `string` |  | The view's name: it shows while the root `view` equals it. |
| `dismissTo` | `string \| null` |  | The view that Escape and a press outside go to (`null`: the idle pill). Leave it out for a view that stays until the app changes it (a timer, a call), and for a view that a page button shows again or hides: that button is outside, so its `pointerdown` would close the view first. |
| `dismissAfterMs` | `number` |  | The time the view shows before the island goes to `dismissTo` (the idle pill when it has none), in ms: a notice that goes by itself. It counts from the morph to this view, waits while a hover pointer is over the island or focus is in it, and starts again from the full time when they leave. A new `key` on the view starts the full time again (the same notice a second time). Leave it out for a view that stays. |
| `style` | `MotionStyle` |  | Styles of the content box (Motion style: plain CSS or motion values). |

### DynamicIslandCompact

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### DynamicIslandLeading

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### DynamicIslandTrailing

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### DynamicIslandTrigger

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `view` | `string \| null` |  | The view to show on press (`null`: the idle pill). Leave it out to only run `onClick`. |

Also takes every prop of Base UI `Button`: https://base-ui.com/react/components/button

### DynamicIslandBubble

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `open` | `boolean` |  | Shows the bubble: it splits out of the pill end, and merges back in when it turns `false`. |
| `style` | `MotionStyle` |  | Styles of the circle (Motion style: plain CSS or motion values). |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| DynamicIsland | `dynamic-island` | `data-align`, `data-placement` | `--dynamic-island-bubble`, `--dynamic-island-corner`, `--dynamic-island-height`, `--dynamic-island-idle-height`, `--dynamic-island-idle-width`, `--dynamic-island-keyline`, `--dynamic-island-origin-x`, `--dynamic-island-origin-y`, `--dynamic-island-radius`, `--dynamic-island-scale`, `--dynamic-island-sensor`, `--dynamic-island-surface`, `--dynamic-island-width` |  |
| DynamicIslandView | `dynamic-island-view` |  |  |  |
| DynamicIslandCompact | `dynamic-island-compact` |  | `--dynamic-island-idle-height` |  |
| DynamicIslandLeading | `dynamic-island-leading` |  | `--dynamic-island-sensor` |  |
| DynamicIslandTrailing | `dynamic-island-trailing` |  |  |  |
| DynamicIslandTrigger | `dynamic-island-trigger` |  |  | `hit-area` |
| DynamicIslandBubble | `dynamic-island-bubble` | `data-align`, `data-placement` | `--dynamic-island-bubble`, `--dynamic-island-bubble-gap`, `--dynamic-island-bubble-side`, `--dynamic-island-bubble-travel`, `--dynamic-island-corner`, `--dynamic-island-goo`, `--dynamic-island-press`, `--dynamic-island-split`, `--dynamic-island-surface` |  |

## Usage

Render the root with the views. The app sets `view` to a name, or to `null` for the idle shape. A view with `dismissAfterMs` goes by itself.

The sample also uses `button`, which this add does not write. One command adds them with this item:

```bash
npx shadcn@latest add @gelatin-ui/dynamic-island @gelatin-ui/button
```

```tsx title="copy-link.tsx"
import { useState } from "react";

import { DynamicIsland, DynamicIslandView } from "@/components/effects/dynamic-island";
import { Button } from "@/components/ui/button";

export function CopyLink() {
  const [view, setView] = useState<string | null>(null);
  return (
    <div className="relative">
      <Button onClick={() => setView("copied")}>Copy link</Button>
      <DynamicIsland
        view={view}
        onViewChange={setView}
        placement="bottom"
        idle="hidden"
        className="absolute inset-x-0 bottom-4 mx-auto"
      >
        <DynamicIslandView name="copied" dismissAfterMs={2500}>
          <p className="px-4 py-2.5 text-sm">Link copied</p>
        </DynamicIslandView>
      </DynamicIsland>
    </div>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui/dynamic-island
```

It adds 28 registry items: 26 files, 5438 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `@xstate/react`, `clsx`, `motion`, `tailwind-merge`, `tailwind-variants`, `xstate`.

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Toast](https://gelatinui.com/components/toast.md)
- [Button](https://gelatinui.com/components/button.md)
- [Progress](https://gelatinui.com/components/progress.md)

## Keyboard

| Keys | Action |
| --- | --- |
| Enter | On a trigger, shows its view and moves focus into it. |
| Space | On a trigger, shows its view and moves focus into it. |
| Esc | Closes a view that has `dismissTo`, and returns focus to where it came from. |

## Accessibility

Only the active view renders. A view that leaves is `inert` and `aria-hidden` while it fades, so Tab and a screen reader skip it.

A `DynamicIslandTrigger` is a Base UI `Button` over the whole shape, with a 44px target on touch (`hit-area`) and an outline focus ring 2px out from the shape. Give it an `aria-label`.

A trigger press moves focus into the next view: its first control, else the view box. Escape and a press outside close a view with `dismissTo`, and focus goes back to where it came from.

A timed view waits while a mouse pointer is over the island or focus is in it, and starts again from the full time when both leave. So a person who reads or acts never loses the view.

The island announces nothing by itself. Put words that a screen reader must hear in the page text next to it.

## Motion

| Part | Motion |
| --- | --- |
| Morph | island · the shape springs to the size of the next view, and keeps its speed when the view changes mid-way |
| Content | fade · the next content blurs in 50ms after the change; the old content leaves on popup-exit |
| Press and hover | island · the shape scales to 0.96 on a press and 1.02 on a mouse hover, from the edge it hangs from |
| Bubble | island · a second circle splits out of the pill end, with a liquid neck while it moves |
