package mosaic

  1. Overview
  2. Docs
Terminal UI framework for OCaml with The Elm Architecture

Install

dune-project
 Dependency

Authors

Maintainers

Sources

mosaic-0.1.0.tbz
sha256=9e4e90d17f9b2af1b07071fe425bc2c519c849c4f1d1ab73cde512be2d874849
sha512=06e9c4a741590942e81a27738d0b5c0413fafec8cf3b7dae047ad69f155e7b718aa4223818dc161b7d028efffcfd3365905e264d6fd31d453910ddfa91dcf9b9

doc/mosaic.mlx/Mosaic_mlx/Grid/index.html

Module Mosaic_mlx.GridSource

Grid layout constructors for defining tracks and placing items.

  box ~display:Display.Grid
    ~grid_template_columns:[ Grid.length 20.; Grid.fr 1.; Grid.fr 1. ]
    ~grid_template_rows:[ Grid.length 3.; Grid.fr 1.; Grid.length 3. ]
    ~grid_row:(Grid.line_range 1 2) ~grid_column:(Grid.line_range 1 4)
    [...]

Grid template components

Values for ~grid_template_columns and ~grid_template_rows.

Sourcetype template = Toffee.Style.grid_template_component

A grid template component (single track or repeat clause).

Sourceval fr : float -> template

fr n is a flexible track taking n fractional units of remaining space.

Sourceval length : float -> template

length n is a fixed-width track of n cells.

Sourceval percent : float -> template

percent n is a percentage-width track (0.0 to 1.0 range).

Sourceval auto : template

auto is an auto-sized track.

Sourceval min_content : template

min_content is a track sized to the minimum content width.

Sourceval max_content : template

max_content is a track sized to the maximum content width.

Sourceval fit_content : Toffee.Style.Compact_length.t -> template

fit_content limit is a track clamped between min-content and limit.

Sourceval minmax : min:Toffee.Style.Compact_length.t -> max:Toffee.Style.Compact_length.t -> template

minmax ~min ~max is a track that sizes between min and max.

Grid placement

Values for ~grid_row and ~grid_column.

Sourcetype placement = Toffee.Style.grid_placement

A grid placement specification for a single axis endpoint.

Sourceval line : int -> placement

line n places at grid line n (1-indexed, negative from end).

Sourceval span : int -> placement

span n spans n tracks from the opposite endpoint.

Sourceval auto_placement : placement

auto_placement uses the auto-placement algorithm.

Sourceval line_range : int -> int -> placement line

line_range s e is a placement from line s to line e. Shorthand for { start = line s; end_ = line e }.

Sourceval span_range : int -> int -> placement line

span_range s n places starting at line s and spanning n tracks. Shorthand for { start = line s; end_ = span n }.

Track sizing functions

Values for ~grid_auto_rows and ~grid_auto_columns.

Sourcetype track = Toffee.Style.track_sizing_function

A track sizing function for auto rows/columns.

Sourceval track_fr : float -> track

track_fr n is a flexible track of n fractional units.

Sourceval track_length : float -> track

track_length n is a fixed-length track of n cells.

Sourceval track_percent : float -> track

track_percent n is a percentage-width track (0.0 to 1.0 range).

Sourceval track_auto : track

track_auto is an auto-sized track.

Sourceval track_min_content : track

track_min_content is a track sized to the minimum content width.

Sourceval track_max_content : track

track_max_content is a track sized to the maximum content width.

Grid template areas

Sourcetype area = Toffee.Style.grid_template_area

A named grid template area.