Skip to main content

Shared Components

Audience: End users, system administrators, technical stakeholders Last Updated: 2026-04-06 Version: 2.0.0


Table of Contents

  1. Overview
  2. Key Concepts
  3. Media Item Display
  4. Full Player Ecosystem
  5. Seekbar System
  6. Modal & Dialogue System
  7. Loading States & Skeletons
  8. Layout & Page Structure
  9. Text Handling & Marquee
  10. Animations & Directives
  11. Formatting Pipes
  12. Debug & Diagnostic Tools
  13. Performance optimisation
  14. Technical Specifications
  15. Related Documentation

Overview

The Llamafin app includes a comprehensive library of 69 reusable UI components, 5 interactive directives, and 7 data formatting pipes. These shared building blocks create a consistent, polished user experience across every page of the application.

Why It Matters

Rather than recreating common UI patterns for each page, the app uses a unified component library that ensures:

  • Visual Consistency: Every list, grid, and card looks the same across the app
  • Performance: Components are optimised for smooth animations on all devices
  • Maintainability: Improvements to a shared component benefit the entire app
  • Accessibility: Consistent keyboard navigation and screen reader support

Component Categories

CategoryCountPurpose
Media Item Display5Rendering songs, albums, artists, playlists
Full Player Ecosystem12Full-screen player, mini-player, controls
Seekbar System6Playback progress with 4 visual styles
Modal & Dialogue System13Settings, playlists, filters, downloads
Loading States & Skeletons7Placeholders during data loading
Layout & Page Structure5Page headers, library layouts, FABs
Text Handling & Marquee4Scrolling text for long titles
Animations & Directives5Animated numbers, long-press, custom scrollbars
Formatting Pipes7Time, file size, image URL resolution
Debug & Diagnostic Tools7Performance monitoring, server discovery
Other (profile, progress, etc.)8Profile pictures, charts, popovers

Key Concepts

Standalone Components

All 69 components are standalone, meaning they can be imported and used independently without needing a shared module. This modern Angular approach provides:

  • Cleaner imports (no module overhead)
  • Better tree-shaking (unused components are excluded from builds)
  • Easier testing (no module configuration needed)

Change Detection Strategy

Every component uses OnPush change detection, the most performant strategy in Angular. This means components only re-render when their inputs actually change, rather than checking on every application event. For a music player with frequent state updates (seeking, progress, Visualisations), this is essential for smooth 60fps performance.

Settings-Driven UI

Many components automatically adapt their appearance based on user settings:

  • Seekbar Style: Users can choose between default, waveform, bars, or spectrogram seekbars
  • Spinner Animation: 25+ animation types for loading indicators
  • Text Overflow: Marquee vs. sliding vs. simple text scrolling
  • Theme Colours: Components adapt to the app's dominant colour from album artwork

Media Item Display

What It Does

The media item display system renders your music library in multiple visual formats depending on context and user preference.

Component Breakdown

ComponentWhat It RendersWhen You See It
Audio ItemFull media card with artwork, title, artist, duration, download status, and actionsLibrary browsing (lists, grids, album tracks, playlist tracks)
Audio Item SimpleLightweight text-only itemUp-next queue in the full player
Audio Item ImageAlbum artwork with fallback chainInside Audio Item components
Audio Item Detail AvatarLarge artwork for detail pagesLibrary detail pages
Audio Item MenuContext menu with 25+ actionsLong-press on any media item

Display Modes

The main Audio Item component adapts to four different display modes:

ModeAppearanceUse Case
ListHorizontal row with thumbnailCompact browsing on all screen sizes
GridSquare card with artwork on topVisual browsing on tablets/desktops
Album TrackNumbered track with durationBrowsing tracks within an album
Playlist TrackTrack with position and durationViewing playlist contents

Available Actions

Long-pressing any media item opens a context menu with actions appropriate to the item type:

Playback Actions: Play, Shuffle, Play Next, Add to Queue, Instant Mix

Organisation Actions: Add to Playlist, Remove from Playlist, Delete Playlist, Move to Top/Bottom/Custom Position

Navigation Actions: Go to Album, Go to Artist, Go to Playlist, Go to Genre, Go to Folder

Download Actions: Download (with quality options), Pause/Resume/Cancel/Repair/Reset Download, Delete Download

Sharing Actions: Share (native sharing), Delete from Server

Analysis Actions: Process Lyrics, Process Sonic Analysis

