Thinking in Kite
Kite brings the browser’s rendering and event model to terminal cells. Every frame moves cleanly through five isolated stages, and every user interaction flows back through the same logical tree.
The 60FPS frame pipeline
Section titled “The 60FPS frame pipeline”- Logical DOM (
dom,element): Holds nodes, text, focusable controls, and listeners. A button remains the same button when the terminal resizes. - Sync (
internal/render): Projects structural DOM changes into render objects (render.Box,render.Text) carrying granular dirty flags. - Style (
style,internal/styler): Resolves four cascade layers in order: inherited values → element defaults → author styles (including media queries &:hover/:focus/:active/:disabled) → UA intrinsic styles. - Layout (
internal/layout): Computes immutable fragment geometry in terminal cells (Block, Inline/IFC, Flexbox, CSS Grid, Tables with implicit border-collapse, Virtual-marker Lists). - Paint & Commit (
internal/paint,backend): Draws backgrounds, borders (resolving intersections cleanly), clipped scrolled subtrees, text selection, and hardware cursor onto the activebackend.Backend.
Three-phase event propagation
Section titled “Three-phase event propagation”Input events follow the standard web propagation model: Capture (Document → Target), Target, and Bubble (Target → Document).
Choose the level of control
Section titled “Choose the level of control”- Use
element+kite.Newwhen you want to keep direct element references and mutate them in place. - Use
extras/kitexwhen UI should be derived declaratively from state via components and hooks. - Use
extras/trailwhen building an inline CLI tool that writes completed items permanently into terminal scrollback above a live status bar.
Application code imports public packages (kite, dom, element, style, event, engine, backend, terminal, extras/*). Packages under internal/ are implementation details—see Architecture for internal design details.