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

@t007/utils

v0.0.33

Published

High-performance utilities for the t007 ecosystem.

Readme

@t007/utils

The foundational utility belt and central nervous system for the @t007 UI ecosystem. A collection of highly optimized, JavaScript helpers for DOM manipulation, async resource loading, and math operations.

License NPM Version

Report Bug


Table of contents


Overview

@t007/utils is the core engine that powers the rest of the @t007 UI packages (@t007/toast, @t007/dialog, @t007/input). It abstracts away the heavy lifting of dynamic DOM creation, cross-browser event handling, and asynchronous resource injection.

Why @t007/utils?

  • Tree-Shakeable: Every utility is exported individually. Modern bundlers will only compile the exact code you import, resulting in zero bloat.
  • Shared Memory: By acting as a peer dependency for the other @t007 packages, it ensures that your application doesn't download duplicate helper functions.

Features

  • DOM Engineering: High-performance element creation and attribute binding.
  • Resource Management: Asynchronous script and stylesheet injection with duplicate-load prevention.
  • Class Management: Automatic method binding for class-based UI components.
  • Math & Physics: Clamping and coordinate tracking used by gesture-driven UI components.
  • Global Injection: Safely initializes the global t007 object across environments.

Tech Stack

Built with

  • JavaScript (ES6+)
  • Bundled via tsup (ESM, CJS, IIFE outputs)
  • Built for extreme execution speed and minimal byte size.

Getting Started

Installation

Install via your preferred package manager:

npm install @t007/utils
# or
yarn add @t007/utils
# or
pnpm add @t007/utils

Usage

Modern Bundlers (ESM)

Because the library uses modern ECMAScript Modules, you can destruct exactly what you need.

// Vite / Webpack / Next.js
import { createEl, loadResource, uid } from '@t007/utils';

// Generate a complex DOM element in one line
const myBtn = createEl('button', { className: 'my-custom-btn', textContent: 'Click Me' });

// Inject a stylesheet dynamically
await loadResource('https://cdn.example.com/styles.css', 'link');

Built-in Hooks

| React Hook | Vanilla Counterpart | | --------------- | ------------------- | | useRipple | rippleHandler | | useScrollAssist | initScrollAssist | | useFocusTrap | initFocusTrap | | useOutsideClick | initOutsideClick | | useHighlight | N/A | | N/A | initVScrollerator |

Built-in Components

| React Component | Vanilla Counterpart | | --------------- | ------------------- | | HighlightText | N/A |

Code Sample

import { useRef } from "react";
import { useScrollAssist, useRipple } from "@t007/utils/hooks/react";
import { HighlightText } from "@t007/utils/components/react";
import '@t007/utils/styles/ripple.css';
import "@t007/utils/styles/scroll-assist.css";

export function HelperTextScroller() {
  const ref = useRef<HTMLDivElement>(null);
  useScrollAssist(ref, { vertical: false, assistClassName: "scroll-assist" });
  const rippleHandler = useRipple();

  return (
    <div className="text-wrapper">
      <p ref={ref} className="text">
        <HighlightText query="helper" className="highlight">
          Long helper text to demonstrate highlighting and scroll assistance.
        </HighlightText>
      </p>
      <button onPointerDown={rippleHandler}>Click Me</button>
    </div>
  );
}

Styles

It includes:

  • .t007-ripple-wrapper, .t007-ripple, .t007-ripple-hold, .t007-ripple-fade (default ripple classes)
  • .t007-scroll-assist (default assist class)

All defaults are exposed as root-level, t007-prefixed variables:

:root {
  /** default ripple values */
  --t007-ripple-initial-opacity: 0.4;
  --t007-ripple-initial-scale: 0.5;
  --t007-ripple-expand-scale: 2.05;
  --t007-ripple-color: rgb(0 0 0 / 0.24);
  --t007-ripple-expand-duration: 350ms;
  --t007-ripple-fade-duration: 350ms;
  /** default scroll assist values */
  --t007-scroll-assist-color: rgb(0 0 0 / 1);
  --t007-scroll-assist-opacity: 0.07;
  --t007-scroll-assist-width: 2rem;
  --t007-scroll-assist-height: 2rem;
  --t007-scroll-assist-inset-x: -0.35rem;
  --t007-scroll-assist-inset-y: 0;
}

/** custom pre-requisites */
.highlight {
  background-color: yellow;
}
.text-wrapper {
  position: relative;
  flex: 1;
  min-width: 2rem;
}
.text {
  white-space: nowrap;
  overflow: auto hidden;
  scrollbar-width: none;
}
.text::-webkit-scrollbar {
  display: none;
}

Author

Acknowledgments

The invisible backbone of the @t007 ecosystem. Engineered to make complex DOM operations feel effortless.

Star History

If you find this project useful, please consider giving it a star! ⭐

Star History Chart