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.ElementProps
| Name | Type | Description |
|---|---|---|
board | string | Registered board id, e.g. `"nordic,nrf5340-dk-cpuapp"` (see `vemu boards`). |
firmware | string | Uint8Array | Firmware to boot: a URL to fetch once, or raw bytes already in hand. |
kindoptional | ProgramKind | Program format. Inferred from the URL extension (`.hex`/`.elf`/`.axf`/`.bin`) when `firmware` is a string; required when `firmware` is `Uint8Array`. |
colsoptional | number | Fixed terminal column count (see VemuTerminalProps.cols). |
rowsoptional | number | Fixed terminal row count. |
autoBootoptional | boolean | Boot automatically once the wasm runtime is ready. Default `true`. |
autoFocusoptional | boolean | Steal 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) => void | Called whenever the emulator lifecycle status changes, including `"error"` on a firmware fetch or build failure. |
classNameoptional | string | Extra class names applied to the terminal's container div. |
fontFamilyoptional | string | Terminal font family. Defaults to a generic monospace stack. |
fontSizeoptional | number | Terminal font size in px. Ignored (and computed instead) when `cols` is set. |
themeoptional | ITheme | xterm.js theme override. |
captureKeysoptional | CaptureKeysMode | Keyboard 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}
/>