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

@riesenia/fe-rui

v0.1.11

Published

RUI - Riešenia UI Components Library with Web Components and Vue support

Readme

fe-rui

RUI (Rshop UI) - Components Library with Web Components and Vue 3 support.

Installation

npm install @riesenia/fe-rui

Features

  • Web Components - Framework-agnostic custom elements that work anywhere
  • Vue Components - Native Vue 3 components with full TypeScript support
  • Utility Functions - Helpers for overlays, scroll locking, clipboard, and more
  • Modular Imports - Import only what you need
  • Accessibility - ARIA attributes and keyboard navigation built-in
  • rEvent Integration - Optional event bus for cross-component communication

Modular Imports

Import only what you need to keep bundle size small:

// Import everything (all components auto-register)
import { RuiToggle, WishlistPopup, checkResolution } from "@riesenia/fe-rui";

// Import only functions (no component side effects)
import { checkResolution, showOverlay, initCopyText } from "@riesenia/fe-rui/functions";

// Import only Vue components
import { WishlistPopup } from "@riesenia/fe-rui/vue";

// Import individual Web Components (kebab-case)
import "@riesenia/fe-rui/toggle";      // Registers <rui-toggle>
import "@riesenia/fe-rui/tabs";        // Registers <rui-tabs>
import "@riesenia/fe-rui/more-items";  // Registers <rui-more-items>

Using @rui Alias (Recommended)

For cleaner imports, add an alias in your bundler config:

vite.config.ts:

export default defineConfig({
  resolve: {
    alias: {
      "@rui": "@riesenia/fe-rui",
    }
  }
});

Then use shorter imports:

import { checkResolution } from "@rui/functions";
import { WishlistPopup } from "@rui/vue";
import "@rui/toggle";
import "@rui/tabs";
import "@rui/more-items";

Vue Configuration

When using rui-* custom elements in Vue projects:

// vite.config.ts
vue({
  template: {
    compilerOptions: {
      isCustomElement: (tag) => tag.startsWith("rui-"),
    },
  },
})

Web Components

Web Components work in any framework or vanilla JavaScript.

Toggle

Show/hide content with trigger-based activation.

<script type="module">
  import "@riesenia/fe-rui/toggle";
</script>

<button rui-toggle-trigger="my-toggle">Toggle Content</button>

<rui-toggle rui-id="my-toggle">
  <p>Hidden content here</p>
</rui-toggle>

<style>
  rui-toggle { display: none; }
  rui-toggle.is-active { display: block; }
</style>

Tabs

Tab panels and accordion functionality.

<script type="module">
  import "@riesenia/fe-rui/tabs";
</script>

<rui-tabs rui-id="my-tabs">
  <button rui-tab-trigger="tab1" class="is-active">Tab 1</button>
  <button rui-tab-trigger="tab2">Tab 2</button>

  <div rui-tab-target="tab1" class="is-active">Content 1</div>
  <div rui-tab-target="tab2">Content 2</div>
</rui-tabs>

<style>
  [rui-tab-target] { display: none; }
  [rui-tab-target].is-active { display: block; }
</style>

MoreItems

Expand/collapse additional content.

<script type="module">
  import "@riesenia/fe-rui/more-items";
</script>

<rui-more-items rui-id="my-more" data-more-text="Show more" data-less-text="Show less">
  <p>Always visible content</p>

  <div rui-more-items-target>
    <p>Hidden content that expands</p>
  </div>

  <button rui-more-items-trigger>
    <span rui-more-items-trigger-text>Show more</span>
  </button>
</rui-more-items>

<style>
  [rui-more-items-target] { display: none; }
  [rui-more-items-target].is-active { display: block; }
</style>

Utility Functions

Import from @riesenia/fe-rui/functions (or @rui/functions with alias):

Helpers

import { checkResolution, plural, checkIphone, getScrollbarWidth, getCssVar } from "@rui/functions";

// Check if viewport matches breakpoint query
if (checkResolution("cxs;xs")) {
  // Mobile viewport
}

// Slovak plural helper
plural("položka", "položky", "položiek", count);

// Detect iPhone/iPad
if (checkIphone()) { /* ... */ }

// Get scrollbar width
const width = getScrollbarWidth();

// Get CSS custom property value
const color = getCssVar("--primary-color");

Scroll Lock

import { disableScroll, enableScroll } from "@rui/functions";