Other: Toggle Favorite

How It Works

When you browse your library, the app:

  1. Fetches Items: Retrieves albums, artists, songs, or playlists from the server or local cache
  2. Renders via Library Layout: The layout engine decides whether to show a list, grid, or carousel based on your settings and screen size
  3. Displays Each Item: Each item renders with artwork (resolved from local files or server), metadata, and action buttons
  4. Handles Interactions: Taps play the item, long-presses open the context menu, and multi-select enables bulk actions

Full Player Ecosystem

What It Does

The full-screen player is the centerpiece of the Llamafin experience. It provides immersive playback Visualisation with album artwork, vinyl turntable animations, audio visualizers, synced lyrics, and comprehensive playback controls.

Component Breakdown

ComponentWhat It ShowsInteraction
Full Player PageMain modal page hosting all player elementsSwipe left/right to cycle views
Play CoverAlbum artwork in the playerTap to cycle views
Play RecordVinyl record that spins during playbackTap to cycle views
Play TurntableInteractive DJ turntable with tonearmTap to cycle views
Play VisualiserMilkDrop/Butterchurn audio visualizerTap to cycle views
Play LyricsSynced lyrics with auto-scroll and beat glowTap to cycle views
Playback ControlsSeekbar, play/pause, skip, volumeDirect interaction
Player Up NextQueue, recently played, and similar songsScroll and select
Mini PlayerCollapsed player at bottom of appTap to open full player
Play MenuIn-player context menuTap menu icon
Play DJ MenuDJ mode selectionTap DJ icon

View Cycling

The full player features a 3-page swipe carousel:

PageWhat You SeeHow to Navigate
CoverAlbum artwork, vinyl record/turntableDefault view, swipe right to go to Visualiser
VisualiserMilkDrop/Butterchurn audio VisualisationSwipe left to go to Cover, right to go to Lyrics
LyricsSynced lyrics with active line highlightingSwipe left to go to Visualiser

Tap the album artwork to cycle through views: Cover → Record → Turntable → Visualiser → Lyrics → back to Cover.

Turntable Themes

The DJ turntable component supports four visual themes:

ThemeStyle Description
ModernClean, minimal design with flat colours
VintageClassic turntable with wood grain accents
DJProfessional DJ setup with mixer elements
AudiophileHigh-end audiophile aesthetic

Quality tiers (auto, high, medium, low) adjust the SVG detail level for performance on different devices.

Mini Player

The mini player sits at the bottom of every screen (except the full player) and shows:

  • Current track name and artist
  • Progress bar
  • Play/pause button
  • Next track button

Tap the mini player to open the full-screen player modal.


Seekbar System

What It Does

The seekbar system lets you navigate through a track with four distinct visual styles, each powered by audio analysis data when available.

Seekbar Styles

StyleWhat It Looks LikeRequirementsBest For
DefaultStandard progress bar with spinning thumbNone (always available)General use, all tracks
WaveformAudio waveform VisualisationSonic analysis dataSeeing the song's audio shape
BarsLoudness-based bar VisualisationSonic analysis dataSeeing loudness variations
SpectrogramPre-generated or live spectrogram imageSonic analysis SVG or live dataDetailed frequency analysis

How Seek Selection Works

The app automatically chooses which seekbar to show based on:

  1. Your Setting: Choose your preferred style in Settings → Appearance
  2. Data Availability: If sonic analysis data isn't available for the current track, the app falls back to the default seekbar
  3. Performance: On lower-powered devices, the app may simplify rendering for smoother performance

Seekbar Features

FeatureDescription
Drag SeekingDrag your finger along the seekbar to jump to any position
Buffered ProgressShows how much of the track has been downloaded (gray bar behind the progress)
Beat ReactivitySeekbar animations react to the music's beat (spinning thumb, glowing strokes, brightening bars)
Magnifier on DragSome seekbar styles show a zoomed-in view while dragging for precision
Ghost PlayheadHover over the seekbar to see where you'd seek without committing

Additional Playback Icons

IconWhat It Shows
Dynamic Skip IconShows skip forward/backward with configurable seconds (e.g., "+10s", "-10s")
Playback Speed IconVisual indicator of current playback speed (1x, 1.25x, 1.5x, etc.) with motion blur at high speeds

What It Does

The app includes 13 specialized modal dialogues for various tasks like managing playlists, configuring settings, and controlling downloads.

