Skins

2 min read · Edit this page on GitHub(opens in new tab)
All skins
SkinPackageCharacter
Minimal@tomato-player/skin-minimalClean, light, the default. ~0.6 KB gz.
Cinema@tomato-player/skin-cinemaPremium. Serif title, eyebrow, gold gradient, remaining time.
Studio@tomato-player/skin-studioProfessional. Toolbar below the video, SMPTE timecode, frame step, A-B loop, 0.1×–4×.
Creator@tomato-player/skin-creatorFloating glass pill, two-stop gradient, cast button.
Learn@tomato-player/skin-learnEducation. Speed chips, ±10 s, chapter panel, large readable captions.
Campus@tomato-player/skin-campusPorted from the CampusLoop landing page. Paper sticker strip, "Play the video" pill, sticker captions, tap to unmute, muted autoplay in view, 9:16 on portrait phones.
Stream (unofficial)@tomato-player/skin-streamStreaming-service patterns: big icons, ±10, centered title, next episode.
Tube (unofficial)@tomato-player/skin-tubeVideo-platform patterns: thin expanding progress, theater toggle.
Feed (unofficial)@tomato-player/skin-feedSocial-feed patterns: muted autoplay in view, tap to unmute, compact bar.
Stream, Tube and Feed are unofficial, platform-inspired designs. They contain no logos, fonts or assets of any company and imply no affiliation or endorsement.

Options

Every skin is a factory, and every factory accepts tokens:
ts
cinema({ eyebrow: 'Original', seekStep: 15, tokens: { accent: '#38bdf8' } });
studio({ fps: 24 });
learn({ rates: [1, 1.5, 2], chapterPanel: true });
stream({ subtitle: 'S1:E3', onNext: playNext, onBack: () => history.back() });
tube({ onNext, onTheater: (on) => layout.toggle(on) });
feed({ autoplayInView: true });
campus({ playLabel: 'Watch the launch', theme: 'auto', errorMessage: 'Back soon!' });
creator({ gradient: ['#f97316', '#a855f7'] });

Design tokens

Tokens are CSS custom properties on the player root. Set them in CSS or through the tokens option:
TokenPurpose
--tp-accentProgress, focus ring, active states.
--tp-fg · --tp-muted-fg · --tp-bg · --tp-surfaceColors.
--tp-track · --tp-buffer · --tp-thumbSlider colors.
--tp-radius · --tp-fontShape and type.
--tp-control-size · --tp-icon-size · --tp-gap · --tp-slider-heightDensity.
--tp-duration · --tp-easeMotion. Zeroed automatically under prefers-reduced-motion.
css
/* One extra class beats the injected skin stylesheet, whatever the load order. */
.my-app .tp[data-skin='minimal'] { --tp-accent: hotpink; --tp-radius: 0; }
The tokens option is written inline on the player root, so it beats any stylesheet rule. Use it for tokens a skin sets in its own tokens field, such as every official skin's accent except Minimal's. The custom skins guide has the full token table and precedence rules.

State hooks for CSS

data-paused, data-playing, data-started, data-ended, data-waiting, data-seeking, data-fullscreen, data-pip, data-idle, data-live, data-muted, data-captions, data-error, data-menu-open, data-muted-autoplay, and data-size="sm|md|lg". The root is also a size container (container-type: inline-size), so @container queries work inside skins.

Strict CSP

ts
import '@tomato-player/ui/base.css';
import '@tomato-player/skin-cinema/style.css';
createPlayer(el, { skin: cinema(), injectStyles: false });

Switching at runtime

ts
player.setSkin(tube());
player.setSkin(null); // headless: bring your own UI

Build your own

To override a skin's layout or write a new skin, read Custom skins: the complete guide.
PreviousMigration
NextPlugins