🍜 A tasty Haskell UI framework 🍜

The React framework for Haskell.

miso is a fast, composable Haskell library for building web and native user interfaces. Compiles to WebAssembly or JavaScript.

Copied
$git clone https://github.com/haskell-miso/miso-sampler && cd miso-sampler
$nix develop .#wasm --command bash -c 'make all && make serve'

Web

Compile to WebAssembly or JavaScript. Virtual DOM, event delegation, hydration and server-side rendering out of the box.

Coming soon

Desktop

Lynxtron brings Lynx to the desktop, Electron-style. The same miso components will run there unchanged.

Your first miso application 🍜

A model, an update function and a view. That is a Component, and a whole application.

Main.hs
import Miso
  ( Component, Effect, View, component
  , vfrag, text, startApp, defaultEvents
  )
import Miso.Lens (this, (+=), (-=))
import Miso.String (ms)
import Miso.Html.Element (button_)
import Miso.Html.Event (onClick)

data Action = Add | Subtract

counter
  :: Component context props Int Action
counter = component m u v
  where
    m :: Int
    m = 0

    u :: Action
      -> Effect context props Int Action
    u = \case
      Add      -> this += 1
      Subtract -> this -= 1

    v :: context
      -> props
      -> Int
      -> View context Int Action
    v _ _ n = vfrag
      [ button_ [ onClick Subtract ] [ "−" ]
      , text (ms n)
      , button_ [ onClick Add ] [ "+" ]
      ]

main :: IO ()
main = startApp defaultEvents counter
Live
0

What's in the box

miso borrows the best ideas from React and Elm and gives them Haskell types.

Generative AI ready

miso was built in 2016. The simplicity of the DSL makes it ideal for code generation tools like Claude, Codex, Kimi K3, etc.

✦ Agent-friendly by design · 100% miso

Batteries included 🔋

Games, browser API demos, integrations and libraries, all written in miso.