Box(input: BoxProps & BoxEventProps, children: Node[]): Node
Column(input: Omit<BoxProps, "direction"> & BoxEventProps, children: Node[]): Node
Row(input: Omit<BoxProps, "direction"> & BoxEventProps, children: Node[]): Node
ScrollView(input: ScrollViewProps, children: Node[]): Node
Text(input: TextProps): Node
Input(input: InputProps): Node
Button(input: ButtonProps, children?: Node[]): Node
VirtualList(input: FixedVirtualListOptions<TItem, TRow>): Node-
TextProps- required:
text(string | StyledText) - optional:
wrap("none" | "word" | "char") - optional:
textOverflow("clip" | "ellipsis") - optional: all
StyleProps
- required:
-
InputProps- optional:
placeholder(string) - optional:
multiline(boolean) - optional:
wrap("word" | "char") — note:"none"not allowed for inputs - optional:
onChange,onSubmit,onFocus,onBlur - optional: all
StyleProps
- optional:
-
ButtonProps- required:
text,onClick - optional:
onKeyDown,onFocus,onBlur - optional: all
StyleProps
- required:
-
ScrollViewProps- optional:
axis("y" | "x" | "both") - optional:
sticky("start" | "end") - optional:
wheelStep(number) - optional:
keyboard(boolean) - optional:
onScroll(state) - optional: all
StyleProps
- optional:
-
BoxProps- optional:
gap(number) - optional:
direction("row" | "column" | "rowReverse" | "columnReverse") - optional: all
StyleProps
- optional:
-
BoxEventProps- optional:
onWheel(event)for custom wheel handling onBox/Row/Column event:{ x, y, deltaX, deltaY, shift, alt, ctrl, raw }- return
trueto consume and stop bubbling; returnfalse/voidto bubble to parent container
- optional:
border:{ color: number; style: "square" | "rounded" }borderTop,borderRight,borderBottom,borderLeft:{ color: number }padding: number or string pair ("horizontal vertical")paddingX,paddingYbackground,foreground(number colors)flexGrowwidth,heightminWidth,minHeightmaxWidth,maxHeightmargin: number or string pair ("horizontal vertical")marginX,marginYalignItemsjustifyContentalignSelfflexShrinkflexBasisflexWrap
gapdirection:"row" | "column" | "rowReverse" | "columnReverse"
- Public styling/layout surface is the exported
StyleProps,BoxProps, andScrollViewPropsabove. overflowremains internal; public scrolling usesScrollView.- Prefer
Row/Columnfor common cases; useBoxwhen you need explicitdirection, including reverse directions.
- wheel routing targets the deepest
ScrollViewor box withonWheelunder the cursor - events bubble up through parent containers until one handler consumes the event
- wheel events now carry both
deltaXanddeltaY Shift+wheelmaps vertical wheel to horizontal scroll insideScrollView
VirtualList(...)is fixed-row virtualization only- rows are created once with
createRow(...), then rebound withbindRow(...) - wrapped content should be flattened into visual rows before virtualization
createVirtualListController(...)is legacy compatibility surface
Use COLORS from the library.
import { COLORS } from "../index.ts";
const fg = COLORS.default.fg;
const bg = COLORS.default.bg;Rule: pass numeric hex colors (0xRRGGBB), not CSS strings.
setStyle(partialStyle)on all nodessetText(nextText)onText,Input,ButtonsetChildren(nextChildren)onBox,ButtonscrollTo,scrollBy,scrollToStart,scrollToEnd,ensureVisibleonScrollViewscrollToIndex,ensureIndexVisibleonVirtualListfocus(),blur(),isFocused()on all nodes
For rich text with multiple colors and styles within a single Text node, use StyledText:
import type { StyledText, TextSpan } from "@frixaco/letui";
const styled: StyledText = {
text: "bold red text and normal text",
spans: [
{ start: 0, end: 14, foreground: 0xff0000, bold: true },
{ start: 19, end: 30, foreground: 0xcccccc },
],
};
const node = Text({ text: styled });Each TextSpan supports:
start,end: character positions in the textforeground?: number— text color (hex)background?: number— background color (hex)bold?: booleanitalic?: booleanunderline?: boolean
- Build containers with
RowandColumn - Keep leaf nodes (
Text,Input,Button) referenced so you can callsetText/setStyle - Update via signals +
ff, not manual redraw loops - If prop meaning is unclear, check exported types in
src/types.ts