Retro TV
A 1980s tube TV in perspective, as a dashboard widget: any children render on its screen in green, amber or white phosphor, behind curved glass with scanlines, a vignette, a flickering glare and glow, in a wood cabinet with knobs, a speaker grille, an LED and a power button (UI SDK's toggle). Switching off collapses the picture to a line, then to a dot that fades; TvPowerOff plays it over the whole page, for logging out.
Example
Installation
Usage
Reach for it where a dashboard has room for character: a status wall, an office screen, a landing page. Put stat cards, charts or text inside; the screen turns the theme's colours into phosphor. TvPowerOff plays the switch-off over the whole page, for logging out.
API reference
RetroTv
| Prop | Type | Default |
|---|---|---|
labelrequiredThe accessible name of the set, as a group. | string | – |
childrenWhat the screen shows, in phosphor: text, stat cards, charts. It fills a 4:3 box sized by `--retro-tv-screen-width` and `--retro-tv-screen-height`. | ReactNode | – |
powerWhether the set is on. Pass it to control the set. | boolean | – |
defaultPowerWhether the set starts on, when uncontrolled. `true` by default. | boolean | true |
onPowerChangeRuns when the power button or an agent switches the set, with UI SDK's toggle details; `details.cancel()` keeps it as it is. | (power: boolean, details: RetroTvPowerChangeDetails) => void | – |
phosphorThe colour of the phosphor: `green` by default, `amber` or `white`. | "green" | "amber" | "white" | "green" |
perspectiveTurns the set a little in 3D; `false` shows it straight on. `true` by default. | boolean | true |
disabled | boolean | false |
labels | Partial<RetroTvLabels> | – |
classNameClasses for the root; a function gets the set's state. | string | ((state: RetroTvState) => string | undefined) | – |
TvPowerOff
| Prop | Type | Default |
|---|---|---|
playingrequiredPlays the transition over the whole page while `true`, and keeps the screen black once it ends. | boolean | – |
phosphorThe colour of the last line and dot: `white` by default. | RetroTvPhosphor | "white" |
className | string | – |
Other exports
retroTvLabelsretroTvuseTvPowerOfftype RetroTvLabelstype RetroTvPhosphortype RetroTvPowerChangeDetailstype RetroTvPropstype RetroTvStatetype RetroTvOptionstype RetroTvSwitchtype TvPowerOffControlstype TvPowerOffOptionstype TvPowerOffPropsAccessibility
- The power button is a toggle named Power (labels.power), pressed while the set is on, with a white focus ring on the wood.
- Phosphor text keeps 4.5:1 on the screen under the scanlines, in green, amber and white.
- While the set is off its screen is inert, so screen readers and agents skip what isn't shown.
- Under reduced motion the picture fades instead of collapsing, and the glare stops flickering.
Agent actions
Agents find the set by its label and call powerOn or powerOff, or press the Power toggle; an app that cancels the change in onPowerChange fails the step with why.
Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.