ModalWhen It AppearsKey Features
Add to PlaylistYou choose "Add to Playlist" on a songBrowse playlists, create new, load more
Playlist List ItemInside Add to Playlist modalShows playlist artwork and track count
Choose LibraryMultiple libraries availableSelect which music library to browse
Colour PickerCustomising theme coloursCanvas-based colour field, hue slider, hex input
Create PlaylistYou choose "Create New Playlist"Name input, public/private toggle, character counter
Download OptionsYou choose "Download" on an albumSlider to select number of tracks, quality options
FilterYou tap the filter icon on a library pageGenres, years, tags, ratings, favorites
SelectionYou open a multi-select filterSingle/multi-select, infinite scroll, custom values, search
Manage SourcesYou manage server connectionsList servers, select, delete with confirmation
View SortYou tap the sort iconContext-aware sort options, list/grid toggle
Select VisualizerYou choose a visualizer in the playerLists available visualizers, WebGL check
Sleep TimerYou set a sleep timerPresets (15/30/45/60 min), custom minutes, datetime picker
Cast MenuYou tap the cast iconJellyfin sessions, P2P peers, local device

How Modals Work

All modals follow a consistent pattern:

  1. Opening: You tap a button that triggers the modal
  2. Interaction: The modal presents options and captures your selection
  3. Closing: You confirm or cancel, and the modal closes with a smooth two-stage animation (backdrop fade → content slide)
  4. Result: The parent component receives your selection and acts accordingly

Filter Modal Details

The filter modal lets you narrow down your library view:

Filter TypeWhat It Does
GenresSelect one or more genres to show
YearsFilter by release year range
TagsFilter by Jellyfin tags
RatingsFilter by star rating
Favorites OnlyShow only favorited items

Filters work in both online and offline modes, using locally cached filter data when disconnected.


Loading States & Skeletons

What It Does

While data loads from the server or local cache, the app shows placeholder animations so the interface feels responsive and never "stuck."

Skeleton Types

ContextWhat It Shows
ListHorizontal placeholder rows with thumbnail blocks
GridSquare placeholder cards in a grid layout
Detail HeaderLarge placeholder for album/artist header
Detail PageFull page placeholder for detail view
Text BlockLines of placeholder text
Text HeaderBold placeholder text for headers

Skeleton Animations

Animation TypeVisual Effect
ShimmerSweeping light gradient across placeholders
PulseGentle opacity pulsing
Rainbow WaveRainbow gradient sweep (fun, eye-catching)
ScanlineHorizontal scanline effect
StaticNo animation, static gray placeholders
NoneNo skeleton, blank space

Spinner System

The app includes a smart spinner that chooses between the built-in Ionic spinner and a custom canvas-based spinner with 25+ animation types:

Animation CategoryExamples
ClassicRing, Bars, Pulse
Wave-BasedWave, Equalizer, Oscilloscope, Spectrum Circular
Particle-BasedParticles, DNA, Plasma, Constellation, Binary Rain
GeometricHexagon, Kaleidoscope, Radar, Orbit, Tunnel
CreativeLava Lamp, Vinyl, Clock, Fibonacci, Neon Sign, Lightning, Fire, Glitch, Matrix, Vortex, Ripple

The spinner automatically adapts to:

  • Audio Frequency Data: Some spiners react to the music's beat
  • Light/Dark Backgrounds: Automatically adjusts spinner colour for visibility
  • Reduced Motion Preference: Respects your device's "Reduce Motion" accessibility setting

Loading Shell

During app boot, a dedicated loading shell shows:

  • Progress indicator with active task description
  • Rotating tips while loading
  • Haptic feedback heartbeat
  • Force offline mode skip option
  • Retry button
  • "Continue Anyway" button for stalled loads
  • Export diagnostics button for troubleshooting

Layout & Page Structure

What It Does

Shared layout components provide consistent page structure across the entire app.

Component Breakdown

ComponentWhere You See ItWhat It Provides
Page HeaderTop of every pageTitle, back button, network health indicator, sonic analysis indicator, multi-select popover, cast button, export popover, camera cutout compensation
Library LayoutAll library browsing pagesList/grid/carousel rendering of media items, disc headers, pagination, infinite scroll, reordering
Library FABBottom-right of library pagesContext-specific actions (play, shuffle, instant mix, sort, filter, download, scroll to top)
Multi-Select PopoverWhen items are selectedBulk actions (play next, add to queue, add to playlist, delete, refresh)
Alphabet SidebarA-Z library viewsQuick jump to any letter of the alphabet

