About this animation
A music player that expands from a compact glass bar, with configurable artwork, track copy, dominant color, and fonts.
How it works
- The component measures its own surface and uses one continuous
progressshared value from compact to expanded. - The compact artwork slot is measured with
onLayout; its exact position, size, corner radius, and breathing scale interpolate into the large cover without a navigation dependency. - A spring follows upward and downward pans, inheriting release velocity so the gesture can be interrupted at any point.
- The background scales back and dims while the full player materializes with a blurred artwork atmosphere.
- The expanded surface stays opaque over the library by compositing the blurred artwork over a solid
#120C14base.
Install
npx expo install expo-blur expo-image react-native-gesture-handler react-native-reanimated react-native-worklets @expo/vector-iconsUsage
import MiniPlayerExpand from './MiniPlayerExpand';
<MiniPlayerExpand artwork={require('./artwork.jpg')} />With content and an imperative trigger:
const ref = useRef<MiniPlayerExpandRef>(null);
<MiniPlayerExpand
ref={ref}
artwork={artwork}
title="Slow Morning"
artist="Mira Vale"
brandName="Aurora"
dominantColor="#A46D63"
/>Props
| Prop | Type | Default | Description |
|---|---|---|---|
artwork | ImageSourcePropType | Required | Album artwork shown in both player states. |
title | string | 'Slow Morning' | Track title. |
artist | string | 'Mira Vale' | Track artist. |
dominantColor | string | '#B67A67' | Dominant artwork color used for the full-screen atmosphere. |
brandName | string | 'Solis' | Product name shown in the library header. |
backgroundItems | { artwork: ImageSourcePropType; title: string }[] | [] | Optional cards shown behind the player in a host screen. |
playing | boolean | true | Whether playback starts active. |
onExpandedChange | (expanded: boolean) => void | undefined | Called after the player reaches either resting state. |
fontFamily | string | undefined | Font used for interface copy. |
monoFontFamily | string | undefined | Monospaced font used for time labels. |
style | StyleProp<ViewStyle> | undefined | Container styling. |
accessibilityLabel | string | ${title} by ${artist} | Screen-reader label for the player. |
testID | string | undefined | Test identifier for the component. |
duration | number | 620 | Player preview expansion duration in milliseconds. Spring physics and reduced-motion timing are unchanged. |
The ref exposes expand(), collapse(), toggle(), togglePlayback(), and dragCollapse().
Compatibility
Expo SDK 58, React Native 0.88, Reanimated 4.7, and Worklets 0.13. iOS, Android, and web are supported. The component uses Expo Go-compatible modules.
Accessibility
The mini player and all playback actions expose button roles and labels with 44 pt hit areas. Reduced motion changes the transition to a short fade and removes the spring-driven movement.
Icons
Icons: Lucide (ISC), using the matching Feather rendering family from Expo Vector Icons.
Why this one
The player makes the measured mini artwork the navigation anchor: it remains visually continuous while the entire library recedes beneath an opaque, artwork-tinted listening space. A tactile 72 pt playback disc and a finger-paced demo collapse make the familiar pattern feel more physical than a separate modal appearing over a static mini player.




