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

react-guify

v0.1.4

Published

![npm (tag)](https://img.shields.io/npm/v/react-guify) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/react-guify) ![NPM](https://img.shields.io/npm/l/react-guify)

Downloads

10

Readme

react-guify

npm (tag) npm bundle size NPM

React-guify is a thin wrapper around the simple GUI library guify.

image

Demo

Installation

#Yarn
yarn add guify react-guify

#NPM
npm install guify react-guify

Example

function App() {
  const [state, setState] = React.useState(initialState)
  const gui = React.useRef()
  return (
    <GuiPanel
      ref={gui}
      data={state}
      setData={setState}
      barMode="above"
      theme="light"
    >
      <GuiButton
        label="Toast"
        action={() => {
          gui.current.Toast('Current date: ' + Date.now())
        }}
      />
      <GuiText property="name" />
      <GuiTitle label="Options" />
      <GuiFile label="Select File" property="file" />
      <GuiDisplay property="name" />
      <GuiCheckbox property="checkeds" />
      <GuiColor property="color" />
      <GuiFolder label="Bounds Folder" open={true}>
        <GuiRange
          label="bounds"
          property="bounds"
          scale="log"
          onChange={value => console.log({ value })}
        />
        <GuiSelect property="movement" options={options} />
        <GuiInterval property="interval" min={5} max={70} />
      </GuiFolder>
    </GuiPanel>
  )
}

Api

Components exports

React-guify creates and exports React components that allow you to structure the GUI with React nodes.

You can pass all options from guify as props to these components. For now components will not respond to props update.

Read guify docs for more.

Main panel

  • GuiPanel: guify main panel.

In addition to the native options from guify, the panel requires two additional props:

  • data: the data object bound to components.
  • setData: the function the panel will call to update your data when values change.

Data-bound components

  • GuiCheckbox: a checkbox
  • GuiRange: a number selector
  • GuiInterval: an interval selector
  • GuiColor: a color selector
  • GuiSelect: an option selector
  • GuiText: a free-text entry
  • GuiDisplay: displays a variable
  • GuiFile: a file selector

Action components

  • GuiButton: a button with an action

Organizational components:

  • GuiTitle: shows a title
  • GuiFolder: a folder grouping different components

Toast

guify has a nice toast feature that React-guify tries to implement seamlessly. The panel component will pass back a ref to you, which will include the original gui object created by guify.

function ToastExample() {
  const [state, setState] = React.useState(initialState)
  const gui = React.useRef()
  return (
    <GuiPanel ref={gui} data={state} setData={setState}>
      <GuiButton
        label="Toast"
        action={() => gui.current.Toast('Hello from Toast')}
      />
    </GuiPanel>
  )
}

Todo List

  • [ ] Proper mounting and unmounting
  • [ ] Updating props on the fly