dborisenko / scalajs-react-components

Reusable scalajs-react components



Build Status License scalajs-react react

Reusable scalajs-react components.

This project was initially a clone of chandu0101/scalajs-react-components project, but with updated version of japgolly/scalajs-react library. But during the upgrade it was discovered that some of the components cannot be migrated to the latest version of React. Therefore the author took a decision to extract some of the components into separate projcet to simplify the update.

We are trying to make the experience of using javascript components in scala.js as good as possible by adding typed wrappers.

Adding types to javascript is a lot of guesswork, and we're certain to have gotten them wrong some places. Bug reports and/or pull requests are very much welcome! :)

Semantic UI

Maven Central react

Module semantic-ui contains scalajs wrapper for semantic-ui-react component.

Add dependencies in build.sbt:

libraryDependencies ++= Seq(
  "com.dbrsn.scalajs.react.components" %%% "semantic-ui" % "0.0.2"
npmDependencies in Compile ++= Seq(
  "semantic-ui-react" -> "0.82.3",
  "react" -> "16.5.0",
  "react-dom" -> "16.5.0"

Example of usage:

SuiButton(animated = true, onClick = (_: ReactMouseEventFromHtml) => Callback(???))(
  SuiButtonContent(visible = true)("Hello, World!"),
  SuiButtonContent(hidden = true)(SuiIcon(name = SuiIconType("arrow right"))())