shadcn.io is not affiliated with official shadcn/ui
Distribution Settings Music Block for Svelte
A release's distribution settings: six streaming services with switches, a release date checked against a seven-day lead, a pricing model, region checkboxes with a country exclude field, a reach sentence, and a save bar that counts unsaved changes.
Installation
Overview
Let an artist choose where a release goes and when, with this distribution settings panel for Svelte with Ark UI. Wavelane, a music distributor, opens it on one release with the settings already saved. A band of six Switches names the services in text with a two-letter tile (Spotify, Apple Music, Amazon Music, YouTube Music, Tidal and Deezer), each saying it isn't connected in this demo. A release date Input comes with a rule worked out against the page's date: at least 7 days ahead is "Early enough for editorial pitching" and anything nearer says how late it is. Pricing is three native radio cards (Standard, Premium, Free with ads). Territories are six region checkboxes plus Worldwide, with an Exclude Tags Input that accepts country names, and a sentence that counts the result ("Reaches 5 of 6 services in 121 territories"). The last band counts unsaved changes beside a Shine Button to save and an outline Button to discard. It's built from Switch, Input, Tags Input, Field and Guides with a CSS entrance only. For music distributors, label tools and any release-time settings.
FAQ
How do I change the services, regions and prices?
Edit SERVICES (id, name, two-letter mark), REGIONS (id, name and how many territories each holds), TERRITORIES (the countries the Exclude field accepts, each with its region) and PRICINGS. SAVED is what the release has stored when the page opens. The reach sentence adds the territories of the regions that are on and takes off the excluded countries whose region is on, so nothing is typed twice.
What does Save do, and what stays local?
Nothing leaves the page. The block keeps the saved settings and the edited ones, counts how many differ and shows "3 changes not saved yet." Save refuses with a reason and moves focus when there is no service on, no territory chosen or the date has passed, and otherwise keeps the edit as saved and says so in the demo; Discard puts the saved copy back. Both stay in place and focusable while nothing changed. To make it real, send the edited copy in the save handler and show a failure in the same status line.
How is the release date checked?
The rule compares the chosen day with the page's fixed date (AS_OF) using whole UTC days, never the clock. Seven days or more ahead reads as early enough, fewer says how many days remain and that 7 are needed, and a day that has passed asks for a later one. The line has two lines of room so the form never shifts.
How do Worldwide and Exclude work?
Worldwide is ticked while all six regions are on, and ticking it turns all of them on or off. Exclude takes country names from a short list, matches them without regard to case, refuses duplicates and unknown names with a hint, and shows each as a removable tag. An excluded country only leaves the count while its region is on.