microfugue
TypeScript icon, indicating that this package has built-in type declarations

0.14.0 • Public • Published

microfugue

a small library for creating UX elements in ansi-compatible terminals, using antsy.

  • EditBox: a text editor which supports most basic unix line-editing control codes, and hooks for syntax highlighting and validation. it can be used as a multi-line editor where "enter" inserts new lines, or as a "readline" style command editor, where "enter" commits a line to the command history, and an AsyncIterator provides the command lines.

  • LogView: renders an antsy Canvas full of lines of RichText. lines are appended at the bottom. can be limited to storing a limited number of historical lines. lines are optionally word-wrapped.

  • RichText: text model consisting of (possibly nested) spans of text with a color attribute. can parse a simple format like "this is {f00:red}" or you can generate the spans yourself.

  • ScrollView: fills an antsy Region with the contents of a Canvas (like LogView) that can be scrolled vertically.

  • StatusBar: displays a one-line status bar, where the left and right half can be updated independently.

  • Form: a layout of input elements (text, buttons, checkboxes, selection lists, and edit boxes) with validation and navigation. a left column labels each row, and each row can be a single element, or a packed line of elements (like three buttons).

to-do

  • shift-arrow, etc to mark text in an edit box (mwuhaha)
  • C-c, C-v, C-x, C-z in an edit box

Readme

Keywords

Package Sidebar

Install

npm i microfugue

Weekly Downloads

58

Version

0.14.0

License

none

Unpacked Size

242 kB

Total Files

48

Last publish

Collaborators

  • robey