Dynamic Island
A floating, expandable notification component inspired by Apple's Dynamic Island. Features notification stacking with navigation dots, dismissable vs persistent notifications, priority-based ordering, and auto-collapse.
Preview
Click the button below to trigger a notification.
The Dynamic Island will appear at the top of the viewport.
Installation
Use the CLI to add this component to your project.
Setup
Wrap your app with DynamicIslandProvider.
Layout Setup
Usage
Positions
Current position: top-center
Variants
Notification Stacking
Multiple notifications queue up. Expand to see navigation dots at the bottom for switching between notifications. Recent/high-priority notifications appear first.
Queue: 0 notifications
Push multiple notifications, then expand to see navigation dots
Dismissable vs Persistent
Some notifications (like calls or music players) should not be dismissable. Use dismissable: false and priority to control behavior.
Non-dismissable notifications (calls, music) cannot be swiped away.
Use dismissable: false and priority: 10
Auto-dismiss
Set duration for automatic dismissal. Expanded view auto-collapses after 10s of inactivity.
Expanded view auto-collapses after 10s of inactivity
Examples
Music Player (Non-Dismissable)
Music player is non-dismissable
Incoming Call (Highest Priority)
Calls have highest priority and cannot be dismissed
Hook API
| Method | Description |
|---|---|
| push(notification) | Add notification to queue, returns id |
| dismiss(id) | Dismiss (only if dismissable) |
| dismissAll() | Clear all dismissable notifications |
| collapse() | Collapse expanded view |
| setPosition(pos) | Set global position |
| setActiveIndex(i) | Switch to notification at index |
Props
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | required | Title text for the notification |
icon | ReactNode | undefined | Icon to display |
subtitle | string | undefined | Secondary text below title |
content | ReactNode | undefined | Custom expanded content |
variant | 'default' | 'success' | 'error' | 'warning' | default | Visual variant with shadow color |
duration | number | 5000 | Auto-dismiss in ms. 0 = persistent. |
dismissable | boolean | true | If false, cannot be dismissed (e.g., calls) |
priority | number | 0 | Higher priority shows first |
Features
Navigation Dots
Switch between stacked notifications using dots when expanded.
Auto-Collapse
Expanded view collapses after 10s of inactivity.
Priority Ordering
High priority notifications (calls) always show first.
Persistent Notifications
Calls and music players can't be dismissed, only collapsed.