howtomakeaname/sumi/overlays does not have a README file
pub(all) struct CheckboxMenuGroup {
title : String?
clear_label : String?
on_clear : Cmd?
items : Array[CheckboxMenuItem]
}fn CheckboxMenuGroup::new(items : Array[CheckboxMenuItem], title? : String, clear_label? : String, on_clear? : Cmd) -> CheckboxMenuGrouppub(all) struct CheckboxMenuItem {
value : String
label : String
icon : Html?
checked : Bool
disabled : Bool
}fn CheckboxMenuItem::new(value : String, label : String, icon? : Html, checked? : Bool, disabled? : Bool) -> CheckboxMenuItempub(all) struct MenuItem {
value : String
label : String
description : String?
icon : Html?
shortcut : String?
disabled : Bool
}checkbox_menu(
groups=[
CheckboxMenuGroup::new(
[
CheckboxMenuItem::new("text", "Text", checked=true),
CheckboxMenuItem::new("date", "Date"),
],
title="Fields",
clear_label="Clear",
on_clear=clear_fields,
),
],
on_toggle=toggle_field.map(v => _ => v),
)context_menu(
entries=[
Item(MenuItem::new("rename", "Rename", shortcut="R")),
Separator,
Item(MenuItem::new("delete", "Delete", shortcut="⌫")),
],
open=ctx_open,
on_open_change=set_ctx_open.map(v => _ => v),
on_select=set_action.map(v => _ => v),
[canvas_card],
)fn dropdown_menu(items~ : Array[MenuEntry], trigger~ : Html, open~ : Bool, on_open_change? : Emit[Bool], selected? : String, on_select? : Emit[String], align? : MenuAlign, side? : MenuSide, id? : String, class? : String, attrs? : Attrs, style? : Array[String], trigger_style? : Array[String], menu_style? : Array[String]) -> Htmldropdown_menu(
trigger=button(variant=Ghost, [text(model_label), menu_chevron()]),
open=menu_open,
on_open_change=set_menu_open.map(v => _ => v),
items=MenuEntry::items([MenuItem::new("sd", "Sketch Diffusion")]),
selected=model,
on_select=set_model.map(v => _ => v),
)popover(
trigger=button(variant=Ghost, [text("16:9 · 2K"), menu_chevron()]),
open=panel_open,
on_open_change=set_panel_open.map(v => _ => v),
[my_panel_content],
)fn toast(message~ : String, open~ : Bool, variant? : ToastVariant, on_close? : Cmd, id? : String, class? : String, attrs? : Attrs, style? : Array[String]) -> Html// show for 2.4s
@cmd.batch([set_toast(_ => true), @cmd.delay(set_toast(_ => false), 2400)])fn[C : IsChildren] tooltip(content~ : String, side? : TooltipSide, id? : String, class? : String, attrs? : Attrs, style? : Array[String], children : C) -> Htmltooltip(content="Upscale to 4K", button(variant=Ghost, "4K"))Install
Download zipA UI component library for MoonBit web apps — dark & light themes, overlay motion, zero config
Dependencies