package bonsai

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

Customizations allow you to use custom logic for leaves of your view/form generation. When a tagged sexp_grammar is encountered, apply_to_tag will be invoked on the tag's key and value. If apply_to_tag returns true, then the custom logic will be used in place of the default auto-generated logic.

Customizations based on individual fields within a record are not yet supported, only tags applied to entire types will match.

WARNING: Customization of auto-generated UIs/Forms is currently under development. Please do not take a dependency on customization logic if you are not ok with the API changing under your feet.

type 'a t
module Defaults : sig ... end

create_for_view allows you to specify a custom rendering function for a sexp value whose grammar includes the provided tag name.

val constant_form : (module Core.Sexpable with type t = 'a) -> apply_to_tag:(key:string -> value:Core.Sexp.t -> bool) -> 'a Form.t Bonsai_web.Computation.t -> form_transformer t

constant allows you to specify a form for the 'a that you're providing custom logic for. This form will be projected to Sexp.t, so that it can be used in the logic for form generation.

val transform_form : apply_to_tag:(key:string -> value:Core.Sexp.t -> bool) -> form_transformer -> form_transformer t
OCaml

Innovation. Community. Security.