Elmish

Elmish provides core abstractions that you can use to build F# applications following the model view update style of architecture.

Learn more →

open Feliz
open Elmish

type Model =
    { Value : string }

type Msg =
    | ChangeValue of string

let init () =
    { Value = "" }, Cmd.none

let update (msg:Msg) (model:Model) =
    match msg with
    | ChangeValue newValue ->
        { model with Value = newValue }, Cmd.none

let view model dispatch =
    Html.div [
        Html.input [
            prop.value model.Value
            prop.onChange (fun value ->
                value |> ChangeValue |> dispatch
            )
        ]

        Html.span [
            prop.text $"Hello, %s{model.Value}!"
        ]
    ]

Elmish.React

Build React and ReactNative apps with elmish.

Learn more →

open Feliz

let view model dispatch =
    Html.div [
        Html.input [
            prop.value model.Value
            prop.onChange (fun value ->
                value |> ChangeValue |> dispatch
            )
        ]

        Html.span [
            prop.text $"Hello, %s{model.Value}!"
        ]
    ]

Elmish.Browser

Implements routing and navigation for elmish apps targeting the browser (SPAs).

Learn more →

open Elmish
// Make the program support navigation
open Elmish.Navigation

Program.mkProgram init update view
|> Program.toNavigable parser urlUpdate
|> Program.run

// Usage

let update model msg =
    match msg with
    | GoToTutorial ->
        // Built-in function to manipulate location
        model, Navigation.newUrl "tutorial"

Developer experience


Examples