Packages

An easy to use frontend framework written in Gleam.

Current section

Files

Jump to
novdom src novdom.gleam
Raw

src/novdom.gleam

import novdom/hotkey
import novdom/internals/component.{type Component}
import novdom/parameter/motion
/// Start the application. This function should be called in the main file of the application. \
/// The given component will be rendered in the viewport.
pub fn start(component: fn() -> Component) -> Nil {
init_js()
motion.init()
hotkey.init()
component()
|> component.add_to_viewport("_app_")
}
@external(javascript, "./document_ffi.mjs", "init")
fn init_js() -> Nil