Page Header Features

The page header automatically shows:

  • Back Button: Returns to the previous page
  • Title: Page name in your selected language
  • Loading Indicator: Spins while data loads
  • Network Health: Green/yellow/red dot showing connection status
  • Sonic Analysis Indicator: Shows when audio analysis data is available
  • Camera Cutout Compensation: Adjusts padding on devices with notches
  • Cast Button: Appears when remote playback targets are available
  • Export Button: Opens popover with diagnostic export options

Library Layout Rendering

The library layout engine automatically chooses the best rendering approach:

FactorDecision
User SettingList mode vs. grid mode
Screen SizeNumber of columns in grid mode
Item CountCarousel for small sets, list/grid for large
Item TypeSpecial rendering for albums, artists, playlists
Download StatusDownload badge, quality indicator
Sonic AnalysisAnalysis badge on analyzed tracks

Text Handling & Marquee

What It Does

Long song titles, album names, and artist names are handled gracefully with automatic scrolling or truncation.

Text Display Modes

ModeBehaviourWhen Used
Overflowing TextSmart delegate to best marquee typeDefault for most text
Sliding TextCSS-based slide animation from right to leftWhen user prefers subtle animation
Simple MarqueeLightweight continuous scrollFor short text that barely overflows
Fast MarqueeFull-featured scroll with fade edgesFor long text that clearly overflows

Marquee Features

FeatureDescription
Pause on HoverHover over text to pause scrolling
Pause on ClickClick to pause, click again to resume
Fade EdgesGradient masks create smooth fade at edges
Resize AwarenessAutomatically adjusts when screen size changes
Content Change DetectionDetects when text changes and restarts animation

Animations & Directives

What They Do

Five custom directives add interactive behaviors to any element they're applied to.

Directive Inventory

DirectiveSelectorWhat It DoesWhere You See It
Count Up[countUp]Animates counting from 0 to a target numberStatistics displays, download counts
Animated Number[animatedNumber]Smoothly transitions between numeric valuesLive device metrics, progress displays
Custom Scrollbar[appCustomScrollbar]Styles scrollbars with app's accent colour, auto-hideAll scrollable content areas
Long Press[long-press]Distinguishes between tap and long-press gesturesMedia items (tap to play, long-press for menu)
Right Click[rightClick]Captures right-click events, prevents default context menuDesktop contexts where right-click menus are useful

Count Up Animation

When a number appears on screen (like a download count or library size), it animates from 0 to the target value using a quadratic ease-out curve (fast start, slow end). The animation completes in 2 seconds by default.

Animated Number

Similar to count-up, but stateful — it remembers the last displayed value and animates from there. Useful for live metrics that change frequently. Emits intermediate values so other components can react to the animation.

Custom Scrollbar

The custom scrollbar automatically:

  • Styles the scrollbar with the app's dominant colour (extracted from album artwork)
  • Shows the scrollbar when you start scrolling
  • Hides the scrollbar after 1 second of inactivity
  • Updates the colour dynamically when the dominant colour changes

Long Press

On touch devices, the long-press gesture distinguishes between:

  • Tap (quick touch, release within 300ms): Triggers the primary action (e.g., play)
  • Long Press (hold for 300ms without moving finger more than 15px): Opens the context menu
  • Drag (move finger more than 15px): No action (prevents accidental triggers)

Formatting Pipes

What They Do

Seven pipes transform raw data into human-readable formats throughout the app.

Pipe Inventory

Pipe NameWhat It FormatsExample Input → Output
truncateShortens long text to a character limit"Very Long Song Name" (limit 15) → "Very Long Song..."
ticksToTimeStringConverts Jellyfin ticks to time string36000000000"10h" or "30m 45s"
bytesConverts bytes to human-readable size1572864"1.5 MB"
imageUrlResolves image URLs with offline fallbackAlbum DTO → "blob:..." or "https://..."
shortNumberFormats large numbers with bit-rate suffixes1500000"1.5Mbit"
safeHtmlSafely renders HTML content"<b>Bold</b>" → rendered as bold text
localMediaBlobLoads bundled media assets as object URLs"assets/sound/click.mp3"SafeUrl

Ticks To Time String

Jellyfin stores time in "ticks" (100-nanosecond units). This pipe converts ticks into a compact, human-readable format:

