Dynamic island
A Calamansi island that eases between a compact bar and an expanded slab when tapped, and glows when it alerts.
Tap island to expand or collapse
Scenario Switcher
Installation
npx shadcn@latest add fujiDevv/calamansi-ui/dynamic-islandHow to use
import { DynamicIsland } from "@/components/ui/dynamic-island"export function Demo() {return (<DynamicIslandtitle="Focus Timer"trailing={<span>24:18</span>}expandedContent={<div>Expanded Timer View</div>}/>)}
Props
Options you can pass to customize this component.
stateoptionalidlecompactexpandedalertControlled state of the island.
defaultStateoptionalidlecompactexpandedalertInitial state when the island is uncontrolled.
onStateChangeoptional(state: DynamicIslandState) => voidCallback fired when state toggles.
iconoptionalReactNodePrimary icon, drawn in a chip tinted from the surface ink.
leadingoptionalReactNodeLeading slot in compact/alert state.
trailingoptionalReactNodeTrailing slot in compact/alert state.
titleoptionalReactNodeTitle in compact/alert state.
expandedContentoptionalReactNodeFull content rendered in expanded mode.
interactiveoptionalbooleanEnable click to expand/collapse.
variantoptionalwhitecalamansislatecitrusSurface palette. Calamansi is the default slab; White is white in light mode and near-black in dark.
pulseoptionalbooleanAn ambient pulsing dot beside the title in idle and compact states.
classNameoptionalstringExtra classes merged onto island pill.
Dependencies
License & Usage
- •Free to use and modify in personal and commercial projects.
- •Attribution to Calamansi UI is appreciated when using a component.
- •Please do not resell the components as your own kit.