package bonsai

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

Module Bonsai_web_ui_typeahead.TypeaheadSource

These controls come unstyled by default. jane-web-style provides css that will make the control and option pills pretty.

Sourcetype 'a t = {
  1. selected : 'a;
  2. set_selected : 'a -> unit Ui_effect.t;
  3. current_input : string;
  4. view : Bonsai_web.Vdom.Node.t;
}

A 'a t represents a typeahead whose value has type 'a.

current_input gives access to the current contents of the form's <input> element

Sourceval create : ?extra_attrs:Bonsai_web.Vdom.Attr.t list Bonsai_web.Value.t -> ?placeholder:string -> ?on_select_change:('a option -> unit Ui_effect.t) Bonsai_web.Value.t -> ?to_string:('a -> string) Bonsai_web.Value.t -> ?to_option_description:('a -> string) Bonsai_web.Value.t -> ?handle_unknown_option:(string -> 'a option) Bonsai_web.Value.t -> (module Bonsai_web.Bonsai.Model with type t = 'a) -> all_options:'a list Bonsai_web.Value.t -> 'a option t Bonsai_web.Computation.t

create returns a typeahead using native browser controls.

to_option_description if provided will render the description provided below the option.

Sourceval create_multi : ?extra_attrs:Bonsai_web.Vdom.Attr.t list Bonsai_web.Value.t -> ?placeholder:string -> ?on_set_change:(('a, 'cmp) Core.Set.t -> unit Ui_effect.t) Bonsai_web.Value.t -> ?to_string:('a -> string) Bonsai_web.Value.t -> ?to_option_description:('a -> string) Bonsai_web.Value.t -> ?handle_unknown_option:(string -> 'a option) Bonsai_web.Value.t -> ?split:(string -> string list) -> ('a, 'cmp) Bonsai_web.Bonsai.comparator -> all_options:'a list Bonsai_web.Value.t -> ('a, 'cmp) Core.Set.t t Bonsai_web.Computation.t
Sourcemodule Private : sig ... end