Deku logo

Introducing Deku.

A PureScript UI framework for building reactive games and web apps.

MyButton.purs
Result
01
02
03
04
05
06
myButton :: Nut
myButton =
  D.button
    [ buttonStyle, confettiClick ]
    [ text_ "Click me" ]

Introduction

Getting started

Hi 👋

You've found the documentation for PureScript Deku. If you got here by accident because you wanted to learn another UI framework, please consider staying, as Deku is really, really sweet.


Quick start

Whether you’re creating a greenfield project or integrating Deku into an existing application, we've got you covered!

Starting a new project

The easiest way to get up-and-running with Deku is to use create-deku-app via npx from your shell of choice.

npx create-deku-app@0.0.11 my-awesome-app

This will create a new Deku app in the directory my-awesome-app using a template with very opinionated sensible defaults.

Just by doing this, you already have a full-fledged Deku app at the tips of your fingers. You can fire it up like so.

$ cd my-awesome-app && npx spago build && npm run dev

Then, visit the link displayed in your terminal (usually http://localhost:5173) to see your site in action. It should bear an uncanny resemblance to the Hello world we’ll see on the next page.

Using an existing project

If you have an existing project that does not yet have PureScript installed, you can install PureScript and related tooling with the following command.

$ npm install -D purescript spago@next purs-tidy && npx spago init

Once PureScript is installed, or if you’re working from a project with PureScript already installed, you can install Deku with the following command.

$ npx spago install deku

Package sets

PureScript uses package sets to make sure that a codebase has a coherent set of packages. This documentation works for Deku version 0.12.0 onwards, so if you'd like to use most of the conventions from this documentation, make sure to work with a package set that's made on or after August 6, 2024 (AD). We're partial to 56.4.0. You can update your package set by running spago upgrade-set.

Why Deku

Deku was originally created to develop HTML5-based musical instruments. It has since been used to create several games and interactive websites.

If you’re building a game or a complex web app and would like to create it using a functional style of programming, Deku is a great fit! It is fast, accurate, and encourages the use of expressive and efficient patterns for building web apps.

This documentation was created with Deku and is available on GitHub. It was built with best practices in mind and is a useful reference for building larger applications, as is the Deku Real World project.


Getting help

Run into a snag? There are several ways you can get help!

Submit an issue

If you spot an issue with the Deku framework itself or if you have feature requests, please open an issue on the Deku issues page. If you find an issue in this documentation, please open an issue on the Deku Documentation issues page.

Join the community

Deku has a small but passionate community of framework users and developers that hang out on the FRP channel of the PureScript Discord. No question is too small, no Zelda-themed meme is too tangential. Come say hi!