package bonsai

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type 'a t

A 'a Col.t represents a column (or set of columns) that defines a way to render cells from a row in the table that has type 'a.

val make : ?cell_attr:('b -> Virtual_dom.Vdom.Attr.t) -> ?header_attr:Virtual_dom.Vdom.Attr.t -> string -> get:('a -> 'b) -> render:(Theme.t -> 'b -> Virtual_dom.Vdom.Node.t) -> 'a t

make builds a column for a row 'a by providing a getter 'a -> 'b and a renderer for the 'b. The first parameter is a string that is used for the label of the column.

header_attr is an optional attribute attached to the <th> element containing the label.

cell_attr is for building attribute that will be attached to the <td> element containing the rendered content of the cell.

val make_opt : ?cell_attr:('b -> Virtual_dom.Vdom.Attr.t) -> ?header_attr:Virtual_dom.Vdom.Attr.t -> string -> get:('a -> 'b option) -> render:(Theme.t -> 'b -> Virtual_dom.Vdom.Node.t) -> 'a t

make_opt is the same as make except that the return value from get can be an option

val group : ?header_attr:Virtual_dom.Vdom.Attr.t -> string -> 'a t list -> 'a t

group produces a column group over the provided list of columns with the string parameter being used as the label for the group.

header_attr behaves the same as it does for the make function

val lift : 'a t -> f:('b -> 'a) -> 'b t

The remaining "prime" functions in this module are identical to their "non-prime" versions except that the "label" argument is an arbitrary Vdom node.

val make' : ?cell_attr:('b -> Virtual_dom.Vdom.Attr.t) -> ?header_attr:Virtual_dom.Vdom.Attr.t -> Virtual_dom.Vdom.Node.t -> get:('a -> 'b) -> render:(Theme.t -> 'b -> Virtual_dom.Vdom.Node.t) -> 'a t
val group' : ?header_attr:Virtual_dom.Vdom.Attr.t -> Virtual_dom.Vdom.Node.t -> 'a t list -> 'a t
val make_opt' : ?cell_attr:('b -> Virtual_dom.Vdom.Attr.t) -> ?header_attr:Virtual_dom.Vdom.Attr.t -> Virtual_dom.Vdom.Node.t -> get:('a -> 'b option) -> render:(Theme.t -> 'b -> Virtual_dom.Vdom.Node.t) -> 'a t
OCaml

Innovation. Community. Security.