vemu.

component

VemuConsole

The whole vemu embed in one component: boots `firmware` on `board` and renders a terminal bound to its UART. No board picker, no file loader, no controls - point it at a board id and a firmware URL.

function VemuConsole(props: VemuConsoleProps): JSX.Element

Props

NameTypeDescription
boardstringRegistered board id, e.g. `"nordic,nrf5340-dk-cpuapp"` (see `vemu boards`).
firmwarestring | Uint8ArrayFirmware to boot: a URL to fetch once, or raw bytes already in hand.
kindoptionalProgramKindProgram format. Inferred from the URL extension (`.hex`/`.elf`/`.axf`/`.bin`) when `firmware` is a string; required when `firmware` is `Uint8Array`.
colsoptionalnumberFixed terminal column count (see VemuTerminalProps.cols).
rowsoptionalnumberFixed terminal row count.
autoBootoptionalbooleanBoot automatically once the wasm runtime is ready. Default `true`.
autoFocusoptionalbooleanSteal focus once mounted. Default `false` - unlike the bare `VemuTerminal`, `VemuConsole` is meant for embeds (e.g. a marketing page) where the visitor opts into interaction by clicking.
onStatusoptional(status: VemuStatus) => voidCalled whenever the emulator lifecycle status changes, including `"error"` on a firmware fetch or build failure.
classNameoptionalstringExtra class names applied to the terminal's container div.
fontFamilyoptionalstringTerminal font family. Defaults to a generic monospace stack.
fontSizeoptionalnumberTerminal font size in px. Ignored (and computed instead) when `cols` is set.
themeoptionalIThemexterm.js theme override.
captureKeysoptionalCaptureKeysModeKeyboard capture policy forwarded to useVemu. Default `"focus"`: guest key events are only captured while the console has focus, so an embedded console never swallows keystrokes typed elsewhere on the page.
loadModuleoptional() => Promise<VemuLoader>Optional wasm-loader override forwarded to useVemu (`options.loadModule`) - stub/test mode.

Examples

<VemuConsole
  board="nordic,nrf5340-dk-cpuapp"
  firmware="/firmware/introduction.hex"
  cols={80} rows={24}
/>