Toolkit

Home

Doc

Eliom

Js_of_ocaml

Lwt

Tyxml

Start

Warning: Reason support is experimental. We are looking for beta-tester and contributors.

Server version Client version

# Module Ot_drawer

    module Ot_drawer : sig..end

## Drawer menu for mobile and Web applications ¶

    val drawer :
      ?a:[< Html_types.div_attrib ] Eliom_content.Html.attrib list ->
      ?position:[ `Left | `Right ] ->
      ?opened:bool ->
      ?swipe:bool ->
      ?onclose:(unit -> unit) Eliom_client_value.t ->
      ?onopen:(unit -> unit) Eliom_client_value.t ->
      ?wrap_close:((unit -> unit) Eliom_client_value.t ->
                   (unit -> unit) Eliom_client_value.t) ->
      ?wrap_open:((unit -> unit) Eliom_client_value.t ->
                  (unit -> unit) Eliom_client_value.t) ->
      [< Html_types.div_content ] Eliom_content.Html.elt list ->
      [> `Div ] Eliom_content.Html.elt *
      (unit -> unit) Eliom_client_value.t *
      (unit -> unit) Eliom_client_value.t

Build a drawer menu on the left or right of the screen. Returns the DOM element, and functions to open and close the menu.

If opened is true (false by default), the drawer is initialized in its opened state.

If swipe is true (default), the user can swipe to open or close the drawer.

If present, function onclose is called just after the drawer is closed, and function onopen just before it starts opening.

wrap_close and wrap_open can be used to customize calls to close and open_ functions when the drawer closing or opening is triggered. For example, drawer closing can be disabled using wrap_close .