package bonsai

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type 'a t = private {
  1. f : 'a -> unit Ui_effect.t;
  2. handle_enter : bool;
  3. button_text : string option;
  4. button_attr : Bonsai_web.Vdom.Attr.t;
  5. button_location : View.button_location;
}

Creates a "submit" handler, which is intended to be used by the view_as_vdom function.

  • handle_enter: when true, will render the form inside of a <form> element, which gives us the ability to add an "on_submit" handler which detecs people hitting "enter" when a form element is focused. The default is true. Set it to false to disable this behavior.
  • button: When Some, will append a button with the label given by its contents. will be added to the end of the form. If the form is currently invalid, the button will be disabled. The default is Some "Submit". Explicitly set it to None to remove the button entirely.
  • button_attr: A Vdom.Attr.t to attach to the submit button.
  • f: the function which is run when the form is submitted.
val create : ?handle_enter:bool -> ?button:string option -> ?button_attr:Bonsai_web.Vdom.Attr.t -> ?button_location:View.button_location -> f:('a -> unit Ui_effect.t) -> unit -> 'a t
OCaml

Innovation. Community. Security.