Ballmac UI home

Dynamic Island

A black pill or MacBook-style notch that morphs between live activities (timers, uploads, an AI thinking state, notifications) with a spring layout animation. Each view is announced politely.

Installation

$ pnpm dlx shadcn@latest add @ballmac/dynamic-island

Usage

import { DynamicIsland, DynamicIslandView, islandSpring } from "@/components/ballmac/dynamic-island"

The full example is in the Code tab above.

Examples

Floating pill

12:04
Call in progress

API reference

<DynamicIslandView>

PropTypeDefault
value*

Identifies this view; the island shows the view whose value matches its `view` prop.

string—
radius

Corner radius in px while this view is showing. Around half the height gives a pill.

number—
label

Announced to screen readers when this view appears (the visual content is not re-read on every change).

string—

<DynamicIsland>

PropTypeDefault
view*

Value of the view to show. Changing it morphs the island to the new view.

string—
shape

"pill" floats with all corners rounded; "notch" hangs from the top edge with square top corners, like a MacBook notch.

"pill" | "notch""pill"

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
—The active view's label is announced in a polite live region; interactive content inside a view is reachable with Tab

Use with AI

<DynamicIsland view={state}> renders whichever <DynamicIslandView value="…"> child matches and springs its size and corner radius to fit. Size each view with className (h-/w-/padding); set radius per view; label is announced via a polite live region. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Dynamic Island (@ballmac/dynamic-island) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Showing one live background activity at a time: an upload, a build, a timer, an AI response in progress
  • A compact status surface pinned to the top of an app or a product mockup
  • Landing-page heroes that demo a Mac notch or iPhone app

Not for

  • Several notifications that need to stay visible together (use notification-stack)
  • Long or critical messages that must not disappear (use a dialog or an inline alert)

Registry JSON: https://ui.ballmac.com/r/dynamic-island.json

Credits

Free to use in personal and commercial projects.

Registry
shadcn/utils