aboutsummaryrefslogtreecommitdiff
path: root/examples/01-hello-world/src/app.gleam
diff options
context:
space:
mode:
Diffstat (limited to 'examples/01-hello-world/src/app.gleam')
-rw-r--r--examples/01-hello-world/src/app.gleam25
1 files changed, 10 insertions, 15 deletions
diff --git a/examples/01-hello-world/src/app.gleam b/examples/01-hello-world/src/app.gleam
index 38c1f68..57b9492 100644
--- a/examples/01-hello-world/src/app.gleam
+++ b/examples/01-hello-world/src/app.gleam
@@ -2,24 +2,19 @@ import lustre
import lustre/attribute
import lustre/element
import lustre/element/html
-// These examples are written with `lustre/ui` in mind. They'll work regardless,
-// but to see what `lustre/ui` can do make sure to run each of these examples with
-// the `--use-example-styles` flag:
-//
-// $ gleam run -m lustre/dev start --use-example-styles
-//
-// In your own apps, make sure to add the `lustre/ui` dependency and include the
-// stylesheet somewhere.
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)
- lustre.element(ui.centre(
- [attribute.style(styles)],
- html.div([], [
- html.h1([], [element.text("Hello, world.")]),
- html.h2([], [element.text("Welcome to Lustre.")]),
- ]),
- ))
+ Nil
}