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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@bqx/just-okay-ui

v0.6.0

Published

The packages with just okay UI components

Readme

just-okay-ui

The library contains UI components:

  • button
  • checkbox
  • loader
  • modal
  • textfield
  • tooltip

Shared

Config

  • id - HTMLElement.id
  • classNames - HTMLElement.className

Functions

dispose

Disposes a component:

  • remove component's HTMLElement from DOM
  • prevent component's functions processing

Button

Config

content - optional

Value is one of HTMLElement, string.

isIcon - optional

Icon-button supports only string content (best for emoji). A separate wrapper for content is created for isIcon: true.

Default: false

size - optional

Value is one of xs, sm, md, lg.

Default: md

variant - optional

Value is one of primary, secondary, tertiary.

Default: primary

Callbacks

onClick - optional

Callback function without arguments. The callback is fired on click event.

Functions

click

Triggers HTMLElement.click.

Checkbox

Config

name - required

Value of string type is used as identifier of the input[type=checkbox].

value - required

Value of string type is used as HTMLInputElement.value.

checked - optional

Value of boolean type represents checkbox checked state.

Default: false

displayText - optional

Value of string type represents text displayed to user.

Default: value of value property

size - optional

Value is one of xs, sm, md, lg.

Default: md

variant - optional

Value is one of primary, secondary, tertiary.

Default: primary

Callbacks

onClick - optional

Callback function with argument of type:

{
    value: string;
    checked: boolean;
}

The callback is fired on click event.

Functions

check

Makes checked state to true.

setChecked

Sets checked state to specified value.

Arguments
  • checked (boolean) - new checked state.

toggle

Switches checked state.

uncheck

Make checked state to false.

Loader

Config

blur - optional

Value of boolean type represents whether target is blurred.

Default: true

pointerSpeed - optional

Value is one of slow, regular, fast. It represents a speed of loader's pointer.

Default: regular.

size - optional

Value is one of xs, sm, md, lg.

Default: md

target - optional

Value of HTMLElement type represents a target element for the loader.

Default: document.body

Functions

on

Starts loader.

off

Stops loader.

Modal

Config

content - required

Object of type:

{
    main: HTMLElement | string;
    title?: HTMLElement | string;
    footer?: HTMLElement | string;
}
main - required

Value is one of HTMLElement, string. It represents a content of the main modal section.

title - optional

Value is one of HTMLElement, string. It represents a content of the title modal section.

The section is rendered even if title is not provided as the section contains 'close' modal button.

footer - optional

Value is one of HTMLElement, string. It represents a content of the title modal section.

The section is not rendered when not provided.

blur - optional

Value of boolean type represents whether target is blurred.

Default: true

closeOnOutsideClick - optional

Value of boolean type represents the close behavior for outside click.

Default: false

destroyOnClose - optional

Value of boolean type represents the close behavior of the component.

More details are in Shared > Functions > dispose.

Default: true

fullScreen - optional

Value of boolean type represents whether a component takes the whole viewport.

Default: false

size - optional

Value is one of xs, sm, md, lg.

Default: md

Callbacks

onClose

Callback function without arguments. The callback is fired on 'close' modal button click event.

Functions

show

Shows the modal.

close

Closes the modal.

Textfield

Config

fullWidth - optional

Value of boolean type represents whether a component takes full width of its container.

Default: false

label - optional

Value of string type represents HTMLLabelElement.textContent attribute's value.

placeholder - optional

Value of string type represents HTMLInputElement.placeholder attribute's value.

size - optional

Value is one of xs, sm, md, lg.

Default: md

variant - optional

Value is one of primary, secondary, tertiary.

Default: primary

value - optional

Value of string type represents HTMLInputElement.value attribute's value.

Callbacks

onChange

Callback function with argument of type string.

The callback is fired on change event.

Tooltip

Config

content - required

Value is one of HTMLElement, string.

target - required

Value of HTMLElement type represents a target element for the tooltip.

position - optional

Value is one of top, right, bottom, left. It represents a position of tooltip relative to target element.

size - optional

Value is one of xs, sm, md, lg.

Default: md

transition - optional

Value is one of slow, regular, fast, number (in milliseconds). It represents a duration before showing and hiding of the tooltip.

Default: regular