Skip to content
forked from nakaixo/nakai

A just-in-time functional rendering framework for building web apps with Gleam ✨

License

Notifications You must be signed in to change notification settings

Roshanjossey/nakai

 
 

Repository files navigation

Nakai

Documentation

Getting started

gleam add nakai
import nakai
import nakai/html.{Node}
import nakai/html/attrs.{Attr}

const header_style = "
  color: #331f26;
  font-family: 'Neuton', serif;
  font-size: 128px;
  font-weight: 400;
"

pub fn header(attrs: List(Attr(a)), text: String) -> Node(a) {
  let attrs = [attrs.style(header_style), ..attrs]
  html.h1_text(attrs, text)
}

pub fn app() -> String {
  html.div(
    [],
    [
      html.Head([html.title("Hello!")]),
      header([], "Hello, from Nakai!")
    ],
  )
  |> nakai.to_string()
}

About

A just-in-time functional rendering framework for building web apps with Gleam ✨

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Gleam 100.0%