Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/tui/src/components/mod.ts>Button

🦕 Deno module for creating Terminal User Interfaces
Go to Latest
class Button
extends Box
Re-export
import { Button } from "https://deno.land/x/tui@2.0.0/src/components/mod.ts";

Component for creating interactive button

Examples

Example 1

new Button({
 parent: tui,
 label: { text: "click\nme" },
 theme: {
   base: crayon.bgGreen,
   focused: crayon.bgLightGreen,
   active: crayon.bgYellow,
 },
 rectangle: {
   column: 1,
   row: 1,
   height: 5,
   width: 10,
 },
 zIndex: 0,
});

Constructors

new
Button(options: ButtonOptions)

Properties

drawnObjects: { box: BoxObject; }
label: { text: Signal<string>; align: Signal<LabelAlign>; }
subComponents: { label?: Label; }

Methods

draw(): void
interact(method: "mouse" | "keyboard"): void