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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@toppr-engg/byjus-search-qna

v1.0.7

Published

A react component for search bar and related upload, crop functionality

Downloads

62

Readme

import SearchBar from '@toppr-engg/byjus-search-qna/lib/esm';
import '@toppr-engg/byjus-search-qna/lib/esm/index.css';

function Home() {
  return (
    <SearchBar
      onSuggestionClick={onSuggestionClick}
      onCustomSearch={onCustomSearch}
      onImageUploaded={onImageUploaded}
      onGetSearchInputRef={onGetSearchInputRef}
      apiBaseUrl={apiBaseUrl}
      authKey={authKey}
      userId={userId}
      origin={origin}
      maxInputLength={maxInputLength}
      placeholder={placeholder}
      suggestionsOrHistoryData={suggestionsOrHistoryData}
      imageUploadPopupData={imageUploadPopupData}
      cameraWrapperData={cameraWrapperData}
      className={className}
      focussedClassName={focussedClassName}
      inputClassName={inputClassName}
      inputFocussedClassName={inputFocussedClassName}
      searchClassName={searchClassName}
      searchFocussedClassName={searchFocussedClassName}
      suggestionsClassName={suggestionsClassName}
      suggestionsFocussedClassName={suggestionsFocussedClassName}
    />
  );
}

PROPS TABLE

| Props | Description | Type | Required | | ------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ---------- | -------- | | onSuggestionClick | A function which gets triggered on clicking any suggestion item | function | Yes | | onCustomSearch | A function which gets triggered on enter press to invoke a custom text search | function | Yes | | onImageUploaded | A function which gets triggered when the selected image has been uploaded | function | Yes | | onGetSearchInputRef | A function to get the search input bar ref so that actions can be performed on it from outside the package (focus) | function | No | | apiBaseUrl | Base path of search apis (Default is prod Api) | string | No | | authKey | Related to authentication of the user | string | Yes | | userId | User Id to be used in api calls user | number | Yes | | origin | Origin to be used in api calls | number | No | | maxInputLength | A number for max input length which can be typed/pasted in searchbar calls (Default 1000) | number | No | | placeholder | A string for input bar placeholder calls (Default - Search) | | suggestionsOrHistoryData | An object for passing props to SuggestionOrHistory component | object | No | | imageUploadPopupData | An object for passing props to ImageUploadModal component | object | No | | cameraWrapperData | An object for passing props to CameraWrapper component | object | No | | className | A string containing css which appends to the App container container css | string | No | | focussedClassName | A string containing css which appends to the App container container css on focus of search input | string | No | | inputClassName | A string containing css which appends to the SearchBar input container css | string | No | | inputFocussedClassName | A string containing css which appends to the SearchBar input container css on focus of search input | string | No | | searchClassName | A string containing css which appends to the SearchBar container css | string | No | | searchFocussedClassName | A string containing css which appends to the SearchBar container css on focus of search input | string | No | | suggestionsClassName | A string containing css which appends to the suggestions-container css | string | No | | suggestionsFocussedClassName | A string containing css which appends to the suggestions-container when focussed | string | No | | suggestionsFocussedClassName | A string containing css which appends to the single suggestion item | string | No |

Function Definitions

/**
 *  A callback function which gets triggered on clicking any suggestion
 * @param {object} data - the object of a single suggestion item from the api response
 */
function onSuggestionClick(data) {}

/**
 *  A callback function which gets triggered on enter press to invoke a custom text search
 * @param {string} text - the text typed/pasted in the searchbar
 */
function onCustomSearch(text) {}

/**
 *  A callback function which gets triggered on enter press to invoke a custom text search
 * @param {object} data - the api response and the base64 string of the selected image
 */
function onImageUploaded(data) {}

/**
 *  callback to get the ref for the search input
 * @param {object} ref
 */
function onGetSearchInputRef(ref) {}