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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@rokku-x/roks-rjsc

v0.2.2

Published

A React component library

Readme

roks-rjsc

A small React component library exposing a few UI helpers and modal/loading utilities.

Installation

Install from npm (after publishing):

npm install @rokku-x/roks-rjsc

During development you can also install directly from GitHub:

npm install github:rokku-x/roks-rjsc

Usage

Import named exports from the package root. Examples below assume React 18.

Core components:

import React from 'react';
import { /* core exports */ } from '@rokku-x/roks-rjsc';

export default function App() {
	return <div>Your app root</div>;
}

Loading provider and hook:

import React from 'react';
import { LoadingProvider, useLoading } from '@rokku-x/roks-rjsc/loading';

function Example() {
    const { startLoading, stopLoading, asyncUseLoading } = useLoading();

    const handle = async () => {
   	 startLoading();
   	 await new Promise(r => setTimeout(r, 1000));
   	 stopLoading();
    }

    return <button onClick={handle}>Load</button>
}

export default function AppWrapper() {
    return (
   	 <LoadingProvider>
   		 <Example />
   	 </LoadingProvider>
    )
}

Modal helpers (BaseModalProvider + hooks):

import React from 'react';
import { BaseModalProvider, useStaticModal, useDynamicModal } from '@rokku-x/roks-rjsc/modal';

function StaticExample() {
    const [show, close, id] = useStaticModal();

    return (
   	 <>
   		 <button onClick={() => show(<div>Static content</div>)}>Open static modal</button>
   	 </>
    )
}

function DynamicExample() {
    const [render, show, close, focus] = useDynamicModal();

    return (
   	 <>
   		 <button onClick={() => show()}>Open dynamic modal</button>
   		 {render(<div>Rendered into dynamic modal</div>)}
   	 </>
    )
}

export default function App() {
    return (
   	<BaseModalProvider>
   		<StaticExample />
   		<DynamicExample />
   	</BaseModalProvider>
    )
}

API (top-level exports)

  • LoadingProvider, useLoading, Loading, AnimationType - loading utilities (available via @rokku-x/roks-rjsc/loading)
  • BaseModalProvider, useBaseModal, useStaticModal, useDynamicModal, RenderMode - modal system (available via @rokku-x/roks-rjsc/modal)

Subpath imports

  • @rokku-x/roks-rjsc/modal: exports BaseModalProvider, useBaseModal, useStaticModal, useDynamicModal, RenderMode
  • @rokku-x/roks-rjsc/loading: exports LoadingProvider, useLoading, Loading, AnimationType

Props & API Reference

LoadingProvider props

| Prop | Type | Description | |---|---|---| | id | string? | Optional id for the provider wrapper | | children | ReactNode  null | Provider children | | loadingComponent | React.ComponentType  React.ReactElement? | Custom loading element | | animationType | AnimationType? | One of Spin  FadeInOut  None | | animationDuration | number? | Seconds for animation duration | | wrapperStyle | React.CSSProperties? | Style for wrapper element | | wrapperClassName | string? | Class name for wrapper | | wrapperId | string? | ID for wrapper | | animationWrapperStyle | React.CSSProperties? | Style for animation wrapper | | animationWrapperClassName | string? | Class name for animation wrapper | | animationWrapperId | string? | ID for animation wrapper |

Loading API (useLoading())

| Name | Type / Signature | Description | |---|---|---| | asyncUseLoading | <R>(asyncFunction: Promise<R>) => Promise<R> | Run async function while toggling loading | | isLoading | boolean | Global loading state | | isLocalLoading | boolean | Local hook instance loading state | | loadingEventTarget | EventEmitter | Event emitter for change  start  stop events | | overrideLoading | (state: boolean  null) => void | Force override loading state | | startLoading | () => void | Increment/start loading | | stopLoading | () => void | Decrement/stop loading |

Modal Provider props

| Prop | Type | Description | |---|---|---| | children | React.ReactNode | Content | | wrapperId | string? | Optional wrapper id | | renderMode | RenderMode? | STACKED  CURRENT_ONLY  CURRENT_HIDDEN_STACK | | wrapperStyle | React.CSSProperties? | Wrapper style |

BaseModalProvider API (useBaseModal())

| Name | Type / Signature | Description | |---|---|---| | modalCount | number | Number of open modals | | renderMode | RenderMode? | Current render mode | | currentModalId | string? | ID of current modal | | pushModal | (el: React.ReactNode, modalId?: string, isDynamic?: boolean) => string | Push modal and receive id | | popModal | (idEl: string  React.ReactNode) => boolean | Pop modal by id or element | | updateModalContent | (modalId: string, newContent: React.ReactNode) => void | Replace modal content | | getModalWindowRef | (modalId: string) => HTMLDivElement  undefined | Access modal DOM | | focusModal | (modalId: string) => boolean | Bring modal to front | | getModalOrderIndex | (modalId: string) => number | Get stacking order index |

useStaticModal(id?: string)

Returns a tuple: [show(el) => closeFn, closeFn, id, isForeground, updateContent(newContent)]

| Position | Meaning | |---|---| | show(el) | Mounts static content and returns a close function | | closeFn | Closes the modal | | id | Modal id string | | isForeground | boolean — whether the modal is top-most | | updateContent | (newContent: React.ReactNode) => void — Replace content |

useDynamicModal(id?: string)

Returns a tuple: [render(el) => ReactNode, show(), close(), focus(), id, isForeground]

| Position | Meaning | |---|---| | render(el) | Supplies content to the dynamic modal container | | show() | Opens the modal | | close() | Closes the modal | | focus() | Brings the modal to front | | id | Modal id string | | isForeground | boolean — whether the modal is top-most |

License

MIT