The Phosphor.Widgets atom library: the spectrum primitives every shell surface is drawn with, plus a few interactive atoms. Pure QML, themed entirely through `phosphor-theme`'s Theme / Tokens / Motion / Spectrum singletons, so a palette or motion retune propagates to every widget with no per-widget edit. The design they implement is docs/phosphor-shell-design/05-visual-identity.md.
Provide the primitives the identity is made of (the rail, the stroke, the underline, the tabular value, the placement miniature, the settle spring, the decoration slot) and a small set of interactive atoms (button, slider, text field, card). Higher-level surfaces (the bar, launcher, control center, OSDs, toasts) assemble these rather than re-rolling styling per surface.
The library owns presentation only. It holds no business logic and no service bindings. A host wires an atom's clicked / moved signal to whatever controller drives it.
| Component | Role |
|---|---|
| SpectrumRail | The 2 px gradient rail on a screen edge, sampling the spectrum by position; gleam runs the idle sweep, sliceStart/sliceEnd show a scrolling strip's lens. |
| SpectrumStroke | The 1 px inset stroke that gives chrome its edge: rest opacity, full when active, white when focused; hue from t. |
| SpectrumUnderline | A 2 px underline whose length is a value and whose hue is the state axis; tick() flashes it. |
| TabularText | A value in the mono face with tabular figures; tickOnChange underlines a changed digit. |
| PlacementMiniature | A screen's placement map (zones, tiles or strip columns) as a miniature; MiniatureEdges.js morphs matched edges between modes. |
| SettleAnimation | The positional spring (shell.settle) for a Behavior; retargets from the current velocity. |
| DecorationSlot | Where a surface pack lands on chrome: names the frame item and the surface path, instantiates the host's decoration Component. |
| PhosphorButton | Button in four variants (Filled, Tonal, Outlined, Text). |
| PhosphorSlider | Continuous horizontal slider; the knob settles on the spring. Emits moved. |
| PhosphorTextField | Outlined single-line input with a placeholder; focus lights the stroke. |
| PhosphorCard | Rounded surface container with a stroke for depth; children land in a padded content area. |
| PhosphorRipple | Shared interaction layer: hover / press tint and the press ripple. |
import Phosphor.Widgets
PhosphorCard {
elevation: 2
ColumnLayout {
PhosphorTextField { placeholderText: i18n("Name") }
PhosphorSlider { from: 0; to: 100; value: 40; onMoved: (v) => model.level = v }
PhosphorButton {
text: i18n("Apply")
variant: PhosphorButton.Filled
onClicked: controller.apply()
}
}
}Set enabled: false on any atom for its disabled state. The container and content then drop to the disabled opacities (StateLayer.disabled_container / StateLayer.disabled_content).
The spectrum primitives and the atoms ship with the identity (phases 1 to 5 of docs/phosphor-shell-design/04-implementation-plan.md). The first design's connected-corner geometry, ElevationShadow and PhosphorPill were retired in phase 6.