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>ComboBox

🦕 Deno module for creating Terminal User Interfaces
Latest
class ComboBox
extends Button
import { ComboBox } from "https://deno.land/x/tui@2.1.11/src/components/mod.ts";

Component for creating interactive combobox

Examples

Example 1

new ComboBox({
 parent: tui,
 items: ["one", "two", "three", "four"],
 placeholder: "choose number",
 theme: {
   base: crayon.bgGreen,
   focused: crayon.bgLightGreen,
   active: crayon.bgYellow,
 },
 rectangle: {
   column: 1,
   row: 1,
   height: 1,
   width: 14,
 },
 zIndex: 0,
});

Constructors

new
ComboBox(options: ComboBoxOptions<Items>)

Type Parameters

optional
Items extends string[] = string[]

Properties

expanded: Signal<boolean>
items: Signal<Items>
placeholder: Signal<string>
selectedItem: Signal<number | undefined>
subComponents: { [button: number]: Button; }

Methods

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