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

react-safekit-ui

v0.1.9

Published

React SafeKit UI - A fully customizable, accessible React component library with built-in loading states, idempotency handling, and flexible styling for reusable UI components.

Downloads

1,137

Readme

React SafeKit UI

npm version License: MIT

A modern, fully customizable React component library designed for building accessible and performant user interfaces. Features built-in loading states, idempotency handling, debounced inputs, and flexible glassmorphism styling.

✨ Features

  • AsyncButton: Button component with loading states and automatic idempotency key generation
  • DebounceInput: Input component with built-in debouncing for optimized performance
  • Glassmorphism Styling: Modern, translucent design with customizable backgrounds
  • TypeScript Support: Fully typed with TypeScript for better developer experience
  • Accessible: Built with accessibility best practices
  • Lightweight: Minimal dependencies, optimized bundle size
  • Customizable: Extensive prop-based customization options

🚀 Installation

npm install react-safekit-ui

Peer Dependencies

This library requires the following peer dependencies:

{
  "react": ">=16.8.0",
  "react-dom": ">=16.8.0"
}

📖 Usage

AsyncButton

The AsyncButton component provides a button with built-in loading states and idempotency handling, perfect for async operations like API calls.

import React from 'react';
import { AsyncButton } from 'react-safekit-ui';

function App() {
  const handleAsyncClick = async ({ idempotencyKey }: { idempotencyKey?: string }) => {
    console.log('Processing with key:', idempotencyKey);
    // Simulate API call
    await new Promise(resolve => setTimeout(resolve, 2000));
    return { success: true };
  };

  return (
    <AsyncButton
      onClick={handleAsyncClick}
      canClick={true}
      size="md"
      bgColor="rgba(59, 130, 246, 0.8)"
      generateKey={true}
      simulateDelay={2000}
      loadingTitle="Processing..."
    >
      Submit Form
    </AsyncButton>
  );
}

export default App;

DebounceInput

The DebounceInput component automatically debounces user input to reduce the frequency of expensive operations like API searches.

import React, { useState } from 'react';
import { DebounceInput } from 'react-safekit-ui';

function SearchComponent() {
  const [searchTerm, setSearchTerm] = useState('');

  const handleSearch = (value: string) => {
    console.log('Searching for:', value);
    // Perform search API call here
    setSearchTerm(value);
  };

  return (
    <DebounceInput
      value={searchTerm}
      onChangefn={handleSearch}
      type="search"
      placeholder="Search products..."
      debounceDelay={300}
      size="md"
      bgColor="rgba(255, 255, 255, 0.1)"
      width="100%"
    />
  );
}

export default SearchComponent;

🧩 Components API

AsyncButton

A button component that handles async operations with loading states and idempotency.

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | onClick | (params: { idempotencyKey?: string }) => Promise<any> | - | Async click handler function | | canClick | boolean | true | Whether the button can be clicked | | size | "sm" \| "md" \| "lg" | "md" | Button size | | width | "fw" \| string | - | Button width ("fw" for full width) | | bgColor | string | "rgba(59, 130, 246, 0.8)" | Background color (supports rgba) | | lockWhilePending | boolean | true | Lock button during async operations | | generateKey | boolean | false | Auto-generate idempotency keys | | loadingTitle | string | "Loading..." | Text shown during loading | | simulateDelay | number | 0 | Simulated delay in milliseconds for testing | | children | ReactNode | - | Button content |

DebounceInput

An input component with built-in debouncing for optimized performance.

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | value | string | - | Controlled input value | | onChangefn | (value: string) => void | - | Callback function called with debounced value | | onFocusfn | () => void | - | Optional focus event handler | | onClickfn | () => void | - | Optional click event handler | | type | "text" \| "number" \| "search" \| "phone" \| "tel" | "text" | Input type | | placeholder | string | - | Placeholder text | | debounceDelay | number | 300 | Debounce delay in milliseconds | | bgColor | string | "rgba(255, 255, 255, 0.1)" | Background color with glassmorphism | | size | "sm" \| "md" \| "lg" | "md" | Input size | | width | "fw" \| string | - | Input width ("fw" for full width) | | disabled | boolean | false | Disable the input |

🎨 Styling

Both components feature glassmorphism styling with customizable backgrounds. The styling is designed to be modern and translucent, working well with various design systems.

🔧 Development

Building

npm run build

Development Mode

npm run dev

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📞 Support

If you have any questions or issues, please open an issue on GitHub.