Web Components
Every web component in the Stolon bundle has one page here. A page says what the component is for, when to use it and when not to, the markup or call that puts it on a page, and its gotchas. Each page ends with a live example and the code behind it.
Each page also holds a Reference generated from the TypeScript in src/js and the header comments in src/css, with every export, option, handle member, and class. The same TypeScript builds the typings that ship in the package, so an editor shows the same options as the page.
For the C# helpers, see C# Components.
How the Bundle Is Built
- CSS lives under
src/css, one file per component. The components are TypeScript modules under src/js, all re-exported from src/js/index.ts. The one template, status.html, lives in src/templates.
scripts/bundle.sh writes the two shipped assets into dist/, which git ignores. dist/stolon.css holds design-tokens.css first and then every other CSS file in alphabetical order, minified for Chrome 58, Safari 11, and Firefox 57. File order never matters, because every component targets its own selectors and custom properties resolve in any order. dist/stolon.js is src/js/index.ts with its types stripped, bundled and minified for Chromium 87 as one ES module with the exported names kept. dist/stolon.d.ts holds its typings.
- The gallery renders every component from the real
dist/ bundle with a stubbed ApiClient, Dashboard, and user list. The live examples on these pages use the same stubs.
- The package build packs the bundles and the typings as
assets/ and src/templates/*.html as templates/.
How a Plugin Loads the Bundle
- The package targets file embeds the assets into the plugin as
<RootNamespace>.Configuration.stolon.css and .js, and each template as <RootNamespace>.Templates.<name>.html. The plugin stays one DLL.
- The plugin class extends
PluginBase and yields GetSharedPages("myplugin") from GetPages(). That serves the assets as myplugin_stolon.css and myplugin_stolon.js through Jellyfin's configurationpage?name= route. Use your own prefix. See Using Stolon.
- A config page links the stylesheet and imports the module by a relative path, never
/web/..., so a server hosted under a base URL still works. The page element needs the pluginConfigurationPage class, because the form rules and the token aliases are scoped to it.
<div id="MyPluginPage" data-role="page" class="page type-interior pluginConfigurationPage withTabs"
data-require="emby-input,emby-button,emby-select,emby-checkbox"
data-controller="__plugin/myplugin_settings.js">
<div data-role="content">
<div class="content-primary">
<div id="MyPluginContent"></div>
</div>
</div>
<link rel="stylesheet" href="configurationpage?name=myplugin_stolon.css">
</div>
// myplugin_settings.js, the page controller
import { createConfigPage, createPaginatedTable, openDialog, confirmDialog }
from './configurationpage?name=myplugin_stolon.js';
export default function (view) {
createConfigPage(view, {
pluginId: '00000000-0000-0000-0000-000000000000',
apiPrefix: 'MyPlugin',
bind: function (shared, page) { /* wire events once */ },
load: function (shared, page) { /* load data on every viewshow */ }
});
}
A plugin may also wrap the bundle in its own module that imports the builders it needs, re-exports them, and adds its own helpers on top of createShared.
On a page built with createConfigPage, every field that carries a rule in its attributes is validated with no call, and number, date, time, and search fields get their adornments. See Config Page and Field Message.
In the examples on these pages, view is the page element and shared is the helper bag from createShared or createConfigPage. See Config Page and Shared Bag.
How Components Build on Each Other
Several components are built from a smaller one and inherit its look and behavior, such as the height, the empty state, and the focus handling. Each page still lists the options its own builder takes.
| Stolon |
Built on it |
| List |
The frame, height, scrolling, and empty and loading states of every list and table below |
| Filtered List |
Adds search, filters, sort, a summary line, and selection to the List. Data Table, Paginated Table, and Checkbox List are built on it |
| Checkbox List |
User Multi Selector |
| Checkbox |
The box of every Stolon checkbox: the Repeater's and Matrix Grid's toggle fields, the Filtered List's row checks and select all, the Filter Panel, the Tree View, the Inherit Field, and the Log Viewer |
| Repeater |
Key Value Editor and Rule Builder |
| Dialog |
Confirm Dialog, Prompt Dialog, Editor Dialog, Bound Dialog, and Detail Drawer |
| Field Message |
The error line and the validation of every Stolon field and editor |
| Field Adornments |
The arrows and picker icons of the Number Unit Field, Color Picker, Duration Field, Time Range Field, and Date Range Picker |
Naming Rules
- Everything custom uses the
stolon- prefix. CSS classes are kebab case. A component is stolon-name, a part is stolon-name-part, and a state or variant is a modifier that also starts with stolon-, such as stolon-selected, stolon-collapsed, stolon-active, stolon-dragging, stolon-disabled, stolon-hidden, or a color name such as stolon-green.
- CSS variables are
--stolon-name. JS exports are camelCase. C# types are PascalCase.
- The only unprefixed classes are Jellyfin's own, which the kit restyles, such as
sectionTitle, sectionTitleContainer, fieldDescription, material-icons, inputContainer, checkboxContainer, selectContainer, and emby-*, and the classes a plugin passes in, such as className, which stay as given.
- Where Jellyfin supplies the element (
emby-button, emby-input, emby-select, emby-checkbox), the kit adds stolon- classes beside the emby ones, as in class="raised stolon-button stolon-primary".
Jellyfin Palette Variables
Stolon reads three variables that the Jellyfin web client sets from the active theme. Each token that reads one falls back to the dark theme value when the variable is missing.
--jf-palette-primary-main gives --stolon-accent, with the fallback #00a4dc.
--jf-palette-background-paper gives --stolon-surface, with the fallback #181818.
--jf-palette-text-primary gives --stolon-fg, with the fallback #fff.
Lines and washes are shares of the text color, so a light theme gets dark ones and a dark theme gets light ones. See Design Tokens.
Older Engines
The CSS is written to survive the desktop app's Qt WebEngine and older TV webviews. A theme derived color is written twice, a plain rgba() first and then a color-mix() upgrade. A color mixed from a variable sits in an @supports (color: color-mix(...)) block after a plain rule. The form rules list .pluginConfigurationPage and .stolon-dialog as plain selectors, never with :is(), and a :has() rule never shares a selector list with anything an older engine needs. The visible result on such an engine is the dark theme look.
Component Index
Foundations
| Component |
What it is |
| Design Tokens |
The colors, spacings, sizes, radii, and color helpers every component reads |
Page Lifecycle and Helpers
| Component |
What it is |
| Config Page |
Wires the lifecycle of a plugin settings page |
| Tabs |
Sets the dashboard tab bar for a page |
| Poller |
A repeating call that stops when the page hides |
| Change Tracker |
Tracks unsaved edits and drives the unsaved guard |
| Task Progress Button |
Shows a Jellyfin scheduled task running inside a button |
| Shared Bag |
The per view helper object |
| Browser Helpers |
Escaping, plurals, debounce, GUIDs, and JSON files |
| Translations |
The plugin's strings in the viewer's language, and marked markup translated |
| Web Push |
Notifications on this device, from asking to subscribing |
| Utility Classes |
Hidden, mono, ok and bad text, and screen reader text |
Layout and Sections
| Component |
What it is |
| Section Title |
Page heading with a full width rule |
| Section |
An always open titled block |
| Panel |
A bordered sub card with an optional header |
| Subsection Title |
Small uppercase group heading |
| Collapsible Section |
A header that folds a body, with an icon, subtitle, and aside, or a fixed panel |
| Indent |
A left ruled group under a toggle |
| Reset Group |
Rows that pair a description with an action |
| Sub Tabs |
An in page tab list with panels |
| Tool Shell |
A sidebar of tools beside the current tool, or a title menu of tools when narrow |
| Breadcrumbs |
A trail of places |
| Stepper |
Numbered steps for a flow |
| Setup Checklist |
Numbered setup steps with state badges and a progress bar |
Selection
| Component |
What it is |
| Chip Select |
A typeahead picker with removable chips |
| Media Picker |
A library search that picks items with artwork |
| Tags |
Removable chips that wrap |
| Combo Box |
A text input with a results dropdown |
| Checkbox |
One checkbox in Stolon's look with its text beside it |
| Checkbox List |
A searchable list of checkbox rows |
| Filter Panel |
A Filter button with a count that opens groups of filter choices |
| User Selector |
A single user dropdown |
| User Multi Selector |
A checkbox list of users |
| Choice Group |
Radio cards with a sentence each, in balanced rows |
| Field Adornments |
Arrows on a number, a picker icon on a date or time, a search icon, and a reveal eye |
Lists and Tables
| Component |
What it is |
| Paginated Table |
A searchable, filterable table that pages through rows, with thumbnails from an address or a loader |
| Record List |
Rows of a title, a secondary line, and tags that open |
| Tree View |
Nested rows that open, load lazily, and check |
| Compare Table |
Values side by side with the changed rows marked, in sections with notes |
| Matrix Grid |
Row labels by columns with a control, a unit, or a read-only badge in each cell |
| Filtered List |
A List with search, filters as selects, pills, or count cards, a sort, and a summary line |
| Data Table |
A sortable, filterable table of local or server rows, with a selectable row |
| World Map |
Countries shaded by counts, with layer toggles and a selection a table can follow |
| Sortable Card List |
Ordered record cards with an editor |
| Ordered List |
Rows with up and down buttons |
| Record Card |
Label and value rows for one record |
| Balanced Rows |
Tiles that wrap in even rows, never one alone |
| List |
Any items in rows, a grid, or plain, at a fixed, filling, or growing height |
| Media Card |
One media item with its artwork, as a row or a tile |
| Asset List |
Rows of uploaded files |
| Static Table |
A plain bordered table |
| Bulk Edit Bar and Edit Row |
Inline editing blocks |
| Pagination |
A footer for a list read a page at a time |
Feedback and Status
| Component |
What it is |
| Badge |
A colored status pill |
| Count Cards |
A row of large counts over labels |
| Status Card |
An icon, a status pill, a title, and a detail line, in balanced rows |
| Callout |
A soft inline notice |
| Status Text |
A status line with the icon of its state |
| Save Bar |
A Save button with a line above it for unsaved, saving, saved, and failed |
| Unsaved Indicator |
A fading dirty flag |
| Empty State |
Placeholders for empty regions |
| Status Page |
A standalone themed card page |
| User Page |
A whole page a plugin hosts for regular users, with its cards, fields, steps, and finished state |
| Toast |
Stacked transient messages |
| Banner |
A callout with a Dismiss button |
| Status Dot |
A round status color with a name |
Dialogs and Menus
| Component |
What it is |
| Detail Drawer |
A panel from the right edge with the details of a row |
| Dialog |
A modal with a title, a body, and buttons |
| Confirm Dialog |
A yes or no question that resolves to a boolean |
| Prompt Dialog |
A small form that resolves to a map of values |
| Editor Dialog |
The record editor a config page builds |
| Bound Dialog |
Behavior for a dialog already in the page |
| Overflow Menu |
A button that opens a menu of actions |
| Tooltip |
A hover and focus bubble for any element |
| Help Hint |
A help icon with a bubble |
Editors
Data Display
| Component |
What it is |
| Bar Chart |
Grouped bars of a few amounts |
| Line Chart |
A value over time |
| Pie Chart |
Shares of a whole as a pie or donut, with a legend of values and percents |
| Sparkline |
A small line beside a number |
| Usage Meter |
Used out of a total, with warning colors and parts |
| Relative Time |
A live "3 minutes ago" or a countdown |
| Avatar Stack |
Overlapping avatars with a +N count |
| QR Code |
A link as a QR code, with "Copy image" and "Download" |
| Audio Player |
Play, seek, and time, one player at a time |
| Preview Frame |
An image rendered on demand, with backgrounds and zoom |
| Notify Preview |
A notification as Discord, a webhook, Jellyfin, or a browser shows it |
| Definition List |
Read only label and value pairs, in rows or columns |
| Log Viewer |
Scrolling mono output with a toolbar |
| Avatar and User Chip |
A round picture or the person icon, and a pill |
| Timeline |
A vertical list of events |
| Flow Diagram |
A hub with lanes of pills joined by arrows |
| Divider |
A rule with an optional label |
Loading