ComponentsDynamic Island

Dynamic Island

A reusable Dynamic Island component inspired by Apple's design, featuring smooth state transitions and animations.

Code

1

Install with shadcn Beta

Terminal

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

Or install the demo

Terminal

npx shadcn@latest add "https://smoothui.dev/r/dynamic-island-demo.json"

How to use

Demo.tsx

"use client"

import React, { useState } from "react"

import DynamicIsland, {
  DynamicIslandProps,
} from "@/components/smoothui/ui/DynamicIsland"

const DynamicIslandDemo = () => {
  const [view, setView] = useState<DynamicIslandProps["view"]>("idle")

  return <DynamicIsland view={view} onViewChange={setView} />
}

export default DynamicIslandDemo

Props

PropTypeDescription
view?"idle" | "ring" | "timer"Controlled view state.
onViewChange?(view: "idle" | "ring" | "timer") => voidCallback when the view changes.
idleContent?ReactNodeCustom content for idle state.
ringContent?ReactNodeCustom content for ring state.
timerContent?ReactNodeCustom content for timer state.
className?stringOptional additional class names for the root container.