Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Declarative UI in Elm (2026) @ Elm Camp

Declarative UI in Elm (2026) @ Elm Camp

Avatar for Ulric Wilfred

Ulric Wilfred

June 26, 2026

More Decks by Ulric Wilfred

Other Decks in Programming

Transcript

  1. 2026 by Anton Kotenko a.k.a. shamansir a.k.a. Elektrokiłka a.k.a. Ulric

    Wilfred a.k.a. ZokotuhaFly a.k.a. tungusso a.k.a. didsomeonereaditatall a.k.a. fi llthespacetothever DECLARATIVE UI IN ELM In Theory and in Practice of Declaring UIs in Different Projects… Such As Generative Art or Railroad Simulators or Whatever… It’s not That Html a is not Declarative… We’ll Discuss That in Few Minutes… UNTALK CERTIFIED UNPRESENTATION CERTIFIED UNSLIDES CERTIFIED ALLOWED TO BE USED AT UNCONFERENCES
  2. ├── div a │ ├─── span a │ ├─── form

    a │ │ ├─── input a │ │ ├─── select a │ │ │ ├─── option a │ │ │ ├─── option a │ │ │ ├─── option a │ │ │ ├─── option a │ │ ├─── toggle a │ │ ├─── button a
  3. ├── div () │ ├─── span () │ ├─── form

    (myFormData :: FormData) │ │ ├─── input (“Vorname”:: String) │ │ ├─── select (opt3 :: SelectVal) │ │ │ ├─── option (opt1 :: SelectVal) │ │ │ ├─── option (opt2 :: SelectVal) │ │ │ ├─── option (opt3 :: SelectVal) │ │ │ ├─── option (opt4 :: SelectVal) │ │ ├─── toggle (true :: Boolean) │ │ ├─── button ()
  4. ├── div () │ ├─── span () │ ├─── form

    (myFormData :: FormData) │ │ ├─── input (“Vorname”:: String) │ │ ├─── select (opt3 :: SelectVal) │ │ │ ├─── option (opt1 :: SelectVal) │ │ │ ├─── option (opt2 :: SelectVal) │ │ │ ├─── option (opt3 :: SelectVal) │ │ │ ├─── option (opt4 :: SelectVal) │ │ ├─── toggle (true :: Boolean) │ │ ├─── button ()
  5. ├── div () │ ├─── input (2 :: Int) │

    ├─── form (myFormData :: FormData) │ │ ├─── input (“Vorname”:: String) │ │ ├─── select (opt3 :: SelectVal) │ │ │ ├─── option (opt1 :: SelectVal) │ │ │ ├─── option (opt2 :: SelectVal) │ │ │ ├─── option (opt3 :: SelectVal) │ │ │ ├─── option (opt4 :: SelectVal) │ │ ├─── toggle (true :: Boolean) │ │ ├─── button ()
  6. ├── div () │ ├─── input (2 :: Int) │

    ├─── form (myFormData :: FormData) │ │ ├─── input (“Vorname”:: String) │ │ ├─── select (opt3 :: SelectVal) │ │ │ ├─── option (opt1 :: SelectVal) │ │ │ ├─── option (opt2 :: SelectVal) │ │ │ ├─── option (opt3 :: SelectVal) │ │ │ ├─── option (opt4 :: SelectVal) │ │ ├─── toggle (true :: Boolean) │ │ ├─── button ()
  7. https:// sharkdp.github.io /purescript-flare/ plot <$> (intSlider “Leaves” 2 10 6)

    <*> (boolean “Shadow” false) <*> (lift animationFrame)
  8. https:// sharkdp.github.io /purescript-isometric/ myPlot <$> (intSlider “Points” 0 60) <*>

    (intSlider “Wave” 0 60) myPlot <$> (intSlider “Rotation” 0 60) myPlot <$> (color “Cone Color” #CCEEDD) <*> (color “Cube Color” #CCEEFF)
  9. ├── Tron.root () │ ├─── Tron.int 0 100 (2 ::

    Int) │ ├─── Tron.nest (myFormData :: FormData) │ │ ├─── Tron.text (“Vorname”:: String) │ │ ├─── Tron.select (opts :: Array SelectVal) │ │ │ ├─── Tron.opt (opt1 :: SelectVal) │ │ │ ├─── Tron.opt (opt2 :: SelectVal) │ │ │ ├─── Tron.opt (opt3 :: SelectVal) │ │ │ ├─── Tron.opt (opt4 :: SelectVal) │ │ ├─── Tron.toggle (true :: Boolean) │ │ ├─── Tron.button ()
  10. ├── Tron.root () │ ├─── Tron.int 0 100 (2 ::

    Int) │ ├─── Tron.nest (myFormData :: FormData) │ │ ├─── Tron.text (“Vorname”:: String) │ │ ├─── Tron.select (opts :: Array SelectVal) │ │ │ ├─── Tron.opt (opt1 :: SelectVal) │ │ │ ├─── Tron.opt (opt2 :: SelectVal) │ │ │ ├─── Tron.opt (opt3 :: SelectVal) │ │ │ ├─── Tron.opt (opt4 :: SelectVal) │ │ ├─── Tron.toggle (true :: Boolean) │ │ ├─── Tron.button ()
  11. Tron.root () |> Tron.int 0 100 (2 :: Int) |>

    Tron.nest (myFormData :: FormData) |> Tron.text (“Vorname”:: String) |> Tron.select (opts :: Array SelectVal) |> Tron.opt (opt1 :: SelectVal) |> Tron.opt (opt2 :: SelectVal) |> Tron.opt (opt3 :: SelectVal) |> Tron.opt (opt4 :: SelectVal) |> Tron.toggle (true :: Boolean) |> Tron.button ()
  12. Tron.root () |> Tron.int 0 100 (2 :: Int) |>

    Tron.xy (0, 100) (0, 100) ((2, 10) :: Coord) |> Tron.colorRGB 10 20 65 (“#0A1451” :: Color) |> Tron.nest (myFormData :: FormData) |> Tron.text (“Vorname”:: String) |> Tron.select (opts :: Array SelectVal) |> Tron.opt (opt1 :: SelectVal) |> Tron.opt (opt2 :: SelectVal) |> Tron.opt (opt3 :: SelectVal) |> Tron.opt (opt4 :: SelectVal) |> Tron.toggle (true :: Boolean) |> Tron.button UploadFile ()