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

@valencyhq/react

v0.0.18

Published

Valency is a tool to manage and serve design assets

Readme

React-valency

npm version .github/workflows/publish.yml coverage status npm downloads

🤔 What is Valency?

Valency is a tool to manage and serve design assets.

  • Design assets managed with Valency are served for use over a CDN.

📦 Install

$ npm install @valencyhq/valency @valencyhq/react --save

Table of Contents

🪄 Basic Usage

1. 🧱 Components Usage

import React, { useEffect } from 'react'
import { render } from 'react-dom'
import Valency from '@valencyhq/valency'
import { ValencyProvider, Image, Object, Icon } from '@valencyhq/react'

const valent = new Valency({
      uid: 'Your user ID',
      project: 'Your default project ID',
      library: 'Your default library ID',
})

const App = () => {
      return (
            <ValencyProvider value={valent}>
                  {/* Your other components wrapped */}
                  <ExampleBasicUsage />
            </ValencyProvider>
      )
}

const ExampleBasicUsage = () => {
      return (
            <>
                  <Image name="cat-dog" />
                  <Object name="cat-dog" />
                  <Icon library="Lib_icons" name="like" />
            </>
      )
}

render(<App />, document.getElementById('root'))

2. 🪝 Hooks Usage

import React, { useEffect } from 'react'
import { render } from 'react-dom'
import Valency from '@valencyhq/valency'
import { ValencyProvider, Image, Object, Icon } from '@valencyhq/react'

const valent = new Valency({
      uid: 'Your user ID',
      project: 'Your default project ID',
      library: 'Your default library ID',
})

const App = () => {
      return (
            <ValencyProvider value={valent}>
                  {/* Your other components wrapped */}
                  <ExampleHooksUsage />
            </ValencyProvider>
      )
}

const ExampleHooksUsage = () => {
      const { get, asset, getConfig, setConfig } = useValency()

      useEffect(() => {
            console.log('Print cat-dig asset URL', get('cat-dog'))
      })

      return (
            <>
                  <button
                        type="button"
                        onClick={() => {
                              window.open(asset['cat-dog'].url, '_blank')
                        }}
                  >
                        View Asset
                  </button>
            </>
      )
}

render(<App />, document.getElementById('root'))

▶️ Live Examples

📖 API Reference

Components

Valency provides some components:

  • Image - An <img/>element
<Image name="cat-dog" width={200} height={200} />
  • Object - An <object/> element
<Object name="cat-dog" width={200} height={200} />
  • Icon - Renders <svg/> as an icon
<Icon name="like" width="40px" height="40px" color="red" stokeWidth="2px" />

The components above accepts the following props and all other valid props of the type of HTML element rendered by the component:

  • name - Name of asset
  • library? - (Optional) ID of the library to get the asset
  • project? - (Optional) ID of the project to get the asset
  • uid? - (Optional) ID of the user that the asset belongs to

If an optional prop is not provided, the corresponding default value set at the instance of Valency class which is asssigned the the ValencyProvider will be used.

ValencyProvider

A provider that will pass the provided instance of Valency through the component tree without having to pass props down manually at every level.

import { ValencyProvider } from '@valencyhq/react'

const valent = new Valency({
      uid: 'Your user ID',
      project: 'Your default project ID',
      library: 'Your default library ID',
})

// ...
<ValencyProvider value={valent}>
      {/* Place components that will use valency here */}
</ValencyProvider>
//..

Hooks

useValency()

useValency hook provides a set of APIs.

import { useValency } from '@valencyhq/react'

// ...
const { get, getConfig, setConfig, asset } = useValency()
//..

The following are functions and properties exposed by the useValency() hook:

👨‍🔧 Contributing

For more info on how to contribute please see the contribution guidelines. Caught a mistake or want to contribute to the documentation? Edit this page on Github

🧾 License

React-valency is licensed under the MIT License.