Core widgets
TermButton
The TermButton widget is a very light extension of the TermText widget with some extra configuration more suited for buttons.
import {TermButtonclass TermButton
, runfunction run(cb: (screen: TermScreen) => void | undefined): Promise<number> (+1 overload)
Create a new TermScreen and run the provided callback. Return a promise that resolves when the screen is closed.} from 'terminosaurus';
runfunction run(cb: (screen: TermScreen) => void | undefined): Promise<number> (+1 overload)
Create a new TermScreen and run the provided callback. Return a promise that resolves when the screen is closed.(screenscreen: TermScreen
=> {
const textconst text: TermButton
= new TermButtonnew TermButton(): TermButton
();
textconst text: TermButton
.appendToTermNode<TermElement>.appendTo(node: TermElement): void
(screenscreen: TermScreen
.rootNodeTermScreen.rootNode: TermElement
);
textconst text: TermButton
.setDecoratedTermElement.setDecorated(value: boolean): void
(true);
textconst text: TermButton
.setTextTermText.setText(content: string): void
(`Hello world`);
});
Props
decorated
If set, the button will be underlined when the mouse goes over it.
submit
If set, clicking the button will submit the outer form.