Laminar type definitions for web component collections. Currently included collections:
Package is published to GitHub Packages in this repository. To reference it, you can use sbt-github-packages SBT plugin:
resolvers += Resolver.githubPackages("uosis")
libraryDependencies += "com.github.uosis" %%% "laminar-web-components-material" % "0.1.0"
Ensure you have sbt-scalajs-bundler plugin
Web Components have NPM dependencies.
Web Components have similar interface to built-in elements. See examples below.
Displays a collection of Web Components
To run:
cd examples/showcase
sbt fastOptJS::webpack
- Open
index-fastopt.html
in browser
generator folder contains Ammonite scripts used to generate component type definitions. If you want to tweak the generated types, changes should be made here.
To run code generation:
amm generator/main.sc
- Format
material/src/main/scala/material.scala
using scalafmt - Check in the new generated code
- Add/modify the component in the generation script
- For example, if it's a new Google Material Web Component, add it to
material.sc
using one of the existing components as an example.
- For example, if it's a new Google Material Web Component, add it to
- Run code generation as described above
- Check in generated code
- Create new definitions script using
material.sc
as an example - Create new SBT project using
material/
project as an example - Update
main.sc
to include new project - Run code generation
- Check in generated code