Skip to content

Button

widgetsinput

Button: a pressable button with a label and visual variants

Installation

$ bunx termuijs add button

Copies the source into src/components/button/ and installs @termuijs/core, @termuijs/motion, @termuijs/widgets.

Usage

ts
import { Button } from '@termuijs/widgets'
ts
new Button(label: string, style: Partial<Style> = {}, opts: ButtonOptions = {})

API Reference

Button

PropTypeRequiredDescription
labelstringrequired
variantButtonVariantoptional
disabledbooleanoptional
onPress() => voidoptional
colorColoroptional
loadingbooleanoptionalShow a loading spinner and suppress activation while true (default: false)
loadingTextstringoptionalLabel to display while loading (e.g
#input#button