Kinetik UI

Vinyl Player

.md

A music card whose cover is a record half out of its sleeve, spinning while it plays and coasting to a stop.

v1.1.0Live on webreact-native-reanimatedreact-native-svgreact-native-worklets
Component preview

Installation

Kinetik CLI
npx kinetik-ui add vinyl-player

The CLI copies the source and installs native dependencies with npx expo install, so versions match your Expo SDK. With shadcn: npx shadcn@latest add https://kinetik-ui.dev/r/vinyl-player.json

Install manually

  1. Install dependencies
    npx expo install react-native-reanimated react-native-svg react-native-worklets
  2. Copy the source files
    • components/kinetik/vinyl-player.tsx
    View source files

Usage

import { VinylPlayer } from '@/components/kinetik/vinyl-player';

<VinylPlayer
  tracks={queue.map((t) => ({
    id: t.id,
    title: t.title,
    artist: t.artist,
    cover: { uri: t.artwork },
    duration: t.seconds,
  }))}
  onPlayingChange={(on) => (on ? player.play() : player.pause())}
  onTrackChange={(t) => player.load(t.id)}
  onMutedChange={player.setMuted}
/>;

With a real audio engine

Pass playing, position and trackId from your player, and the card follows it instead of keeping its own clock. Buffering, a seek from the lock screen or a skip from headphones then shows up as it happens.

const { playing, position, trackId } = usePlayerState(); // from your audio library

<VinylPlayer
  tracks={tracks}
  playing={playing}
  position={position}
  trackId={trackId}
  onPlayingChange={(on) => (on ? player.play() : player.pause())}
  onTrackChange={(t) => player.skipTo(t.id)}
  onSeek={(seconds) => player.seekTo(seconds)}
/>;

When to use

  • A mini player with some character: a music app's home, a playlist header, a widget.

When not to use

  • When people need to scrub precisely, say through podcasts or audiobooks: the bar seeks on a tap, not a drag.

Notes

  • Without position it keeps its own clock, which is fine for a preview or a demo. With real audio, pass position so the audio engine stays the source of truth. Updates a few times a second are enough: the bar glides between them.

  • Each of playing, position and trackId is optional and independent. Whatever you leave unset, the card keeps on its own.

  • onSeek fires for a tap on the bar, a screen-reader step and Previous restarting the track.

  • The record half sits outside the card, so leave room on the left (about 66 pt).

  • It spins while playing (one turn every six seconds) and coasts a little when paused, keeping its angle.

  • Previous restarts the track after three seconds; otherwise it goes back a track. The queue wraps around.

  • The mute button only shows when you pass onMutedChange.

Props

VinylPlayerProps

PropTypeDefaultDescription
tracksrequiredreadonly VinylTrack[]—
autoPlaybooleanfalseStart playing at once. Defaults to false. Ignored when `playing` is set.
playingboolean—Whether it plays, owned by your app. Leave unset to let the player keep its own state.
positionnumber—Seconds into the current track, reported by your audio engine. Setting it turns the player's own clock off: the bar and the time follow this value.
trackIdstring—The id of the current track, owned by your app (say, after a skip from the lock screen).
onTrackChange(track: VinylTrack) => void—
onPlayingChange(playing: boolean) => void—
onSeek(seconds: number) => void—Called with the seconds to jump to when the bar is tapped, stepped or Previous restarts.
onMutedChange(muted: boolean) => void—Called when the mute button is toggled. Without it there is no mute button.
accentstring—Colour of the progress. Defaults to the theme azure.
hapticsbooleantrueA tick on each control. Defaults to true.
styleStyleProp<ViewStyle>—

Performance and accessibility

Performance

Budget
While playing, the record turns with one repeating UI-thread timing and the progress with another; the time re-renders four times a second. Paused, nothing animates.
Measured

Pixel 9 emulator, API 35, release build · interaction median 1.00× the system Settings app on the same emulator (indicative only) · no frames drawn at rest · 171 MB app memory

Real-device measurement pending.

Accessibility

Reduced motion
The record does not spin or drop in; controls change state without the ring flash or icon pop.
Screen readers
Title and artist read as one line; the progress is adjustable in ten-second steps; Mute is a switch; Previous, Play/Pause and Next are buttons.
Touch target
Controls and the mute switch are 48 pt; the progress bar's touch area is 44 pt tall.

Source files

components/kinetik/vinyl-player.tsx is in the Code tab of the preview above.