@sigx/runtime-terminal
v0.1.5
Published
Terminal renderer for SignalX
Downloads
611
Readme
@sigx/runtime-terminal
Terminal UI components for the Sigx runtime (demo/experimental).
Components
Button- a focusable, clickable control.Input- a focusable text input with two-waysyncbinding viavalue.ProgressBar- a read-only progress indicator.Checkbox- a focusable checkbox with two-waysyncbinding viavalue.
Checkbox Usage
The Checkbox component uses two-way sync binding. That means you can write:
/** @jsxImportSource @sigx/terminal */
import { signal, renderTerminal, Checkbox } from '@sigx/terminal';
const state = signal({ enabled: true });
renderTerminal(
<Checkbox sync={() => state.enabled} label="Enabled" />,
{ clearConsole: true }
);When the user presses Space or Enter while the Checkbox is focused, it will emit update:value and change events in addition to toggling the visual state.
Props:
value(sync) - boolean - current value (two-way binding viasync).label- string - optional label to display.autofocus- boolean - focus on mount.disabled- boolean - disable interaction.
Events:
update:value- emitted when the value changes (used bysync).change- emitted with the new value when toggled.
