Mosaic_mlxSourceMLX-compatible wrappers for Mosaic.
This module re-exports the full Mosaic API with child arguments changed from positional to optional, matching the MLX JSX convention where children are passed as ~children.
All types, modules, helpers, and non-overridden elements are inherited unchanged from Mosaic; see that module for their documentation. Only the elements listed below are overridden.
include module type of Mosaicmodule Ansi = Matrix.AnsiTerminal ANSI escape sequences: colors (Ansi.Color), styles (Ansi.Style), and attributes (Ansi.Attr).
Border character sets for box-drawing. Provides Border.single, Border.rounded, Border.heavy, Border.double, and Border.ascii.
Input event types for keyboard, mouse, and paste events.
The type for 2-dimensional points.
The type for line segments with start and end values. Used by Grid.line_range and Grid.span_range for grid placement.
A contiguous run of text with a single visual style. Used by code for syntax highlighting via its ~spans argument.
CSS display property controlling box generation and child layout algorithm.
CSS box-sizing property.
CSS text-align property for block layout.
CSS flex-direction property.
Alignment along the cross/block axis (align-items, align-self, justify-items, justify-self).
Distribution of space between and around content items (align-content, justify-content).
CSS grid-auto-flow property.
Companion types for the tab_select widget.
Companion types for the scroll_bar widget.
Companion types for the line_number widget.
Syntax themes: maps capture-group names to terminal styles.
The type for view nodes parameterized by message type 'msg. Event handlers embedded in a node return 'msg option: Some msg dispatches the message into the update loop; None ignores the event.
Build values of this type with the element constructors (box, text, input, etc.) and compose them with fragment.
map f view is view with every message transformed by f.
Use map to embed a child component whose message type differs from the parent's.
type ('model, 'msg) app = {init : unit -> 'model * 'msg Cmd.t;init () is the initial model and any startup commands. Called once before the first render.
update : 'msg -> 'model -> 'model * 'msg Cmd.t;update msg model is the new model and any side-effects produced in response to msg. Called once per dispatched message.
view : 'model -> 'msg t;view model is the UI description for model. Called on every render cycle when the model has changed.
subscriptions : 'model -> 'msg Sub.t;subscriptions model is the set of events the application wants to receive given model. Re-evaluated after every update.
}The type for a Mosaic application. Provide a value of this type to run.
val run :
?matrix:Matrix.app ->
?process_perform:((unit -> unit) -> unit) ->
('model, 'msg) app ->
unitrun ?matrix ?process_perform app starts app and blocks until the application exits (via Cmd.quit or an OS signal).
matrix -- the low-level terminal backend. Defaults to a backend with target_fps = Some 60. and a hidden cursor.process_perform -- controls how Cmd.t.Perform callbacks are executed. Receives a thunk that wraps the user callback with the dispatch function already wired in. The default spawns a native Thread per callback so that long-running operations (e.g. HTTP requests) never block the UI loop.Eio integration. Pass a matrix and process_perform built with the matrix_eio library:
Eio_main.run @@ fun env ->
Eio.Switch.run @@ fun sw ->
let matrix =
Matrix_eio.create ~sw ~clock:(Eio.Stdenv.clock env) ~stdin:env#stdin
~stdout:env#stdout ()
in
let process_perform thunk =
Eio.Fiber.fork_daemon ~sw (fun () ->
thunk ();
`Stop_daemon)
in
Mosaic.run ~matrix ~process_perform { init; update; view; subscriptions }Daemon fibers are cancelled when the switch completes, so long-running perform operations do not block application shutdown.
auto is the automatic dimension, letting the layout engine determine the size.
size ~width ~height is a fixed size with the given width and height measured in terminal cells.
size_wh w h is a size with the given w width and h height dimensions.
gap n is a uniform gap of n cells applied to both axes of a flex or grid container.
gap_xy x y is a gap of x cells on the horizontal axis and y cells on the vertical axis.
padding n is a uniform padding of n cells on all four sides.
padding_xy x y is padding of x cells on the left and right sides and y cells on the top and bottom sides.
padding_lrtb l r t b is padding of l cells on the left, r on the right, t on the top, and b on the bottom.
margin n is a uniform margin of n cells on all four sides.
margin_xy x y is margin of x cells on the left and right sides and y cells on the top and bottom sides.
margin_lrtb l r t b is margin of l cells on the left, r on the right, t on the top, and b on the bottom.
inset n is a uniform inset of n cells on all four sides, used with position = `Absolute or position = `Fixed.
inset_lrtb l r t b is inset of l cells on the left, r on the right, t on the top, and b on the bottom.
Every element constructor accepts a large set of optional layout and styling arguments that mirror CSS flexbox and grid properties. Arguments shared across all elements are listed once here; only element-specific arguments are documented on each constructor.
key -- reconciler identity hint for list items.id -- unique identifier used by Cmd.focus.display -- layout mode (Display.t.Flex, Display.t.Grid, Display.t.Block, ...).box_sizing -- whether size includes padding and border.position -- positioning scheme (Position.t.Relative, Position.t.Absolute).overflow -- how overflowing content is handled per axis.scrollbar_width -- width reserved for overflow scrollbars.text_align -- text alignment within the element.inset -- position offsets for absolutely-positioned elements.flex_direction, flex_wrap, justify_content, align_items, align_content, align_self, flex_grow, flex_shrink, flex_basis -- flexbox properties.justify_items, justify_self -- grid alignment properties.size, min_size, max_size -- element dimensions.aspect_ratio -- width-to-height ratio constraint.gap -- spacing between flex or grid children.padding -- inner spacing between border and content.margin -- outer spacing outside the border.border_width -- widths of each border side in cells.grid_template_rows, grid_template_columns, grid_auto_rows, grid_auto_columns, grid_auto_flow, grid_template_areas, grid_template_column_names, grid_template_row_names, grid_row, grid_column -- CSS grid properties.visible -- when false the element takes no space and is not rendered. Defaults to true.z_index -- stacking order for overlapping elements.opacity -- alpha in [0.;1.]; 1. is fully opaque.focusable -- when true the element can receive keyboard focus. Defaults to false.autofocus -- when true the element receives focus on mount. Defaults to false.buffered -- when true renders to an off-screen buffer. Defaults to false.live -- when true the element re-renders every frame even when the model has not changed. Defaults to false.ref -- callback invoked with the rendered Mosaic_ui.Renderable.t after each frame.on_mouse -- mouse event handler for this element.on_key -- key event handler for this element.on_paste -- paste event handler for this element.empty is the empty view that renders nothing and occupies no space. Useful as a placeholder.
embed r wraps a pre-rendered Mosaic_ui.Renderable.t as a view node. Use this to integrate non-TEA rendering into the view tree.
val slider :
?key:string ->
?id:string ->
?display:Display.t ->
?box_sizing:Box_sizing.t ->
?position:Position.t ->
?overflow:Overflow.t point ->
?scrollbar_width:float ->
?text_align:Text_align.t ->
?inset:length_percentage_auto rect ->
?flex_direction:Flex_direction.t ->
?flex_wrap:Flex_wrap.t ->
?justify_content:Justify.t ->
?align_items:Align.t ->
?size:dimension size ->
?min_size:dimension size ->
?max_size:dimension size ->
?aspect_ratio:float ->
?gap:length_percentage size ->
?padding:length_percentage rect ->
?margin:length_percentage_auto rect ->
?border_width:length_percentage rect ->
?align_self:Align.t ->
?align_content:Justify.t ->
?justify_items:Align.t ->
?justify_self:Align.t ->
?flex_grow:float ->
?flex_shrink:float ->
?flex_basis:dimension ->
?grid_template_rows:Grid.template list ->
?grid_template_columns:Grid.template list ->
?grid_auto_rows:Grid.track list ->
?grid_auto_columns:Grid.track list ->
?grid_auto_flow:Grid_auto_flow.t ->
?grid_template_areas:Grid.area list ->
?grid_template_column_names:string list list ->
?grid_template_row_names:string list list ->
?grid_row:Grid.placement line ->
?grid_column:Grid.placement line ->
?visible:bool ->
?z_index:int ->
?opacity:float ->
?focusable:bool ->
?autofocus:bool ->
?buffered:bool ->
?live:bool ->
?ref:(Mosaic_ui.Renderable.t -> unit) ->
?on_mouse:(Event.mouse -> 'msg option) ->
?on_key:(Event.key -> 'msg option) ->
?on_paste:(Event.paste -> 'msg option) ->
?orientation:Slider.orientation ->
?value:float ->
?min:float ->
?max:float ->
?viewport_size:float ->
?track_color:Ansi.Color.t ->
?thumb_color:Ansi.Color.t ->
?on_value_change:(float -> 'msg option) ->
unit ->
'msg tslider () is an interactive range slider.
Slider-specific optional arguments:
orientation -- `Horizontal or `Vertical. Defaults to `Horizontal.value -- current thumb position. Defaults to 0..min -- minimum value of the range. Defaults to 0..max -- maximum value of the range. Defaults to 1..viewport_size -- size of the visible viewport relative to the total range; used to size the thumb proportionally.track_color -- color of the slider track.thumb_color -- color of the slider thumb.on_value_change -- callback fired when the value changes; receives the new value and returns an optional message.val select :
?key:string ->
?id:string ->
?display:Display.t ->
?box_sizing:Box_sizing.t ->
?position:Position.t ->
?overflow:Overflow.t point ->
?scrollbar_width:float ->
?text_align:Text_align.t ->
?inset:length_percentage_auto rect ->
?flex_direction:Flex_direction.t ->
?flex_wrap:Flex_wrap.t ->
?justify_content:Justify.t ->
?align_items:Align.t ->
?size:dimension size ->
?min_size:dimension size ->
?max_size:dimension size ->
?aspect_ratio:float ->
?gap:length_percentage size ->
?padding:length_percentage rect ->
?margin:length_percentage_auto rect ->
?border_width:length_percentage rect ->
?align_self:Align.t ->
?align_content:Justify.t ->
?justify_items:Align.t ->
?justify_self:Align.t ->
?flex_grow:float ->
?flex_shrink:float ->
?flex_basis:dimension ->
?grid_template_rows:Grid.template list ->
?grid_template_columns:Grid.template list ->
?grid_auto_rows:Grid.track list ->
?grid_auto_columns:Grid.track list ->
?grid_auto_flow:Grid_auto_flow.t ->
?grid_template_areas:Grid.area list ->
?grid_template_column_names:string list list ->
?grid_template_row_names:string list list ->
?grid_row:Grid.placement line ->
?grid_column:Grid.placement line ->
?visible:bool ->
?z_index:int ->
?opacity:float ->
?focusable:bool ->
?autofocus:bool ->
?buffered:bool ->
?live:bool ->
?ref:(Mosaic_ui.Renderable.t -> unit) ->
?on_mouse:(Event.mouse -> 'msg option) ->
?on_key:(Event.key -> 'msg option) ->
?on_paste:(Event.paste -> 'msg option) ->
?selected_index:int ->
?background:Ansi.Color.t ->
?text_color:Ansi.Color.t ->
?focused_background:Ansi.Color.t ->
?focused_text_color:Ansi.Color.t ->
?selected_background:Ansi.Color.t ->
?selected_text_color:Ansi.Color.t ->
?description_color:Ansi.Color.t ->
?selected_description_color:Ansi.Color.t ->
?show_description:bool ->
?show_scroll_indicator:bool ->
?wrap_selection:bool ->
?item_spacing:int ->
?fast_scroll_step:int ->
?on_change:(int -> 'msg option) ->
?on_activate:(int -> 'msg option) ->
Select.item list ->
'msg tselect items is a vertical list from which the user can choose one item.
See tab_select for a horizontal tab-bar variant.
Select-specific optional arguments:
selected_index -- zero-based index of the highlighted item. Defaults to 0.background -- background color of unselected items.text_color -- foreground color of unselected items.focused_background -- background when the widget has focus.focused_text_color -- foreground when the widget has focus.selected_background -- background of the selected item.selected_text_color -- foreground of the selected item.description_color -- color of item description text.selected_description_color -- description color for the selected item.show_description -- when true shows item descriptions. Defaults to true.show_scroll_indicator -- when true shows a scroll indicator when the list overflows. Defaults to false.wrap_selection -- when true wraps the selection from the last item back to the first and vice versa. Defaults to false.item_spacing -- number of blank lines between items. Defaults to 0.fast_scroll_step -- number of items skipped per fast-scroll action (e.g. Page Down). Defaults to 5.on_change -- fired when the highlighted index changes; receives the new index.on_activate -- fired when the user confirms the selection (e.g. by pressing Enter); receives the confirmed index.val tab_select :
?key:string ->
?id:string ->
?display:Display.t ->
?box_sizing:Box_sizing.t ->
?position:Position.t ->
?overflow:Overflow.t point ->
?scrollbar_width:float ->
?text_align:Text_align.t ->
?inset:length_percentage_auto rect ->
?flex_direction:Flex_direction.t ->
?flex_wrap:Flex_wrap.t ->
?justify_content:Justify.t ->
?align_items:Align.t ->
?size:dimension size ->
?min_size:dimension size ->
?max_size:dimension size ->
?aspect_ratio:float ->
?gap:length_percentage size ->
?padding:length_percentage rect ->
?margin:length_percentage_auto rect ->
?border_width:length_percentage rect ->
?align_self:Align.t ->
?align_content:Justify.t ->
?justify_items:Align.t ->
?justify_self:Align.t ->
?flex_grow:float ->
?flex_shrink:float ->
?flex_basis:dimension ->
?grid_template_rows:Grid.template list ->
?grid_template_columns:Grid.template list ->
?grid_auto_rows:Grid.track list ->
?grid_auto_columns:Grid.track list ->
?grid_auto_flow:Grid_auto_flow.t ->
?grid_template_areas:Grid.area list ->
?grid_template_column_names:string list list ->
?grid_template_row_names:string list list ->
?grid_row:Grid.placement line ->
?grid_column:Grid.placement line ->
?visible:bool ->
?z_index:int ->
?opacity:float ->
?focusable:bool ->
?autofocus:bool ->
?buffered:bool ->
?live:bool ->
?ref:(Mosaic_ui.Renderable.t -> unit) ->
?on_mouse:(Event.mouse -> 'msg option) ->
?on_key:(Event.key -> 'msg option) ->
?on_paste:(Event.paste -> 'msg option) ->
?selected:int ->
?tab_width:int ->
?background:Ansi.Color.t ->
?text_color:Ansi.Color.t ->
?focused_background:Ansi.Color.t ->
?focused_text_color:Ansi.Color.t ->
?selected_background:Ansi.Color.t ->
?selected_text_color:Ansi.Color.t ->
?description_color:Ansi.Color.t ->
?selected_description_color:Ansi.Color.t ->
?show_underline:bool ->
?show_description:bool ->
?show_scroll_arrows:bool ->
?wrap_selection:bool ->
?on_change:(int -> 'msg option) ->
?on_activate:(int -> 'msg option) ->
Tab_select.item list ->
'msg ttab_select items is a horizontal tab-bar selector.
See select for the vertical list variant.
Tab-select-specific optional arguments:
selected -- zero-based index of the active tab. Defaults to 0.tab_width -- fixed width for each tab in cells. Defaults to 12.background -- background color of inactive tabs.text_color -- foreground color of inactive tabs.focused_background -- background when the widget has focus.focused_text_color -- foreground when the widget has focus.selected_background -- background of the active tab.selected_text_color -- foreground of the active tab.description_color -- color of tab description text.selected_description_color -- description color for the active tab.show_underline -- when true draws an underline below tabs. Defaults to true.show_description -- when true shows tab descriptions. Defaults to false.show_scroll_arrows -- when true shows arrows when tabs overflow the available width. Defaults to true.wrap_selection -- when true wraps from the last tab to the first and vice versa. Defaults to false.on_change -- fired when the active tab index changes.on_activate -- fired when the user confirms the tab selection.val canvas :
?key:string ->
?id:string ->
?display:Display.t ->
?box_sizing:Box_sizing.t ->
?position:Position.t ->
?overflow:Overflow.t point ->
?scrollbar_width:float ->
?text_align:Text_align.t ->
?inset:length_percentage_auto rect ->
?flex_direction:Flex_direction.t ->
?flex_wrap:Flex_wrap.t ->
?justify_content:Justify.t ->
?align_items:Align.t ->
?size:dimension size ->
?min_size:dimension size ->
?max_size:dimension size ->
?aspect_ratio:float ->
?gap:length_percentage size ->
?padding:length_percentage rect ->
?margin:length_percentage_auto rect ->
?border_width:length_percentage rect ->
?align_self:Align.t ->
?align_content:Justify.t ->
?justify_items:Align.t ->
?justify_self:Align.t ->
?flex_grow:float ->
?flex_shrink:float ->
?flex_basis:dimension ->
?grid_template_rows:Grid.template list ->
?grid_template_columns:Grid.template list ->
?grid_auto_rows:Grid.track list ->
?grid_auto_columns:Grid.track list ->
?grid_auto_flow:Grid_auto_flow.t ->
?grid_template_areas:Grid.area list ->
?grid_template_column_names:string list list ->
?grid_template_row_names:string list list ->
?grid_row:Grid.placement line ->
?grid_column:Grid.placement line ->
?visible:bool ->
?z_index:int ->
?opacity:float ->
?focusable:bool ->
?autofocus:bool ->
?buffered:bool ->
?live:bool ->
?ref:(Mosaic_ui.Renderable.t -> unit) ->
?on_mouse:(Event.mouse -> 'msg option) ->
?on_key:(Event.key -> 'msg option) ->
?on_paste:(Event.paste -> 'msg option) ->
?respect_alpha:bool ->
(Canvas.t -> delta:float -> unit) ->
'msg tcanvas draw is a free-form drawing surface. draw c ~delta is called on every frame with a fresh Canvas.t c and the elapsed time delta in seconds since the previous frame. The canvas fills its allocated layout area.
Canvas-specific optional arguments:
respect_alpha -- when true the canvas composites with alpha blending. Defaults to true.val spinner :
?key:string ->
?id:string ->
?display:Display.t ->
?box_sizing:Box_sizing.t ->
?position:Position.t ->
?overflow:Overflow.t point ->
?scrollbar_width:float ->
?text_align:Text_align.t ->
?inset:length_percentage_auto rect ->
?flex_direction:Flex_direction.t ->
?flex_wrap:Flex_wrap.t ->
?justify_content:Justify.t ->
?align_items:Align.t ->
?size:dimension size ->
?min_size:dimension size ->
?max_size:dimension size ->
?aspect_ratio:float ->
?gap:length_percentage size ->
?padding:length_percentage rect ->
?margin:length_percentage_auto rect ->
?border_width:length_percentage rect ->
?align_self:Align.t ->
?align_content:Justify.t ->
?justify_items:Align.t ->
?justify_self:Align.t ->
?flex_grow:float ->
?flex_shrink:float ->
?flex_basis:dimension ->
?grid_template_rows:Grid.template list ->
?grid_template_columns:Grid.template list ->
?grid_auto_rows:Grid.track list ->
?grid_auto_columns:Grid.track list ->
?grid_auto_flow:Grid_auto_flow.t ->
?grid_template_areas:Grid.area list ->
?grid_template_column_names:string list list ->
?grid_template_row_names:string list list ->
?grid_row:Grid.placement line ->
?grid_column:Grid.placement line ->
?visible:bool ->
?z_index:int ->
?opacity:float ->
?focusable:bool ->
?autofocus:bool ->
?buffered:bool ->
?live:bool ->
?ref:(Mosaic_ui.Renderable.t -> unit) ->
?on_mouse:(Event.mouse -> 'msg option) ->
?on_key:(Event.key -> 'msg option) ->
?on_paste:(Event.paste -> 'msg option) ->
?frame_set:Spinner.frame_set ->
?color:Ansi.Color.t ->
unit ->
'msg tspinner () is an animated activity indicator.
Spinner-specific optional arguments:
frame_set -- the animation frame sequence. Defaults to Spinner.dots.color -- foreground color of the spinner character. Defaults to white.val progress_bar :
?key:string ->
?id:string ->
?display:Display.t ->
?box_sizing:Box_sizing.t ->
?position:Position.t ->
?overflow:Overflow.t point ->
?scrollbar_width:float ->
?text_align:Text_align.t ->
?inset:length_percentage_auto rect ->
?flex_direction:Flex_direction.t ->
?flex_wrap:Flex_wrap.t ->
?justify_content:Justify.t ->
?align_items:Align.t ->
?size:dimension size ->
?min_size:dimension size ->
?max_size:dimension size ->
?aspect_ratio:float ->
?gap:length_percentage size ->
?padding:length_percentage rect ->
?margin:length_percentage_auto rect ->
?border_width:length_percentage rect ->
?align_self:Align.t ->
?align_content:Justify.t ->
?justify_items:Align.t ->
?justify_self:Align.t ->
?flex_grow:float ->
?flex_shrink:float ->
?flex_basis:dimension ->
?grid_template_rows:Grid.template list ->
?grid_template_columns:Grid.template list ->
?grid_auto_rows:Grid.track list ->
?grid_auto_columns:Grid.track list ->
?grid_auto_flow:Grid_auto_flow.t ->
?grid_template_areas:Grid.area list ->
?grid_template_column_names:string list list ->
?grid_template_row_names:string list list ->
?grid_row:Grid.placement line ->
?grid_column:Grid.placement line ->
?visible:bool ->
?z_index:int ->
?opacity:float ->
?focusable:bool ->
?autofocus:bool ->
?buffered:bool ->
?live:bool ->
?ref:(Mosaic_ui.Renderable.t -> unit) ->
?on_mouse:(Event.mouse -> 'msg option) ->
?on_key:(Event.key -> 'msg option) ->
?on_paste:(Event.paste -> 'msg option) ->
?value:float ->
?min:float ->
?max:float ->
?orientation:[ `Horizontal | `Vertical ] ->
?filled_color:Ansi.Color.t ->
?empty_color:Ansi.Color.t ->
unit ->
'msg tprogress_bar () is a read-only progress indicator.
Progress-bar-specific optional arguments:
value -- current progress value. Defaults to 0..min -- value representing 0% progress. Defaults to 0..max -- value representing 100% progress. Defaults to 1..orientation -- `Horizontal or `Vertical. Defaults to `Horizontal.filled_color -- color of the filled portion of the bar. Defaults to medium gray.empty_color -- color of the unfilled portion of the bar. Defaults to dark gray.val scroll_bar :
?key:string ->
?id:string ->
?display:Display.t ->
?box_sizing:Box_sizing.t ->
?position:Position.t ->
?overflow:Overflow.t point ->
?scrollbar_width:float ->
?text_align:Text_align.t ->
?inset:length_percentage_auto rect ->
?flex_direction:Flex_direction.t ->
?flex_wrap:Flex_wrap.t ->
?justify_content:Justify.t ->
?align_items:Align.t ->
?size:dimension size ->
?min_size:dimension size ->
?max_size:dimension size ->
?aspect_ratio:float ->
?gap:length_percentage size ->
?padding:length_percentage rect ->
?margin:length_percentage_auto rect ->
?border_width:length_percentage rect ->
?align_self:Align.t ->
?align_content:Justify.t ->
?justify_items:Align.t ->
?justify_self:Align.t ->
?flex_grow:float ->
?flex_shrink:float ->
?flex_basis:dimension ->
?grid_template_rows:Grid.template list ->
?grid_template_columns:Grid.template list ->
?grid_auto_rows:Grid.track list ->
?grid_auto_columns:Grid.track list ->
?grid_auto_flow:Grid_auto_flow.t ->
?grid_template_areas:Grid.area list ->
?grid_template_column_names:string list list ->
?grid_template_row_names:string list list ->
?grid_row:Grid.placement line ->
?grid_column:Grid.placement line ->
?visible:bool ->
?z_index:int ->
?opacity:float ->
?focusable:bool ->
?autofocus:bool ->
?buffered:bool ->
?live:bool ->
?ref:(Mosaic_ui.Renderable.t -> unit) ->
?on_mouse:(Event.mouse -> 'msg option) ->
?on_key:(Event.key -> 'msg option) ->
?on_paste:(Event.paste -> 'msg option) ->
?orientation:Scroll_bar.orientation ->
?show_arrows:bool ->
?track_color:Ansi.Color.t ->
?thumb_color:Ansi.Color.t ->
?arrow_fg:Ansi.Color.t ->
?arrow_bg:Ansi.Color.t ->
?on_change:(int -> 'msg option) ->
unit ->
'msg tscroll_bar () is a standalone scroll-bar widget. Use this when you manage scroll state externally; for automatic scrolling consider scroll_box instead.
Scroll-bar-specific optional arguments:
orientation -- `Horizontal or `Vertical. Defaults to `Vertical.show_arrows -- when true renders arrow buttons at each end. Defaults to false.track_color -- color of the scroll track. Defaults to dark gray.thumb_color -- color of the scroll thumb. Defaults to medium gray.arrow_fg -- foreground color of the arrow buttons. Defaults to white.arrow_bg -- background color of the arrow buttons. Defaults to the terminal default.on_change -- fired when the scroll position changes; receives the new position in scroll units.val table :
?key:string ->
?id:string ->
?display:Display.t ->
?box_sizing:Box_sizing.t ->
?position:Position.t ->
?overflow:Overflow.t point ->
?scrollbar_width:float ->
?text_align:Text_align.t ->
?inset:length_percentage_auto rect ->
?flex_direction:Flex_direction.t ->
?flex_wrap:Flex_wrap.t ->
?justify_content:Justify.t ->
?align_items:Align.t ->
?size:dimension size ->
?min_size:dimension size ->
?max_size:dimension size ->
?aspect_ratio:float ->
?gap:length_percentage size ->
?padding:length_percentage rect ->
?margin:length_percentage_auto rect ->
?border_width:length_percentage rect ->
?align_self:Align.t ->
?align_content:Justify.t ->
?justify_items:Align.t ->
?justify_self:Align.t ->
?flex_grow:float ->
?flex_shrink:float ->
?flex_basis:dimension ->
?grid_template_rows:Grid.template list ->
?grid_template_columns:Grid.template list ->
?grid_auto_rows:Grid.track list ->
?grid_auto_columns:Grid.track list ->
?grid_auto_flow:Grid_auto_flow.t ->
?grid_template_areas:Grid.area list ->
?grid_template_column_names:string list list ->
?grid_template_row_names:string list list ->
?grid_row:Grid.placement line ->
?grid_column:Grid.placement line ->
?visible:bool ->
?z_index:int ->
?opacity:float ->
?focusable:bool ->
?autofocus:bool ->
?buffered:bool ->
?live:bool ->
?ref:(Mosaic_ui.Renderable.t -> unit) ->
?on_mouse:(Event.mouse -> 'msg option) ->
?on_key:(Event.key -> 'msg option) ->
?on_paste:(Event.paste -> 'msg option) ->
?columns:Table.column list ->
?rows:Table.cell array list ->
?selected_row:int ->
?border:bool ->
?border_style:Border.t ->
?show_header:bool ->
?show_column_separator:bool ->
?show_row_separator:bool ->
?cell_padding:int ->
?header_color:Ansi.Color.t ->
?header_background:Ansi.Color.t ->
?text_color:Ansi.Color.t ->
?background:Ansi.Color.t ->
?selected_text_color:Ansi.Color.t ->
?selected_background:Ansi.Color.t ->
?focused_selected_text_color:Ansi.Color.t ->
?focused_selected_background:Ansi.Color.t ->
?row_styles:Ansi.Style.t list ->
?wrap_selection:bool ->
?fast_scroll_step:int ->
?on_change:(int -> 'msg option) ->
?on_activate:(int -> 'msg option) ->
unit ->
'msg ttable () is a scrollable data table.
Table-specific optional arguments:
columns -- column definitions (Table.column), including headers and sizing. Defaults to [].rows -- table data as a list of cell arrays. Each array must have the same length as columns. Defaults to [].selected_row -- zero-based index of the highlighted row. Defaults to 0.border -- when true draws an outer border. Defaults to true.border_style -- character set for the outer border. Defaults to Border.single.show_header -- when true renders a header row. Defaults to true.show_column_separator -- when true draws vertical lines between columns. Defaults to false.show_row_separator -- when true draws horizontal lines between rows. Defaults to false.cell_padding -- horizontal padding in cells within each cell. Defaults to 0.header_color -- foreground color of the header row.header_background -- background color of the header row.text_color -- foreground color of body cells.background -- background color of body cells.selected_text_color -- foreground of the selected row.selected_background -- background of the selected row.focused_selected_text_color -- foreground of the selected row when the table has focus.focused_selected_background -- background of the selected row when the table has focus.row_styles -- repeating list of styles applied to body rows, useful for alternating row colors.wrap_selection -- when true wraps selection past the last or first row. Defaults to false.fast_scroll_step -- rows skipped per fast-scroll action. Defaults to 5.on_change -- fired when the selected row index changes.on_activate -- fired when the user confirms the selected row (e.g. by pressing Enter).val tree :
?key:string ->
?id:string ->
?display:Display.t ->
?box_sizing:Box_sizing.t ->
?position:Position.t ->
?overflow:Overflow.t point ->
?scrollbar_width:float ->
?text_align:Text_align.t ->
?inset:length_percentage_auto rect ->
?flex_direction:Flex_direction.t ->
?flex_wrap:Flex_wrap.t ->
?justify_content:Justify.t ->
?align_items:Align.t ->
?size:dimension size ->
?min_size:dimension size ->
?max_size:dimension size ->
?aspect_ratio:float ->
?gap:length_percentage size ->
?padding:length_percentage rect ->
?margin:length_percentage_auto rect ->
?border_width:length_percentage rect ->
?align_self:Align.t ->
?align_content:Justify.t ->
?justify_items:Align.t ->
?justify_self:Align.t ->
?flex_grow:float ->
?flex_shrink:float ->
?flex_basis:dimension ->
?grid_template_rows:Grid.template list ->
?grid_template_columns:Grid.template list ->
?grid_auto_rows:Grid.track list ->
?grid_auto_columns:Grid.track list ->
?grid_auto_flow:Grid_auto_flow.t ->
?grid_template_areas:Grid.area list ->
?grid_template_column_names:string list list ->
?grid_template_row_names:string list list ->
?grid_row:Grid.placement line ->
?grid_column:Grid.placement line ->
?visible:bool ->
?z_index:int ->
?opacity:float ->
?focusable:bool ->
?autofocus:bool ->
?buffered:bool ->
?live:bool ->
?ref:(Mosaic_ui.Renderable.t -> unit) ->
?on_mouse:(Event.mouse -> 'msg option) ->
?on_key:(Event.key -> 'msg option) ->
?on_paste:(Event.paste -> 'msg option) ->
?items:Tree.item list ->
?selected_index:int ->
?expand_depth:int ->
?indent_size:int ->
?show_guides:bool ->
?guide_style:Border.t ->
?expand_icon:string ->
?collapse_icon:string ->
?leaf_icon:string ->
?background:Ansi.Color.t ->
?text_color:Ansi.Color.t ->
?selected_background:Ansi.Color.t ->
?selected_text_color:Ansi.Color.t ->
?focused_selected_background:Ansi.Color.t ->
?focused_selected_text_color:Ansi.Color.t ->
?guide_color:Ansi.Color.t ->
?icon_color:Ansi.Color.t ->
?wrap_selection:bool ->
?fast_scroll_step:int ->
?on_change:(int -> 'msg option) ->
?on_activate:(int -> 'msg option) ->
?on_expand:(int -> bool -> 'msg option) ->
unit ->
'msg ttree () is an interactive collapsible tree view.
Tree-specific optional arguments:
items -- the root-level Tree.item nodes. Defaults to [].selected_index -- zero-based flat index of the highlighted item. Defaults to 0.expand_depth -- number of levels expanded on first render. 0 collapses all; use max_int to expand everything. Defaults to 0.indent_size -- cells of indentation per nesting level. Defaults to 2.show_guides -- when true draws vertical guide lines. Defaults to false.guide_style -- border character set used for guide lines.expand_icon -- string shown next to collapsible nodes when collapsed. Defaults to "▶".collapse_icon -- string shown next to collapsible nodes when expanded. Defaults to "▼".leaf_icon -- string shown next to leaf nodes. Defaults to " ".background -- background color of unselected items.text_color -- foreground color of unselected items.selected_background -- background of the selected item.selected_text_color -- foreground of the selected item.focused_selected_background -- background of the selected item when the widget has focus.focused_selected_text_color -- foreground of the selected item when the widget has focus.guide_color -- color of the vertical guide lines.icon_color -- color of the expand/collapse/leaf icons.wrap_selection -- when true wraps selection past the last or first visible item. Defaults to false.fast_scroll_step -- items skipped per fast-scroll action. Defaults to 5.on_change -- fired when the selected index changes.on_activate -- fired when the user confirms the selection.on_expand -- fired when a node is expanded or collapsed; receives the flat index and true if expanded, false if collapsed.The virtual-DOM reconciler used by run.
Each element below replaces its Mosaic counterpart solely to turn the positional children argument into ?children with a trailing unit. All other arguments, defaults, and semantics are identical to Mosaic; refer to the corresponding entry there for details.
For text-based elements (text, code, markdown) children is string list whose items are concatenated.
Like Mosaic.fragment. children defaults to [].
val box :
?key:string ->
?id:string ->
?display:Display.t ->
?box_sizing:Box_sizing.t ->
?position:Position.t ->
?overflow:Overflow.t point ->
?scrollbar_width:float ->
?text_align:Text_align.t ->
?inset:length_percentage_auto rect ->
?flex_direction:Flex_direction.t ->
?flex_wrap:Flex_wrap.t ->
?justify_content:Justify.t ->
?align_items:Align.t ->
?size:dimension size ->
?min_size:dimension size ->
?max_size:dimension size ->
?aspect_ratio:float ->
?gap:length_percentage size ->
?padding:length_percentage rect ->
?margin:length_percentage_auto rect ->
?border_width:length_percentage rect ->
?align_self:Align.t ->
?align_content:Justify.t ->
?justify_items:Align.t ->
?justify_self:Align.t ->
?flex_grow:float ->
?flex_shrink:float ->
?flex_basis:dimension ->
?grid_template_rows:Grid.template list ->
?grid_template_columns:Grid.template list ->
?grid_auto_rows:Grid.track list ->
?grid_auto_columns:Grid.track list ->
?grid_auto_flow:Grid_auto_flow.t ->
?grid_template_areas:Grid.area list ->
?grid_template_column_names:string list list ->
?grid_template_row_names:string list list ->
?grid_row:Grid.placement line ->
?grid_column:Grid.placement line ->
?visible:bool ->
?z_index:int ->
?opacity:float ->
?focusable:bool ->
?autofocus:bool ->
?buffered:bool ->
?live:bool ->
?ref:(Mosaic_ui.Renderable.t -> unit) ->
?on_mouse:(Event.mouse -> 'msg option) ->
?on_key:(Event.key -> 'msg option) ->
?on_paste:(Event.paste -> 'msg option) ->
?border:bool ->
?border_style:Border.t ->
?border_sides:Border.side list ->
?border_color:Ansi.Color.t ->
?focused_border_color:Ansi.Color.t ->
?background:Ansi.Color.t ->
?fill:bool ->
?title:string ->
?title_alignment:[ `Left | `Center | `Right ] ->
?children:'msg t list ->
unit ->
'msg tLike Mosaic.box. children defaults to [].
val text :
?key:string ->
?id:string ->
?display:Display.t ->
?box_sizing:Box_sizing.t ->
?position:Position.t ->
?overflow:Overflow.t point ->
?scrollbar_width:float ->
?text_align:Text_align.t ->
?inset:length_percentage_auto rect ->
?flex_direction:Flex_direction.t ->
?flex_wrap:Flex_wrap.t ->
?justify_content:Justify.t ->
?align_items:Align.t ->
?size:dimension size ->
?min_size:dimension size ->
?max_size:dimension size ->
?aspect_ratio:float ->
?gap:length_percentage size ->
?padding:length_percentage rect ->
?margin:length_percentage_auto rect ->
?border_width:length_percentage rect ->
?align_self:Align.t ->
?align_content:Justify.t ->
?justify_items:Align.t ->
?justify_self:Align.t ->
?flex_grow:float ->
?flex_shrink:float ->
?flex_basis:dimension ->
?grid_template_rows:Grid.template list ->
?grid_template_columns:Grid.template list ->
?grid_auto_rows:Grid.track list ->
?grid_auto_columns:Grid.track list ->
?grid_auto_flow:Grid_auto_flow.t ->
?grid_template_areas:Grid.area list ->
?grid_template_column_names:string list list ->
?grid_template_row_names:string list list ->
?grid_row:Grid.placement line ->
?grid_column:Grid.placement line ->
?style:Ansi.Style.t ->
?visible:bool ->
?z_index:int ->
?opacity:float ->
?focusable:bool ->
?autofocus:bool ->
?buffered:bool ->
?live:bool ->
?ref:(Mosaic_ui.Renderable.t -> unit) ->
?on_mouse:(Event.mouse -> 'msg option) ->
?on_key:(Event.key -> 'msg option) ->
?on_paste:(Event.paste -> 'msg option) ->
?text_style:Ansi.Style.t ->
?wrap:Text_surface.wrap ->
?selectable:bool ->
?selection_bg:Ansi.Color.t ->
?selection_fg:Ansi.Color.t ->
?tab_width:int ->
?truncate:bool ->
?children:string list ->
unit ->
'msg tLike Mosaic.span.text. children is a string list whose items are concatenated. Defaults to [].
val scroll_box :
?key:string ->
?id:string ->
?display:Display.t ->
?box_sizing:Box_sizing.t ->
?position:Position.t ->
?overflow:Overflow.t point ->
?scrollbar_width:float ->
?text_align:Text_align.t ->
?inset:length_percentage_auto rect ->
?flex_direction:Flex_direction.t ->
?flex_wrap:Flex_wrap.t ->
?justify_content:Justify.t ->
?align_items:Align.t ->
?size:dimension size ->
?min_size:dimension size ->
?max_size:dimension size ->
?aspect_ratio:float ->
?gap:length_percentage size ->
?padding:length_percentage rect ->
?margin:length_percentage_auto rect ->
?border_width:length_percentage rect ->
?align_self:Align.t ->
?align_content:Justify.t ->
?justify_items:Align.t ->
?justify_self:Align.t ->
?flex_grow:float ->
?flex_shrink:float ->
?flex_basis:dimension ->
?grid_template_rows:Grid.template list ->
?grid_template_columns:Grid.template list ->
?grid_auto_rows:Grid.track list ->
?grid_auto_columns:Grid.track list ->
?grid_auto_flow:Grid_auto_flow.t ->
?grid_template_areas:Grid.area list ->
?grid_template_column_names:string list list ->
?grid_template_row_names:string list list ->
?grid_row:Grid.placement line ->
?grid_column:Grid.placement line ->
?visible:bool ->
?z_index:int ->
?opacity:float ->
?focusable:bool ->
?autofocus:bool ->
?buffered:bool ->
?live:bool ->
?ref:(Mosaic_ui.Renderable.t -> unit) ->
?on_mouse:(Event.mouse -> 'msg option) ->
?on_key:(Event.key -> 'msg option) ->
?on_paste:(Event.paste -> 'msg option) ->
?scroll_x:bool ->
?scroll_y:bool ->
?sticky_scroll:bool ->
?sticky_start:[ `Top | `Bottom | `Left | `Right ] ->
?background:Ansi.Color.t ->
?on_scroll:(x:int -> y:int -> 'msg option) ->
?children:'msg t list ->
unit ->
'msg tLike Mosaic.scroll_box. children defaults to [].
val code :
?key:string ->
?id:string ->
?display:Display.t ->
?box_sizing:Box_sizing.t ->
?position:Position.t ->
?overflow:Overflow.t point ->
?scrollbar_width:float ->
?text_align:Text_align.t ->
?inset:length_percentage_auto rect ->
?flex_direction:Flex_direction.t ->
?flex_wrap:Flex_wrap.t ->
?justify_content:Justify.t ->
?align_items:Align.t ->
?size:dimension size ->
?min_size:dimension size ->
?max_size:dimension size ->
?aspect_ratio:float ->
?gap:length_percentage size ->
?padding:length_percentage rect ->
?margin:length_percentage_auto rect ->
?border_width:length_percentage rect ->
?align_self:Align.t ->
?align_content:Justify.t ->
?justify_items:Align.t ->
?justify_self:Align.t ->
?flex_grow:float ->
?flex_shrink:float ->
?flex_basis:dimension ->
?grid_template_rows:Grid.template list ->
?grid_template_columns:Grid.template list ->
?grid_auto_rows:Grid.track list ->
?grid_auto_columns:Grid.track list ->
?grid_auto_flow:Grid_auto_flow.t ->
?grid_template_areas:Grid.area list ->
?grid_template_column_names:string list list ->
?grid_template_row_names:string list list ->
?grid_row:Grid.placement line ->
?grid_column:Grid.placement line ->
?visible:bool ->
?z_index:int ->
?opacity:float ->
?focusable:bool ->
?autofocus:bool ->
?buffered:bool ->
?live:bool ->
?ref:(Mosaic_ui.Renderable.t -> unit) ->
?on_mouse:(Event.mouse -> 'msg option) ->
?on_key:(Event.key -> 'msg option) ->
?on_paste:(Event.paste -> 'msg option) ->
?spans:span list ->
?text_style:Ansi.Style.t ->
?wrap:Text_surface.wrap ->
?tab_width:int ->
?selectable:bool ->
?selection_bg:Ansi.Color.t ->
?selection_fg:Ansi.Color.t ->
?on_selection:((int * int) option -> 'msg option) ->
?children:string list ->
unit ->
'msg tLike Mosaic.code. children is a string list whose items are concatenated. Defaults to [].
val markdown :
?key:string ->
?id:string ->
?display:Display.t ->
?box_sizing:Box_sizing.t ->
?position:Position.t ->
?overflow:Overflow.t point ->
?scrollbar_width:float ->
?text_align:Text_align.t ->
?inset:length_percentage_auto rect ->
?flex_direction:Flex_direction.t ->
?flex_wrap:Flex_wrap.t ->
?justify_content:Justify.t ->
?align_items:Align.t ->
?size:dimension size ->
?min_size:dimension size ->
?max_size:dimension size ->
?aspect_ratio:float ->
?gap:length_percentage size ->
?padding:length_percentage rect ->
?margin:length_percentage_auto rect ->
?border_width:length_percentage rect ->
?align_self:Align.t ->
?align_content:Justify.t ->
?justify_items:Align.t ->
?justify_self:Align.t ->
?flex_grow:float ->
?flex_shrink:float ->
?flex_basis:dimension ->
?grid_template_rows:Grid.template list ->
?grid_template_columns:Grid.template list ->
?grid_auto_rows:Grid.track list ->
?grid_auto_columns:Grid.track list ->
?grid_auto_flow:Grid_auto_flow.t ->
?grid_template_areas:Grid.area list ->
?grid_template_column_names:string list list ->
?grid_template_row_names:string list list ->
?grid_row:Grid.placement line ->
?grid_column:Grid.placement line ->
?visible:bool ->
?z_index:int ->
?opacity:float ->
?focusable:bool ->
?autofocus:bool ->
?buffered:bool ->
?live:bool ->
?ref:(Mosaic_ui.Renderable.t -> unit) ->
?on_mouse:(Event.mouse -> 'msg option) ->
?on_key:(Event.key -> 'msg option) ->
?on_paste:(Event.paste -> 'msg option) ->
?md_style:Markdown.style ->
?conceal:bool ->
?streaming:bool ->
?children:string list ->
unit ->
'msg tLike Mosaic.markdown. children is a string list whose items are concatenated. Defaults to [].
val input :
?key:string ->
?id:string ->
?display:Display.t ->
?box_sizing:Box_sizing.t ->
?position:Position.t ->
?overflow:Overflow.t point ->
?scrollbar_width:float ->
?text_align:Text_align.t ->
?inset:length_percentage_auto rect ->
?flex_direction:Flex_direction.t ->
?flex_wrap:Flex_wrap.t ->
?justify_content:Justify.t ->
?align_items:Align.t ->
?size:dimension size ->
?min_size:dimension size ->
?max_size:dimension size ->
?aspect_ratio:float ->
?gap:length_percentage size ->
?padding:length_percentage rect ->
?margin:length_percentage_auto rect ->
?border_width:length_percentage rect ->
?align_self:Align.t ->
?align_content:Justify.t ->
?justify_items:Align.t ->
?justify_self:Align.t ->
?flex_grow:float ->
?flex_shrink:float ->
?flex_basis:dimension ->
?grid_template_rows:Grid.template list ->
?grid_template_columns:Grid.template list ->
?grid_auto_rows:Grid.track list ->
?grid_auto_columns:Grid.track list ->
?grid_auto_flow:Grid_auto_flow.t ->
?grid_template_areas:Grid.area list ->
?grid_template_column_names:string list list ->
?grid_template_row_names:string list list ->
?grid_row:Grid.placement line ->
?grid_column:Grid.placement line ->
?visible:bool ->
?z_index:int ->
?opacity:float ->
?focusable:bool ->
?autofocus:bool ->
?buffered:bool ->
?live:bool ->
?ref:(Mosaic_ui.Renderable.t -> unit) ->
?on_mouse:(Event.mouse -> 'msg option) ->
?on_key:(Event.key -> 'msg option) ->
?on_paste:(Event.paste -> 'msg option) ->
?value:string ->
?cursor:int ->
?selection:(int * int) option ->
?placeholder:string ->
?max_length:int ->
?text_color:Ansi.Color.t ->
?background_color:Ansi.Color.t ->
?focused_text_color:Ansi.Color.t ->
?focused_background_color:Ansi.Color.t ->
?placeholder_color:Ansi.Color.t ->
?selection_color:Ansi.Color.t ->
?selection_fg:Ansi.Color.t ->
?cursor_style:[ `Block | `Line | `Underline ] ->
?cursor_color:Ansi.Color.t ->
?cursor_blinking:bool ->
?on_input:(string -> 'msg option) ->
?on_change:(string -> 'msg option) ->
?on_submit:(string -> 'msg option) ->
?on_cursor:(cursor:int -> selection:(int * int) option -> 'msg option) ->
?children:'msg t list ->
unit ->
'msg tLike Mosaic.input. children defaults to [].
val textarea :
?key:string ->
?id:string ->
?display:Display.t ->
?box_sizing:Box_sizing.t ->
?position:Position.t ->
?overflow:Overflow.t point ->
?scrollbar_width:float ->
?text_align:Text_align.t ->
?inset:length_percentage_auto rect ->
?flex_direction:Flex_direction.t ->
?flex_wrap:Flex_wrap.t ->
?justify_content:Justify.t ->
?align_items:Align.t ->
?size:dimension size ->
?min_size:dimension size ->
?max_size:dimension size ->
?aspect_ratio:float ->
?gap:length_percentage size ->
?padding:length_percentage rect ->
?margin:length_percentage_auto rect ->
?border_width:length_percentage rect ->
?align_self:Align.t ->
?align_content:Justify.t ->
?justify_items:Align.t ->
?justify_self:Align.t ->
?flex_grow:float ->
?flex_shrink:float ->
?flex_basis:dimension ->
?grid_template_rows:Grid.template list ->
?grid_template_columns:Grid.template list ->
?grid_auto_rows:Grid.track list ->
?grid_auto_columns:Grid.track list ->
?grid_auto_flow:Grid_auto_flow.t ->
?grid_template_areas:Grid.area list ->
?grid_template_column_names:string list list ->
?grid_template_row_names:string list list ->
?grid_row:Grid.placement line ->
?grid_column:Grid.placement line ->
?visible:bool ->
?z_index:int ->
?opacity:float ->
?focusable:bool ->
?autofocus:bool ->
?buffered:bool ->
?live:bool ->
?ref:(Mosaic_ui.Renderable.t -> unit) ->
?on_mouse:(Event.mouse -> 'msg option) ->
?on_key:(Event.key -> 'msg option) ->
?on_paste:(Event.paste -> 'msg option) ->
?value:string ->
?cursor:int ->
?selection:(int * int) option ->
?spans:Mosaic.span list ->
?ghost_text:string ->
?ghost_text_color:Ansi.Color.t ->
?placeholder:string ->
?wrap:Text_surface.wrap ->
?text_color:Ansi.Color.t ->
?background_color:Ansi.Color.t ->
?focused_text_color:Ansi.Color.t ->
?focused_background_color:Ansi.Color.t ->
?placeholder_color:Ansi.Color.t ->
?selection_color:Ansi.Color.t ->
?selection_fg:Ansi.Color.t ->
?cursor_style:[ `Block | `Line | `Underline ] ->
?cursor_color:Ansi.Color.t ->
?cursor_blinking:bool ->
?on_input:(string -> 'msg option) ->
?on_change:(string -> 'msg option) ->
?on_submit:(string -> 'msg option) ->
?on_cursor:(cursor:int -> selection:(int * int) option -> 'msg option) ->
?children:'msg t list ->
unit ->
'msg tLike Mosaic.textarea. children defaults to [].
val line_number :
?key:string ->
?id:string ->
?display:Display.t ->
?box_sizing:Box_sizing.t ->
?position:Position.t ->
?overflow:Overflow.t point ->
?scrollbar_width:float ->
?text_align:Text_align.t ->
?inset:length_percentage_auto rect ->
?flex_direction:Flex_direction.t ->
?flex_wrap:Flex_wrap.t ->
?justify_content:Justify.t ->
?align_items:Align.t ->
?size:dimension size ->
?min_size:dimension size ->
?max_size:dimension size ->
?aspect_ratio:float ->
?gap:length_percentage size ->
?padding:length_percentage rect ->
?margin:length_percentage_auto rect ->
?border_width:length_percentage rect ->
?align_self:Align.t ->
?align_content:Justify.t ->
?justify_items:Align.t ->
?justify_self:Align.t ->
?flex_grow:float ->
?flex_shrink:float ->
?flex_basis:dimension ->
?grid_template_rows:Grid.template list ->
?grid_template_columns:Grid.template list ->
?grid_auto_rows:Grid.track list ->
?grid_auto_columns:Grid.track list ->
?grid_auto_flow:Grid_auto_flow.t ->
?grid_template_areas:Grid.area list ->
?grid_template_column_names:string list list ->
?grid_template_row_names:string list list ->
?grid_row:Grid.placement line ->
?grid_column:Grid.placement line ->
?visible:bool ->
?z_index:int ->
?opacity:float ->
?focusable:bool ->
?autofocus:bool ->
?buffered:bool ->
?live:bool ->
?ref:(Mosaic_ui.Renderable.t -> unit) ->
?on_mouse:(Event.mouse -> 'msg option) ->
?on_key:(Event.key -> 'msg option) ->
?on_paste:(Event.paste -> 'msg option) ->
?fg:Ansi.Color.t ->
?bg:Ansi.Color.t ->
?min_width:int ->
?padding_right:int ->
?show_line_numbers:bool ->
?line_number_offset:int ->
?line_colors:(int * Line_number.line_color) list ->
?line_signs:(int * Line_number.line_sign) list ->
?hidden_line_numbers:int list ->
?children:'msg t list ->
unit ->
'msg tLike Mosaic.line_number. children defaults to []; pass the wrapped element (e.g. a code) as a single-item list.