WidgetStyles
Defined in: src/dom/widget.ts:83
Inline style properties for a widget — the style prop’s shape. See the Styling and Layout guides.
Properties
Section titled “Properties”align?
Section titled “align?”
optionalalign?:"left"|"right"|"center"
Defined in: src/dom/widget.ts:125
Horizontal alignment of children on the cross axis.
background?
Section titled “background?”
optionalbackground?:string
Defined in: src/dom/widget.ts:87
Background color: hex, named, $token, or "transparent".
optionalbold?:boolean
Defined in: src/dom/widget.ts:164
Bold/bright text.
border?
Section titled “border?”
optionalborder?:string
Defined in: src/dom/widget.ts:109
Border around all four sides: "rounded" (default), "thin", "solid",
"heavy", "double", "dashed", "bar" (solid block), or "none". Use the
per-side props below for a single corner-less edge.
borderBottom?
Section titled “borderBottom?”
optionalborderBottom?:string
Defined in: src/dom/widget.ts:115
Bottom edge weight only (overrides border for this side).
borderColor?
Section titled “borderColor?”
optionalborderColor?:string
Defined in: src/dom/widget.ts:119
Border color: hex, named, or $token.
borderLeft?
Section titled “borderLeft?”
optionalborderLeft?:string
Defined in: src/dom/widget.ts:117
Left edge weight only (overrides border for this side) — e.g. a chat-message accent bar.
borderRight?
Section titled “borderRight?”
optionalborderRight?:string
Defined in: src/dom/widget.ts:113
Right edge weight only (overrides border for this side).
borderTop?
Section titled “borderTop?”
optionalborderTop?:string
Defined in: src/dom/widget.ts:111
Top edge weight only (overrides border for this side); same values as border.
bottom?
Section titled “bottom?”
optionalbottom?:string|number
Defined in: src/dom/widget.ts:137
Offset from the parent’s bottom edge when positioned.
color?
Section titled “color?”
optionalcolor?:string
Defined in: src/dom/widget.ts:85
Foreground/text color: hex, named, or $token.
cursor?
Section titled “cursor?”
optionalcursor?:"default"|"move"|"pointer"|"text"|"vertical-text"|"wait"|"progress"|"help"|"crosshair"|"cell"|"grab"|"grabbing"|"alias"|"copy"|"no-drop"|"not-allowed"|"zoom-in"|"zoom-out"|"n-resize"|"e-resize"|"s-resize"|"w-resize"|"ne-resize"|"nw-resize"|"se-resize"|"sw-resize"|"ew-resize"|"ns-resize"|"nesw-resize"|"nwse-resize"
Defined in: src/dom/widget.ts:184
Mouse-pointer shape shown while the pointer is over this widget, named after
the CSS cursor property ("pointer", "text", "grab", "not-allowed",
"col-resize" → "ew-resize", …). Inherited from the nearest ancestor that
sets it. Requires terminal OSC 22 support (see
TerminalCapabilities.pointerShapes); ignored otherwise.
optionaldim?:boolean
Defined in: src/dom/widget.ts:172
Reduced-intensity text.
display?
Section titled “display?”
optionaldisplay?:"dock"|"grid"|"flex"
Defined in: src/dom/widget.ts:141
Layout mode alias: "flex" (use flexDirection), "grid", or "dock".
optionaldock?:"bottom"|"top"|"left"|"right"
Defined in: src/dom/widget.ts:123
Pin this child to an edge of a dock parent.
flexDirection?
Section titled “flexDirection?”
optionalflexDirection?:"row"|"column"
Defined in: src/dom/widget.ts:145
Flex flow when display: "flex": "row" (horizontal) or "column" (vertical).
flexGrow?
Section titled “flexGrow?”
optionalflexGrow?:number
Defined in: src/dom/widget.ts:153
Share of leftover space along the flow axis (equivalent to N fr).
flexShrink?
Section titled “flexShrink?”
optionalflexShrink?:number
Defined in: src/dom/widget.ts:162
Share of the deficit this widget gives up when siblings overflow the
container along the flow axis. Defaults to 0 — auto/fixed-sized
widgets keep their measured size and the container overflows (subject
to overflowX/overflowY), matching prior behavior. Set to a positive
number to let this widget shrink instead; use minWidth/
minHeight as a floor.
flexWrap?
Section titled “flexWrap?”
optionalflexWrap?:"nowrap"|"wrap"
Defined in: src/dom/widget.ts:151
Whether children that overflow the flow axis wrap onto a new line
instead of overflowing. Defaults to "nowrap" (back-compat — a single
line, subject to flexShrink/overflowX/overflowY).
gridColumns?
Section titled “gridColumns?”
optionalgridColumns?:number
Defined in: src/dom/widget.ts:143
Number of equal-width columns when display: "grid". Defaults to 2.
height?
Section titled “height?”
optionalheight?:string|number
Defined in: src/dom/widget.ts:91
Height: cells, "%", "fr", or "auto".
italic?
Section titled “italic?”
optionalitalic?:boolean
Defined in: src/dom/widget.ts:166
Italic text.
layout?
Section titled “layout?”
optionallayout?:"vertical"|"horizontal"|"dock"|"grid"
Defined in: src/dom/widget.ts:121
Child flow direction / mode: vertical, horizontal, dock, or grid.
optionalleft?:string|number
Defined in: src/dom/widget.ts:131
Offset from the parent’s left edge when positioned.
optionallink?:string
Defined in: src/dom/widget.ts:176
Hyperlink target (OSC 8) where the terminal supports it.
margin?
Section titled “margin?”
optionalmargin?:number|Spacing| {bottom?:number;left?:number;right?:number;top?:number; }
Defined in: src/dom/widget.ts:101
Space outside the border: number (all sides), per-side object, or Spacing.
maxHeight?
Section titled “maxHeight?”
optionalmaxHeight?:number
Defined in: src/dom/widget.ts:99
Maximum height in cells.
maxWidth?
Section titled “maxWidth?”
optionalmaxWidth?:number
Defined in: src/dom/widget.ts:97
Maximum width in cells.
minHeight?
Section titled “minHeight?”
optionalminHeight?:number
Defined in: src/dom/widget.ts:95
Minimum height in cells.
minWidth?
Section titled “minWidth?”
optionalminWidth?:number
Defined in: src/dom/widget.ts:93
Minimum width in cells.
overflowX?
Section titled “overflowX?”
optionaloverflowX?:"auto"|"scroll"|"hidden"|"visible"
Defined in: src/dom/widget.ts:186
Horizontal overflow: clip ("hidden", default), "scroll"/"auto", or "visible".
overflowY?
Section titled “overflowY?”
optionaloverflowY?:"auto"|"scroll"|"hidden"|"visible"
Defined in: src/dom/widget.ts:188
Vertical overflow handling (see overflowX).
padding?
Section titled “padding?”
optionalpadding?:number|Spacing| {bottom?:number;left?:number;right?:number;top?:number; }
Defined in: src/dom/widget.ts:103
Space inside the border, before content.
position?
Section titled “position?”
optionalposition?:"relative"|"absolute"
Defined in: src/dom/widget.ts:129
"absolute" takes the widget out of flow, positioned by left/top/right/bottom.
reverse?
Section titled “reverse?”
optionalreverse?:boolean
Defined in: src/dom/widget.ts:170
Swap foreground and background.
right?
Section titled “right?”
optionalright?:string|number
Defined in: src/dom/widget.ts:135
Offset from the parent’s right edge when positioned.
strikethrough?
Section titled “strikethrough?”
optionalstrikethrough?:boolean
Defined in: src/dom/widget.ts:174
Struck-through text.
optionaltop?:string|number
Defined in: src/dom/widget.ts:133
Offset from the parent’s top edge when positioned.
underline?
Section titled “underline?”
optionalunderline?:boolean
Defined in: src/dom/widget.ts:168
Underlined text.
verticalAlign?
Section titled “verticalAlign?”
optionalverticalAlign?:"bottom"|"top"|"middle"
Defined in: src/dom/widget.ts:127
Vertical alignment of children on the cross axis.
width?
Section titled “width?”
optionalwidth?:string|number
Defined in: src/dom/widget.ts:89
Width: cells (10), "50%", "3fr", or "auto".
zIndex?
Section titled “zIndex?”
optionalzIndex?:number
Defined in: src/dom/widget.ts:139
Stacking order among siblings (higher paints on top).