npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@scidian/osui

v0.1.19

Published

Lightweight JavaScript UI library.

Downloads

20

Readme

Osui

The Onsight UI Library. A lightweight, customizable, modular UI library based on native HTML5 components.

Also includes an easy to use property inspector similar to dat.gui or lil-gui.

Install

  • Option 1: Copy build file osui.module.js, import from file...
// Import property inspector only
import { Gooey } from 'osui.module.js';

// Or, import entire library
import * as OSUI from 'osui.module.js';
  • Option 2: Install from npm, import from '@scidian/osui'...
npm install @scidian/osui
import * as OSUI from '@scidian/osui';
  • Option 3: Import directly from CDN...
import * as OSUI from 'https://unpkg.com/@scidian/osui/build/osui.module.js';

Creation

const params = {
    myBoolean: true,
    myFunction: () => console.log('hello world'),
    myListInt: 0,
    myListString: 'b',
    myNumber: 75.54,
    myNumber2: 50,
    myString: 'California',
    myArray: [ 1, 0, 0 ],

    myColorString: '#ffffff',
    myColorInt: 0xffffff,
    myColorObject: { r: 1, g: 1, b: 1 },
    myColorArray: [ 1, 1, 1 ],
};

const myList = [ 'a', 'b', 'c', 'd', 'e' ];

const gui = new OSUI.Gooey('Title');
const folder = gui.addFolder('Folder Name');

folder.add(params, 'myBoolean');                            // checkbox
folder.add(params, 'myFunction');                           // button
folder.add(params, 'myListInt', myList);                    // list by number
folder.add(params, 'myListString', myList);                 // list by value
folder.add(params, 'myNumber', min, max, step, precision);  // slider
folder.add(params, 'myNumber2');                            // if no min / max, number only
folder.add(params, 'myString');                             // text box
folder.add(params, 'myVector');                             // any length array of numbers
folder.addColor(params, 'myColor______');                   // string / int / object / array

Properties

  • Property functions can be chained together
folder.add(params, 'myNumber').name('Width').min(0).max(100).step(5).precision(1);

On Change

// Fires constantly when slider is being changed
folder.add(params, 'myNumber').onChange(() => width = params.myNumber);

// Fire when slider is done being changed
folder.add(params, 'myNumber').onFinishChange(() => width = params.myNumber);

Updating

  • Keep reference to controller if gui needs to be updated externally.
params = { myNumber: 5.0 };

const gui = new OSUI.Gooey();
const folder = gui.addFolder('Folder Name');
const controller = folder.add(params, 'myNumber');

// ...somwhere later, params changes...
params.myNumber += 2.0;

// ...tells element to update itself from new value
controller.updateDisplay();

Styling

gui.color('#bb0000');       // Sets gui color
gui.opacity(0.5);           // Set background opacity
gui.scale(1.0);             // Scale multiplier
gui.width(200);             // Set panel width

License

Osui is released under the terms of the MIT license, so it is free to use in your free or commercial projects.

Copyright (c) 2022-2023 Stephens Nunnally and Scidian Studios