Skip to content

Code

widgetsdisplay

Code component

Installation

$ bunx termuijs add code

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

Usage

ts
import { Code } from '@termuijs/widgets'
ts
new Code(code: string, style: Partial<Style> = {}, opts: CodeOptions = {})

API Reference

Code

PropTypeRequiredDescription
codestringrequired
languagestringoptional
showLineNumbersbooleanoptional
#display#code