Skip to content

API

Complete signatures for every public class Phui exposes, grouped by what you reach for them to do. These pages describe what each thing is; for task-shaped guidance start from the How-to guides, and for the components that ship with Phui see Built-in Components.

Describing the UI

  • Nodes — the Phui\Nodes classes a build() returns: elements, containers, text, sizing, spacing and borders
  • ComponentComponent itself, the attributes that declare its reactive members, and the nodes that mount it
  • Canvas & TextSurface and SurfaceCell for painting cell by cell, and StyledString for runs of styled text

Styling

  • ColoursColour and its implementations: Hex, Rgb, Gradient and DefaultBackground
  • ThemingTheme, Palette and the Recolourable trait behind every *Colours class
  • Tailwind Utilities — the space-separated classes tw() accepts, and their fluent equivalents

Input & runtime

  • Events — every typed event a handler can receive: keypress, paste, mouse, emit and system
  • BindingsBinding, Keymap and the Keypress enum, plus the keys the framework claims for itself
  • Runtime — the services supplied to each component: focus, timers, system, themes, async and keymaps
  • ElementRef — reading where an element landed and driving a container's scroll position

Running & testing

  • Screen — configuring the terminal, registering services, and running the render loop
  • TestingTestScreen and Capture for driving a component against a fake terminal, the phui-snapshot command for snapshotting one, and Logger for debugging a live one

Released under the MIT License.