Audio Queue
Queue management components with browse, search, reorder, and control playback order.
A set of composable components for managing the audio queue. Includes a browseable queue dialog, shuffle, repeat mode, and an advanced preferences panel.
Installation
Install @lucide/svelte :
Copy and paste the following code into your project.
Usage
Import the components:
<script lang="ts">
import * as AudioQueue from "$lib/components/ui/audio/queue/index.js";
</script> Basic Queue
The AudioQueue component opens a dialog showing the current queue with search functionality and track selection.
<AudioPlayer.Root>
<AudioPlayer.ControlBar>
<AudioQueue.Root />
</AudioPlayer.ControlBar>
</AudioPlayer.Root> Queue with Shuffle and Repeat
Use this when you want quick access to shuffle and repeat controls. The toggle buttons provide fast switching between modes.
Loading...
<script lang="ts">
import * as AudioPlayer from "$lib/components/ui/audio/player/index.js";
import * as AudioQueue from "$lib/components/ui/audio/queue/index.js";
</script>
<AudioPlayer.Root class="w-max">
<AudioPlayer.ControlBar>
<AudioQueue.Shuffle />
<AudioQueue.RepeatMode />
<AudioQueue.Root />
</AudioPlayer.ControlBar>
</AudioPlayer.Root> Queue with Preferences
Use this when you want a compact interface with all queue settings in a dropdown menu. Ideal for space-constrained layouts.
Loading...
<script lang="ts">
import * as AudioPlayer from "$lib/components/ui/audio/player/index.js";
import * as AudioQueue from "$lib/components/ui/audio/queue/index.js";
</script>
<AudioPlayer.Root class="w-max">
<AudioPlayer.ControlBar>
<AudioQueue.Preferences />
<AudioQueue.Root />
</AudioPlayer.ControlBar>
</AudioPlayer.Root> Queue with All Controls
Use this when you want a compact interface with all queue settings in a dropdown menu. Ideal for space-constrained layouts.
Loading...
<script lang="ts">
import * as AudioPlayer from "$lib/components/ui/audio/player/index.js";
import * as AudioQueue from "$lib/components/ui/audio/queue/index.js";
</script>
<AudioPlayer.Root class="w-max">
<AudioPlayer.ControlBar>
<AudioQueue.Shuffle />
<AudioQueue.RepeatMode />
<AudioQueue.Preferences />
<AudioQueue.Root />
</AudioPlayer.ControlBar>
</AudioPlayer.Root> API Reference
AudioQueue
An icon button that opens a dialog showing the current queue. Supports live search by title or artist, drag-to-reorder tracks (disabled when filtering), per-track remove, and a clear-all button.
Props
Behavior
- Opens a modal dialog with a full-height track list
- Search filters by
titleandartist(case-insensitive) - When not filtering, the list is drag-to-reorder enabled
- Clicking a track plays it immediately; clicking the current track toggles play/pause
- Remove button appears on non-current tracks
- Clear button removes all tracks from the queue and closes the dialog
AudioQueueShuffle
A toggle button that enables or disables shuffle mode. Highlights when active.
Props
Accepts any additional HTML button attributes via ...rest.
Behavior
- When shuffle is enabled:
audioStore.shuffle()randomizes the remaining tracks - When shuffle is disabled:
audioStore.unshuffle()restores original order - Uses
role="switch"andaria-checkedfor accessibility
AudioQueueRepeatMode
A toggle button that cycles through three repeat modes: none → all → one.
Props
Accepts any additional HTML button attributes via ...rest.
Behavior
Cycles on click via audioStore.changeRepeatMode(). Uses role="switch" for accessibility.
AudioQueuePreferences
An icon button that opens a dropdown with advanced queue settings: Repeat Mode and Insert Mode.
Props
Repeat Mode options
Insert Mode options
Controls where newly added tracks are inserted into the queue:
Related
- Audio Player — player controls to use alongside queue components
- Audio Provider — required wrapper that manages queue state