// Disable body scroll (handles iOS quirks)
disableScroll();

// Re-enable body scroll
enableScroll();

Overlay

import { showOverlay, hideOverlay, showHeaderOverlay, hideHeaderOverlay } from "@rui/functions";

// Show full-page overlay
showOverlay(ownerElement);
hideOverlay(ownerElement);

// Show header overlay (positioned below header)
showHeaderOverlay(ownerElement);
hideHeaderOverlay(ownerElement);

Copy Text

import { initCopyText, copyToClipboard } from "@rui/functions";

// Initialize click-to-copy on elements
initCopyText({
  selector: ".js-copy-text",
  onSuccess: (el, text) => console.log("Copied:", text),
});

// Or copy programmatically
await copyToClipboard("Text to copy");

HTML for initCopyText:

<button class="js-copy-text" data-text="Text to copy" data-success-text="Copied!">
  Copy
</button>

Vue Components

Vue components require Vue 3.3+.

WishlistPopup

import { WishlistPopup } from "@rui/vue";
<template>
  <WishlistPopup
    :product-id="123"
    :api-client="myApiClient"
    :endpoints="{
      fetchWishlists: '/api/wishlists',
      addToWishlist: '/api/wishlists/add'
    }"
    @product-added="handleAdded"
  />
</template>

JavaScript API

All web components expose a global API:

// Toggle
window.RUI.Toggle.open('my-toggle');
window.RUI.Toggle.close('my-toggle');
window.RUI.Toggle.toggle('my-toggle');

// Tabs
window.RUI.Tabs.activate('my-tabs', 'tab2');

// MoreItems
window.RUI.MoreItems.open('my-more');
window.RUI.MoreItems.close('my-more');
window.RUI.MoreItems.toggle('my-more');

Or access component instances directly:

const toggle = document.querySelector('rui-toggle[rui-id="my-toggle"]');
toggle.open();
toggle.close();
toggle.toggle();
console.log(toggle.isActive); // boolean

Events

Components dispatch CustomEvents:

const toggle = document.querySelector('rui-toggle');

// Before events are cancelable
toggle.addEventListener('rui:toggle:beforeOpen', (e) => {
  if (someCondition) {
    e.preventDefault(); // Prevent opening
  }
});

// After events for side effects
toggle.addEventListener('rui:toggle:afterOpen', (e) => {
  console.log('Toggle opened', e.detail);
});

Event Names

| Component | Events | |-----------|--------| | Toggle | rui:toggle:beforeOpen, rui:toggle:afterOpen, rui:toggle:beforeClose, rui:toggle:afterClose | | Tabs | rui:tabs:beforeChange, rui:tabs:afterChange | | MoreItems | rui:moreitems:beforeOpen, rui:moreitems:afterOpen, rui:moreitems:beforeClose, rui:moreitems:afterClose |

CSS Classes

| Class | Description | |-------|-------------| | is-active | Applied when component/element is active | | is-initialized | Applied when component is ready |

CSS Variables

Override default styles with CSS variables:

:root {
  /* Overlay */
  --rui-overlay-bg: rgba(0, 0, 0, 0.5);
  --rui-overlay-zindex: 200;
  --rui-header-overlay-zindex: 100;
}

Attributes

| Attribute | Description | |-----------|-------------| | rui-id | Component identifier (required for JS API) | | rui-*-trigger | Marks element as trigger | | rui-*-target | Marks element as target | | rui-query | Media query condition (e.g., "cxs;xs") | | rui-overlay | Show overlay when active | | data-* | Configuration options |

rEvent Integration

If window.rEvent is available, components automatically integrate:

// Listen to events
window.rEvent.on('RuiToggle.afterOpen', (data) => {
  console.log('Toggle opened:', data.id);
});

// Trigger actions
window.rEvent.dispatch('RuiToggle.open.my-toggle');

TypeScript

Full TypeScript support included:

import { RuiToggle, RuiTabs, RuiMoreItems } from "@riesenia/fe-rui";
import { WishlistPopup } from "@riesenia/fe-rui/vue";
import type { ToggleEventDetail, TabsEventDetail, MoreItemsEventDetail } from "@riesenia/fe-rui";

Browser Support

  • Chrome/Edge 79+
  • Firefox 63+
  • Safari 14.1+

Requires native Custom Elements support (no polyfill included).

License

MIT