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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@usb-ai/retag-search-input

v0.0.2

Published

@usb-ai/retag-search-input is a vanilla javascript component which will work in any frontend framework. You can install from npm like this:

Downloads

3

Readme

@usb-ai/retag-search-input

@usb-ai/retag-search-input is a vanilla javascript component which will work in any frontend framework. You can install from npm like this:

npm install --save @usb-ai/retag-search-input

Usage: Javascript (assumes es module)

import SearchInput from '@usb-ai/retag-search-input'

let searchInput = new SearchInput({target:document.body, props: { label: 'Search' });
searchInput.label = 'Updated Value';

The "target" is where the component is created. Here it is added to the html body with "document.body", but it could also be document.getElementById('id-of-html-element').

You initialize properties with "props" and you can change the prop values by just assigning the props to new values - this will be updated in the UI.

Usage: Legacy Javascript

Below you can see how to use the component with vanilla js.

...
<head>
  ...
  <script src="https://unpkg.com/@usb-ai/[email protected]/index.js"></script>
</head>
<body>
  <script>
    let searchInput = new SearchInput({ target: document.body });
  </script>
</body>

Usage: Web Component (aka. Custom Element)

You can use it as a web component.

<head>
  <script src="https://unpkg.com/@usb-ai/[email protected]/index.js"></script>
</head>
<body>
  <retag-search-input label="Search" />
</body>

Svelte Component

<script>
  import SearchInput from "@usb-ai/retag-search-input";
</script>
<SearchInput />

Theme

In order to use the provided theme you should import root.css (TODO: add it to the bundle, download it here in the meantime: https://github.com/usb-ai/retag-search/tree/main/packages/%40usb-ai/retag-search-input/), which sets different css variables used in the component which you can adapt for your own.

FIXME: href path of link is not yet available in this bundle

<head>
  ...
  <link href="root.css" rel="stylesheet" />
</head>

Alternatively you can set the variables in inline style in your prefered html
document of your website: ```html
<style>
  :root {
    --color-bg: #fff;
    --color-bg-secondary: #e9e9e9;
    --color-text: #000;
    --color-text-secondary: #999;
    --border-radius: 5px;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
      Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --width-card-wide: 800px;
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --color-bg: #333;
      --color-bg-secondary: #555;
      --color-text: #f7f7f7;
      --color-text-secondary: #aaa;
    }
  }
</style>

Pelte

This component was created by pelte (aka publish-svelte)