DEV Community

Jouderian Nobre Junior
Jouderian Nobre Junior

Posted on

3 2

An elm-ui introduction

Once upon a time, the brave developers were used to use HTML and CSS to build their cool websites. The same idea was brought to Elm, they created a package called elm/html and this package mimics the HTML into functions. Some comparison:

HTML

<div class="fancy-div">Hello new world!</div>

Elm

div [ class "fancy-div" ] [ text "Hello new world" ]

And it works right? I mean, you can build your UI in the same mindset as you were used to do, and you can still use the old and friendly CSS to make it pretty.

There is just one problem with this comfortable plan, it's called HTML + CSS 💩. HTML is not exactly meaningful and CSS can be a mess. Of course, you can improve this using good CSS conventions and naming, but you will still have some div, span and p all over the place.

Trying to avoid that problem a nice guy called Matthew Griffith created a new way to build UIs in Elm, and that package is called elm-ui.

I could try to explain what that package does, but I will only quote the Github description :D.

What if you never had to write CSS again?

So, what I'm trying to say here is that we can do Elm and not use HTML + CSS 💃.

Alt Text

Let's code

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

SurveyJS custom survey software

JavaScript UI Library for Surveys and Forms

Generate dynamic JSON-driven forms directly in your JavaScript app (Angular, React, Vue.js, jQuery) with a fully customizable drag-and-drop form builder. Easily integrate with any backend system and retain full ownership over your data, with no user or form submission limits.

View demo

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay