Laminar bindings for WebAwesome web components library
Following these simple steps for a quickstart.
npx degit nguyenyou/webawesome-laminar/quickstart webawesome-laminar-quickstart
cd webawesome-laminar-quickstart
npm install
npm run devOpen: http://localhost:5173/
https://webawesome-laminar.vercel.app/docs/getting-started
For attributes that accept a fixed set of string values, this library offers two ergonomic ways to work with them:
You can assign string values directly while still enjoying full type safety via Scala’s union types. This works both for String and Signal[String].
Button(
_.variant := "success" // String
)("Click me")
Button(
_.variant <-- Val("success") // Signal[String]
)("Click me")For cases where the attribute value is static and known at compile time, you can use dot notation for better discoverability and cleaner syntax:
Button(
_.variant.success
)()One advantage of this syntax is that it allows for faster typing.
While building this library, I learned a lot and borrowed many ideas from Nikita’s laminar-shoelace-components library.
Tu Nguyen - @younguyen95
This project is provided under the MIT license.