Home | Hello world | Component | Pursx 1 | Events 1 | Effects | Pursx 2 | Events 2 | Portals | SSR |

PursX 1

Like JSX... but better!

Writing out PureScript code for the DOM only really makes sense if you're doing some sort of interesting manipulations on the JS layer. Otherwise, it's pretty tedious and longer than HTML. Thankfully, there's a solution: PursX.

PursX takes its name from JSX and it accomplishes a similar goal: the ability to embed HTML in your document. In the example below, we create the same exact component from the previous article, but in PursX.

Here's what it produces:

Puurrrrrr ...sx

Static Pursx (meaning Pursx without any dynamic content) can be activated with the function psx.

Next steps

In this section, we used PursX to build the same component as the previous section. In the next section, we'll learn how to respond to events.