Skip to content
Brandon Jordan edited this page Jul 9, 2023 · 14 revisions

Welcome to the jsUI wiki!

Getting Started

Install via NPM:

npm i javascript-ui

At the base of jsUI is it's element abstraction built on top of the JavaScript DOM abstraction.

Import and use the view() function to start.

import * as jsUI from 'javascript-ui';

jsUI.view([
    // components...
]);

Import and use built-in elements based on standard HTML tags:

import * as jsUI from 'javascript-ui';
import {Section, Paragraph} from 'javascript-ui';

jsUI.view([
    Section([
        Paragraph("Text")
    ])
]);

This results in the following HTML being added to the body:

<section>
    <p>Text</p>
</section>

To add style, events, etc. you chain methods onto the element function.

import * as jsUI from 'javascript-ui';
import {Paragraph} from 'javascript-ui';

jsUI.view([
    Paragraph("Text")
        .textColor("green")
]);

Resulting in:

<p style="color: green">Text</p>

Clone this wiki locally