Ticks ValueOutput
00s
45,000,00045s
1,800,000,00030m
1,845,000,00030m 45s
86,400,000,0001d
93,600,000,0001d 2h

The pipe uses your selected language for unit abbreviations (e.g., "d" for days, "h" for hours).

Image URL Resolution

The imageUrl pipe handles the complex task of resolving album artwork:

  1. Local File: If the item is downloaded, it loads from the local file system
  2. Remote Server: If online, it builds the Jellyfin image URL with appropriate quality settings
  3. Artist Image: Special handling for artist portraits
  4. Fallback: If no image is available, it generates an SVG placeholder with the item's initials

Debug & Diagnostic Tools

What They Do

Seven debug overlay components are available for development and troubleshooting (typically hidden in production builds).

Debug Overlay Inventory

OverlayWhat It MonitorsUpdate Interval
Performance OverlayCPU usage (system and app), disk free spaceEvery 2 seconds
Memory OverlayJavaScript heap, app RAM, system RAMEvery 2 seconds
FPS OverlayCurrent, minimum, and maximum frame rateEvery frame (60fps)
Audio DebugCurrent track, playback status, errors, stream typeReal-time
Consolidated Debug OverlayCombines all above overlays into oneVaries by sub-overlay
Stream Pool DebugAudio stream pool size, crossfading state, individual stream statesEvery 500ms
Server DiscoveryNetwork server discovery UI with progressReal-time during discovery

Server Discovery

The server discovery component helps you find Jellyfin servers on your local network:

  • Manual URL Entry: Type in a server URL and test the connection
  • Auto-Discovery: Scans the local network for Jellyfin servers
  • Progress Indicator: Shows discovery progress
  • Server Type Selection: Choose the type of server (Jellyfin, Emby, etc.)
  • Start/Stop Controls: Start and stop discovery at any time

Performance optimisation

How Components Stay Fast

The shared component system includes several built-in performance optimizations:

TechniqueWhat It DoesImpact
OnPush Change DetectionComponents only re-render when inputs changeDramatically reduces unnecessary checks
Outside NgZoneHeavy animations run outside Angular's change detectionPrevents global re-renders during animations
RAF with FPS CappingrequestAnimationFrame loops cap at specified FPSPrevents GPU overload on complex Visualisations
Throttle/DebounceLimits frequency of user input handlingPrevents excessive seeks and API calls
Destroy NotifierClean unsubscribe from all observables on component destructionPrevents memory leaks
Canvas Over DOMComplex Visualisations use Canvas instead of DOM elementsFaster rendering for seekbars, spinners, visualizers
Standalone ComponentsOnly imported components are bundledSmaller app size, faster initial load

Memory Management

  • Object URLs: Created for local media blobs, cleaned up when components are destroyed
  • RAF Loops: Cancelled on component destruction
  • Gesture Listeners: Disposed when components are removed
  • Subscriptions: Automatically unsubscribed via takeUntil(destroy$) pattern

Technical Specifications

Component Statistics

MetricValue
Total Components69
Total Directives5
Total Pipes7
Standalone Components69 (100%)
Standalone Directives5 (100%)
Standalone Pipes7 (100%)
OnPush Components69 (100%)
Largest ComponentWaveformSeekbarComponent (747 lines)
Smallest ComponentAlphabetSidebarComponent (30 lines)
Average Component Size~180 lines

Seekbar Specifications

Seekbar TypeRendering MethodData RequiredFeatures
DefaultHTML/CSSNoneBeat-reactive thumb, drag seeking
WaveformCanvasSonic analysis data3 rendering styles, magnifier, ghost playhead
BarsCanvasSonic analysis dataLoudness bars, magnifier, ghost playhead
Spectrogram StaticSVGPre-generated SVG URLGradient filters, progress colouring
Spectrogram LiveCanvasLive Visualisation dataTime-lens, particle system, HSL mapping

Spinner Animation Types (25+)

ring, bars, pulse, wave, glitch, particles, dna, plasma, orbit, equalizer, radar, vortex, matrix, hexagon, ripple, spectrum-circular, lava-lamp, tunnel, kaleidoscope, constellation, vinyl, oscilloscope, binary-rain, clock, fibonacci, neon-sign, lightning, fire

Skeleton Animation Types

shimmer, pulse, rainbow-wave, scanline, static, none

Turntable Themes

modern, vintage, dj, audiophile

Turntable Quality Tiers

auto, high, medium, low



Last Updated: 2026-04-06 Version: 2.0.0