Skip to content

Component Catalog ​

uni-ui is a set of ready-made components for RxElement apps on Scala.js: buttons, text fields, tabs, foldable side panes, splitters, overlays (popovers, tooltips, menus, dialogs, selects, and toasts), virtualized lists, trees, and tables, and a dock. The same components work in a browser and in an Electron app. See Setup to add the artifact and load uni-ui.css.

Components keep their behavior and their look apart. Scala code sets ARIA roles, focus, keyboard handling, data-state attributes, and a data-slot name on every part. uni-ui.css styles those with --uni-* CSS variables, so an app restyles a component by setting variables, not by changing Scala code.

To build a widget uni-ui doesn't have, start from the behaviors the components are made of: keyboard navigation, typeahead, selection, focus handling, and stick-to-bottom scrolling.

Conventions ​

Each component is an RxElement that takes the Rx values it reads. Options are withXXX methods. A component takes one parameter list of the arguments it cannot work without. Name the functions, triggers, and multi-value arguments at the call site, so each one says what it is (key = _.id, render = ..., trigger = ...). An argument that holds several values, such as menu entries or dialog content, is a Seq: e