package bonsai
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
A library for building dynamic webapps, using Js_of_ocaml
Install
dune-project
Dependency
Authors
Maintainers
Sources
v0.17.0.tar.gz
sha256=c78c4476ee6b856846e2d0941e5965009d5e1b853e564b2b1bee61202f0b1ebb
doc/src/bonsai.kado/tabs.ml.html
Source file tabs.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19open! Core open! Import module Style = Tabs_style let make ~attrs ~per_tab_attrs ~on_change ~equal ~active tabs = List.map tabs ~f:(fun (i, tab) -> let is_active = equal active i in let classes = if is_active then [ Style.tab_button; Style.selected ] else [ Style.tab_button ] in let on_click = Vdom.Attr.on_click (fun _ -> if equal i active then Effect.Ignore else on_change ~from:active ~to_:i) in Vdom.Node.div ~attrs:(classes @ [ on_click; Vdom.Attr.many (per_tab_attrs i ~is_active) ]) [ tab ]) |> View.hbox ~attrs:(Style.tab_container :: attrs) ~gap:(`Em_float 0.5) ;;
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>