Introduction

ui-io: Data driven web user interface library

This is a playground and tutorial for the ui-io library, version

Edit the HTML in the panel to the right and the JS in the panel below and explore what happens in the document on the right.

Edit the HTML in the lower panel and the JS in the upper panel and explore what happens in the document beneath.

To install the library in your own projects:

npm install ui-io

Use a bundler (e.g. webpack) to build your application and import the library.

JS

Data input & output

List

Transform a changing list into a list of rendered content using data.map

Data map keys

Transform each item of a Data list:

data$.map((item$, index$, { remove }) => content)
data$.map({ key }, (item$, index$, { remove }) => content)

key: optional string or function used to compute a unique key to identify items as the list changes. A string will be used as the key for an object in a list of objects. A function will be called with the list item and should return a value to be used as the key.

item$: Data containing the value of the list item

index$: Data containing the index (zero based) of the list item

remove: Function which when called will remove that item from the array

This example compares different types of keys:

The number indicates the order in which the element was created.

Try focusing one of the inputs and then press shift+ctrl/cmd and:

Progressive enhancement

HTML

Network data

SVG

Drag and drop

Content Editable