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

moriss-react-custom-features

v1.0.4

Published

## Description:

Readme

Moriss-React-Custom-Features

Description:

This is a React library offering reusable custom components and hooks. It provides:

  • CustomInput: A basic input component for user interactions.
  • SearchFiled: A search input component that optionally utilizes debounced API calls.
  • useQuery: A custom React hook to simplify making API requests using Axios.
  • useFilter: A custom React hook for filtering data based on a specified condition.

Features:

  • Reusable components for common UI elements.
  • Debounced API calls for optimized performance.
  • Easy-to-use hook for API interactions.
  • Data filtering with a customizable condition.

Installation:

npm install moriss-react-custom-features

Usage:

  1. Import components and hooks:

    import CustomInput from 'moriss-react-custom-features/CustomInput';
    import SearchFiled from 'moriss-react-custom-features/SearchFiled';
    import useQuery from 'moriss-react-custom-features/useQuery';
    import useFilter from 'moriss-react-custom-features/useFilter';
  2. Use the components and hooks:

    function MyComponent() {
      const [searchValue, setSearchValue] = useState('');
      const { results, isLoading, isError, error, fetchData } = useQuery(
        'https://api.example.com/data'
      );
    
      const { filteredData, isLoading: filterLoading, isError: filterError, error: filterErrorDetail, filterData } = useFilter(
        results.data,
        (item) => item.value > 10
      );
    
      return (
        <div>
          <CustomInput value={searchValue} setValue={setSearchValue} />
          <SearchFiled
            value={searchValue}
            setValue={setSearchValue}
            onSearch={() => console.log('Search:', searchValue)}
          />
          {isLoading && <p>Loading...</p>}
          {isError && <p>Error: {error.message}</p>}
          {filterLoading && <p>Filtering...</p>}
          {filterError && <p>Filter Error: {filterErrorDetail.message}</p>}
          {filteredData && (
            <pre>{JSON.stringify(filteredData, null, 2)}</pre>
          )}
          <button onClick={() => fetchData(true)}>Refresh Data</button>
        </div>
      );
    }

API Reference:

CustomInput:

  • Props:
    • value: The current value of the input (string or number).
    • setValue: A function to update the value.
    • className: (optional) A CSS class to apply to the input element.
    • styles: (optional) An object of inline styles to apply to the input element.
    • id: The ID of the input element.

SearchFiled:

  • Props:
    • All props of CustomInput.
    • onSearch: (optional) A function to be called when the user submits the search.
    • debouce: (optional, default: true) Whether to debounce the onSearch call.
    • delay: (optional, default: 500) The debounce delay in milliseconds.

useQuery:

  • Props:

    • url: The URL of the API endpoint.
    • method: (optional, default: 'GET') The HTTP method (GET, POST, PATCH, DELETE, PUT).
    • body: (optional) The request body for methods like POST or PUT.
    • config: (optional) Additional configuration for the Axios request.
  • Returns:

    • results: The response data from the API call (AxiosResponse object).
    • isLoading: Whether data is currently being fetched.
    • isError: Whether an error occurred during the request.
    • error: The error object if isError is true.
    • fetchData: A function to manually trigger a data fetch, optionally forcing a refresh.

useFilter:

  • Params:

    • data: The array of data to be filtered.
    • filterCondition: The filtering function that determines whether an item should be included.
    • caching: (optional, default: true) Flag to enable caching of filtered data.
  • Returns:

    • filteredData: The array of data that satisfies the filtering condition.
    • isLoading: Indicates whether the data is currently being fetched.
    • isError: Indicates whether an error occurred during the data fetching process.
    • error: The error object, if an error occurred.
    • filterData: Function to manually trigger data filtering with optional refresh and custom filter callback.

Feel free to customize the documentation further based on your preferences and additional details you'd like to include.