Dynamic Island

Installation

Add React Dynamic Island and choose how to style it.

Requirements

Use React 18 or later with a matching version of React DOM. The package includes Motion as a dependency. Tailwind CSS is optional.

Install the package

Choose your package manager:

pnpm
pnpm add ob-react-dynamic-island
npm
npm install ob-react-dynamic-island
Yarn
yarn add ob-react-dynamic-island

If your own code imports from motion/react, add motion as a direct dependency too:

pnpm add motion

Next.js client boundary

Put the island and its state in a Client Component. The component uses Motion, and the render functions in its configuration cannot be passed across a Server Component boundary.

components/status-island.tsx
"use client";

import DynamicIsland from "ob-react-dynamic-island";

// Define the state and render functions in this client module.

A Server Component can then import and render your StatusIsland component normally.

Styling with Tailwind CSS 4

The package uses utility classes for its container and content layout. It does not ship a CSS file. Make sure Tailwind scans the installed package so these utilities are generated.

For a project with app/globals.css and node_modules at its root:

app/globals.css
@import "tailwindcss";
@source '../node_modules/ob-react-dynamic-island/dist';

The @source path is relative to your CSS file. Adjust it for your folder structure. In this monorepo, the documentation site also scans the local package source.

You can now use className for the outer surface and contentProps.className for its inner layout:

<DynamicIsland
  value="idle"
  components={{
    idle: {
      animatedConfig: { width: 128, height: 36, borderRadius: 24 },
      render: () => <span>All set</span>,
    },
  }}
  className="bg-zinc-950 text-sm text-white"
  contentProps={{ className: "px-4" }}
/>

Styling without Tailwind

Provide the base layout through style and contentProps.style. This complete component works without a CSS framework:

status-island.tsx
"use client";

import DynamicIsland from "ob-react-dynamic-island";

export default function StatusIsland() {
  return (
    <DynamicIsland
      value="idle"
      components={{
        idle: {
          animatedConfig: { width: 128, height: 36, borderRadius: 24 },
          render: () => <span>All set</span>,
        },
      }}
      style={{
        position: "relative",
        overflow: "hidden",
        background: "#09090b",
        color: "#fafafa",
        fontSize: 14,
        fontFamily: "system-ui, sans-serif",
      }}
      contentProps={{
        style: {
          width: "100%",
          height: "100%",
          display: "flex",
          alignItems: "center",
          justifyContent: "center",
          overflow: "hidden",
        },
      }}
    />
  );
}

Keep content inside the surface

Preserve position: relative and overflow: hidden on the container. Exiting content is positioned during the transition, and the clipping keeps it inside the animated shape.

Continue to your first island to add a second state and a working control.