The Element SDK is in beta and not yet publicly released — APIs may change without notice.
Add buttons and toggles to the board toolbar from environment and hybrid elements
Environment and hybrid elements can integrate with the board toolbar — the strip that appears at the top of the board containing playback controls, scene navigation, and the fullscreen toggle. Your element contributes buttons, toggles, and separators declaratively by implementing the toolbar field on your definition.
The function receives:
api — board-level capabilities (fullscreen state and control)props — your element's resolved schema propsIt returns an array of ToolbarContribution objects, which the nearest ToolbarHost renders alongside the built-in controls. The function is called on every render, so you can derive button states and disabled conditions from props directly.
The toolbar function is called with the render props but outside the component lifecycle — it cannot use hooks. Read state from a ref or closure rather than useState.
Provides access to board-level fullscreen controls:
Use api.isFullscreen to show or hide controls that only make sense in one mode, and requestFullscreen / exitFullscreen to drive fullscreen from inside the toolbar:
A clickable action button.
id (string; required) — Stable identifier. Must be unique within your contributions.icon (string or ReactElement; optional) — A built-in icon name ('play', 'copy', 'check', etc.) or a custom ReactElement.label (string; optional) — Tooltip or visible label text.onClick (function; required) — Callback fired when clicked.disabled (boolean; optional) — Greys out the button and blocks clicks.A two-state button that shows an active/inactive state.
id (string; required) — Stable identifier.icon (string or ReactElement; optional) — Built-in icon name or ReactElement.label (string; optional) — Tooltip or visible label text.active (boolean; required) — Whether the toggle is currently on.onToggle (function; required) — Callback fired when the toggle is clicked.disabled (boolean; optional) — Prevents interaction.A visual divider between groups of controls.
An escape hatch that renders arbitrary content into a toolbar slot. Use sparingly — prefer button and toggle for standard controls.
These icon names are available for the icon field on buttons and toggles:
play pause restart loop next prev fullscreen exit-fullscreen copy check
Pass any ReactElement for icons outside this set:
An environment element that controls a step-through simulation: