Skip to main content
Module

x/tui/mod.ts>Component

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

Base Component that should be used as base for creating other components

Constructors

new
Component(options: ComponentOptions)

Type Parameters

optional
EventMap extends EventRecord = Record<never, never>

Properties

rectangle: Rectangle | undefined

Returns component's rectangle

Returns current component state

readonly
style: Style

Returns current component style

theme: Theme
tui: Tui
view: ViewComponent<EventRecord> | undefined

Returns view that's currently associated with component

zIndex: number

Methods

draw(): void

Function that's used for rendering component It's called on tui update event

interact(_method?: "keyboard" | "mouse"): void

Function that's used for interacting with a component It's called by keyboard and mouse control handlers

remove(): void

Remove component from tui and dispatch removeComponent event