Scala/ScalaJS library for using WebAwesome components with Scalatags
  • Scala 94.8%
  • Shell 5.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
mph 7baabc4373
All checks were successful
Publish / publish (push) Successful in 1m2s
Merge pull request 'chore: repoint iw bootstrap to Forgejo' (#10) from chore/iw-forgejo-repoint into main
Reviewed-on: #10
2026-08-14 17:49:23 +00:00
.claude/skills Add iw tool and related skills 2026-02-17 19:05:03 +01:00
.git-hooks Add quality gates: CI, git hooks, scalafmt, scalafix 2026-02-17 21:45:39 +01:00
.github/workflows ci: publish to the forge Maven registry; fix pom repo name 2026-07-28 13:43:33 +02:00
.iw Add iw tool and related skills 2026-02-17 19:05:03 +01:00
scenarios/src Add quality gates: CI, git hooks, scalafmt, scalafix 2026-02-17 21:45:39 +01:00
webawesome Move tag definitions to shared code via Bundle parameterization 2026-02-18 09:38:27 +01:00
.envrc Document Sonatype publishing env vars in .envrc 2026-02-18 11:13:32 +01:00
.gitignore Add Web Awesome Pro setup and component tracking 2026-02-16 22:53:53 +01:00
.mill-version Initial project setup with Mill 1.1.2 and ScalaJS 2026-02-12 17:07:03 +01:00
.scalafix.conf Add quality gates: CI, git hooks, scalafmt, scalafix 2026-02-17 21:45:39 +01:00
.scalafmt.conf Add quality gates: CI, git hooks, scalafmt, scalafix 2026-02-17 21:45:39 +01:00
build.mill ci: publish to the forge Maven registry; fix pom repo name 2026-07-28 13:43:33 +02:00
COMPONENTS.md Review wa-sparkline scenario page 2026-02-17 11:27:02 +01:00
CONTRIBUTING.md Add quality gates: CI, git hooks, scalafmt, scalafix 2026-02-17 21:45:39 +01:00
iw chore: repoint iw bootstrap to Forgejo 2026-07-26 11:39:28 +02:00
llms.txt Add dependency and runtime setup instructions to llms.txt, fix CDN typo in README 2026-02-20 16:36:10 +01:00
mill Initial project setup with Mill 1.1.2 and ScalaJS 2026-02-12 17:07:03 +01:00
README.md Add dependency and runtime setup instructions to llms.txt, fix CDN typo in README 2026-02-20 16:36:10 +01:00

scalatags-web-awesome

Scalatags bindings for Web Awesome web components (v3.2.1).

Provides type-safe tag and attribute definitions for all 61+ Web Awesome components, usable from both JVM (server-side HTML rendering) and ScalaJS (browser DOM).

Setup

Add the dependency to your Mill build:

// JVM (scalatags Text backend)
def mvnDeps = Seq(mvn"works.iterative::scalatags-webawesome:3.2.1-SNAPSHOT")

// ScalaJS (scalatags JsDom backend)
def mvnDeps = Seq(mvn"works.iterative::scalatags-webawesome:3.2.1-SNAPSHOT")

Or in sbt:

libraryDependencies += "works.iterative" %%% "scalatags-webawesome" % "3.2.1-SNAPSHOT"

Your HTML pages need to load the Web Awesome runtime. Add to <head>:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3.2.1/dist-cdn/styles/webawesome.css">
<script type="module" src="https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3.2.1/dist-cdn/webawesome.loader.js"></script>

Important: Use dist-cdn/ (not dist/). The dist/ directory contains bare module specifiers that require a bundler.

Usage

import scalatags.Text.all.*
import works.iterative.scalatags.webawesome.WebAwesome.*

val page = div(
  waButton(variant := "brand", appearance := "accent")("Click me"),
  waInput(withLabel := "true", placeholder := "Enter text"),
  waBadge(variant := "success")("Active"),
  waDialog(open := "true", attr("label") := "Hello")(
    p("Dialog content"),
    waButton(slot := "footer", variant := "brand")("Close")
  )
)

Tags are prefixed with wa in camelCase (e.g., wa-button becomes waButton, wa-color-picker becomes waColorPicker).

Attributes

Web Awesome-specific attributes are defined in the WebAwesome object. Standard HTML attributes (disabled, placeholder, name, value, etc.) come from scalatags as usual.

A few attributes conflict with scalatags builtins and must be used inline:

waButton(attr("size") := "large")("Large button")
waDialog(attr("label") := "Title")("Content")

Boolean attributes use string "true":

waButton(pill := "true", loading := "true")("Loading...")

Components

All 61 standard Web Awesome components are supported, organized by category:

  • Form Controls: input, number-input, select, option, combobox, checkbox, radio, radio-group, color-picker, slider, switch, textarea
  • Actions: button, button-group, copy-button, dropdown, dropdown-item
  • Display & Feedback: avatar, badge, callout, icon, skeleton, spinner, tag
  • Indicators & Progress: progress-bar, progress-ring, rating
  • Layout & Organization: breadcrumb, breadcrumb-item, card, details, dialog, divider, drawer, split-panel
  • Navigation: tab, tab-group, tab-panel, tree, tree-item
  • Popups & Overlays: popover, popup, tooltip
  • Media: animated-image, animation, carousel, carousel-item, comparison
  • Formatters & Utilities: format-bytes, format-date, format-number, include, qr-code, relative-time, zoomable-frame
  • Observers: intersection-observer, mutation-observer, resize-observer, scroller

Pro Components

The following components require a Web Awesome Pro license:

  • wa-combobox
  • wa-file-input
  • wa-page
  • wa-sparkline

Building

Requires Mill 1.1.2+.

./mill webawesome.jvm.compile    # Compile JVM module
./mill webawesome.js.compile     # Compile ScalaJS module
./mill webawesome.jvm.test       # Run tests
./mill webawesome.jvm.publishLocal  # Publish to ~/.ivy2/local
./mill webawesome.js.publishLocal   # Publish ScalaJS to ~/.ivy2/local

Scenario Server

A built-in demo server shows all components:

./mill -w scenarios.run
# Open http://localhost:8086

Versioning

Library versions mirror the Web Awesome version they target. Version 3.2.1 provides bindings for Web Awesome 3.2.1. A fourth segment (e.g., 3.2.1.1) indicates a fix to the bindings themselves without a Web Awesome version change.

Updates are provided on a best-effort basis — there is no guarantee of tracking every Web Awesome release.

License

MIT