aboutsummaryrefslogtreecommitdiff
path: root/examples/01-hello-world/src/app.gleam
blob: 57b9492b841091dfc52540aa162fd6d4a841e160 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import lustre
import lustre/attribute
import lustre/element
import lustre/element/html
import lustre/ui

pub fn main() {
  let styles = [#("width", "100vw"), #("height", "100vh"), #("padding", "1rem")]
  let app =
    lustre.element(ui.centre(
      [attribute.style(styles)],
      html.div([], [
        html.h1([], [element.text("Hello, world.")]),
        html.h2([], [element.text("Welcome to Lustre.")]),
      ]),
    ))
  let assert Ok(_) = lustre.start(app, "#app", Nil)

  Nil
}