Skip to Content
sdeck docs

React on the keys

Draw keys, the window, dials and the sensor strips with React.

import "@sdeck/react"; // registers the renderer
import { openStreamDeck } from "@sdeck/elgato";

const deck = await openStreamDeck();
await deck.mountKey(
  0,
  <div style={{ display: "flex", background: "#c00", color: "#fff" }}>Hi</div>,
);
await deck.mountWindow(<Clock />); // live: state and effects redraw it
await deck.mountSensor(0, <div style={{ background: "#0a0", width: "100%", height: "100%" }} />);
await deck.mountDial(0, <Volume />); // the touch strip above a dial, where there are dials

Elements are laid out by Takumi (flexbox, style, Tailwind via tw, <img src>), drawn to raw RGBA and handed straight to sharp for the JPEG; there is no PNG round trip. Pass fonts in the mount options to use your own; a default font with Latin letters is bundled. On Windows, text in other scripts (Japanese, Korean, Chinese, Cyrillic, Arabic and so on) and emoji fall back to the system's fonts. Elsewhere, pass a font that has them.