Skip to main content
Home

A library of reusable React hooks, components, and utilities built by ZL Asica.

This package works with Cloudflare Workers, Node.js, Bun, BrowsersIt is unknown whether this package works with Deno
This package works with Cloudflare Workers
This package works with Node.js
It is unknown whether this package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
2 months ago (0.4.1)

React Utilities 🚀

npm version JSR License Coverage Node.js pnpm Version | React Vitest Eslint Prettier

This repository is NOT a reimplementation of React itself. It is a collection of reusable React hooks, utilities, and tools to enhance development productivity. 🎉

Features

  • 🚀 Lightweight and optimized hooks and utilities for React projects.
  • 📦 Fully typed with TypeScript for better developer experience.
  • 🔒 Clean and consistent utilities for DOM, state, and async operations.
  • ✅ 100% (almost) test coverage with robust testing using Vitest.

Installation

Install the package via npm, yarn, pnpm, bun, or deno from JSR:

# With npm
npm install @zl-asica/react
# With yarn
yarn add @zl-asica/react
# With pnpm
pnpm add @zl-asica/react
# With bun
bun add @zl-asica/react
// With deno from JSR
import { useLocalStorage } from "jsr:@zl-asica/react";

Usage

For more examples, check the documentation.

Example: useToggle

import { useToggle } from "@zl-asica/react";

const App = () => {
  const [isToggled, toggle] = useToggle(false);

  return (
    <button type="button" onClick={toggle}>
      {isToggled ? "ON" : "OFF"}
    </button>
  );
};

export default App;

Limitations

ESM only. This package is built with ESM and is not compatible with CommonJS. If you are using CommonJS, sorry, this package is not for you. 😢

Contributing

Contributions are welcome! Feel free to open an issue or submit a PR. ❤️

License

This project is licensed under the MIT License.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@zl-asica/react

Import symbol

import * as react from "@zl-asica/react";
or

Import directly with a jsr specifier

import * as react from "jsr:@zl-asica/react";

Add Package

pnpm i jsr:@zl-asica/react
or (using pnpm 10.8 or older)
pnpm dlx jsr add @zl-asica/react

Import symbol

import * as react from "@zl-asica/react";

Add Package

yarn add jsr:@zl-asica/react
or (using Yarn 4.8 or older)
yarn dlx jsr add @zl-asica/react

Import symbol

import * as react from "@zl-asica/react";

Add Package

npx jsr add @zl-asica/react

Import symbol

import * as react from "@zl-asica/react";

Add Package

bunx jsr add @zl-asica/react

Import symbol

import * as react from "@zl-asica/react";