Components
- Accordion
- Add to Cart
- Animated List
- Carousel
- Collapsible Sidebarnew
- Dynamic Island
- Expandable Cardnew
- Expanding Searchnew
- Filter Grid
- Kanban Board
- Layout Switcher
- Morphing Popover
- Number Flip
- Page Transition
- Product Gallery
- Segmented Control
- Sortable Table
- Stack Navigator
- Status Button
- Step Wizard
- Tabs
- Text Morphnew
- Theme Mode Switch
- Theme Morph Button
- Theme Toggle Button
- Theme Toggle Switch
- Theme Transition
- Toast Stacknew
Installation
$ pnpm dlx shadcn@latest add @transition-kit/dynamic-islandUsage
import {
DynamicIsland,
DynamicIslandContent,
useDynamicIsland,
} from "@/components/transitions/dynamic-island";const [state, setState] = React.useState("idle");
<DynamicIsland state={state} onStateChange={setState}>
<DynamicIslandContent state="idle" className="w-32 px-4 py-3">
Recording
</DynamicIslandContent>
<DynamicIslandContent state="timer" className="w-44 px-4 py-2.5">
04:59
</DynamicIslandContent>
</DynamicIsland>;const DeclineButton = () => {
const { setState } = useDynamicIsland();
return (
<button type="button" onClick={() => setState("idle")}>
Decline
</button>
);
};API Reference
DynamicIsland
| Prop | Type | Default | Description |
|---|---|---|---|
state | string | - | Controlled island state. |
defaultState | string | "idle" | Initial state when uncontrolled. |
onStateChange | (state: string) => void | - | Called with the new state when it changes. |
DynamicIslandContent
| Prop | Type | Default | Description |
|---|---|---|---|
state | string | - | Only the content matching the shown state renders. |
useDynamicIsland
| Return | Type | Description |
|---|---|---|
state | string | The current island state. |
setState | (state: string) => void | Animates to the state and calls onStateChange. |