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

@willphan1712000/frontend

v1.8.3

Published

Frontend Library

Readme

@willphan1712000/frontend

Reusable React UI components and frontend utilities packaged for application development.

What this package includes

Components

  • DropdownSelect
  • MultiSelect
  • RangeSlider
  • OptionSlider
  • ColorPickerSlider
  • Button
  • ModernButton
  • Avatar
  • InputGoogle
  • TextArea
  • InputFile
  • UploadImage
  • Image
  • ImageEditor

Utilities

  • Canvas
  • ImageUtilities
  • Transform
  • tools
  • LinearAlgebra

Auth helpers

  • useSession
  • SessionProvider
  • useAuthClient
  • AuthInterface
  • StorageInterface

Installation

This package is intended for React applications.

npm install @willphan1712000/frontend

Make sure your app already has React and React DOM installed:

npm install react react-dom

Quick start

import { useState } from 'react';
import {
  DropdownSelect,
  RangeSlider,
  Button,
  type Options,
} from '@willphan1712000/frontend';

const options: Options = [
  { label: 'Low', value: 'low' },
  { label: 'Medium', value: 'medium' },
  { label: 'High', value: 'high' },
];

export default function Example() {
  const [priority, setPriority] = useState('medium');
  const [amount, setAmount] = useState('50');

  return (
    <div>
      <DropdownSelect
        options={options}
        value={priority}
        onChange={setPriority}
      />

      <RangeSlider
        value={amount}
        onChange={setAmount}
        min="0"
        max="100"
        width="240"
      />

      <Button
        buttonType="gradient"
        content="Submit"
        type="button"
      />
    </div>
  );
}

Core component usage

DropdownSelect

import { DropdownSelect, type Options } from '@willphan1712000/frontend';

const options: Options = [
  { label: 'Apple', value: 'apple' },
  { label: 'Orange', value: 'orange' },
];

Props:

  • options: { label: string; value: string }[]
  • value: string
  • onChange: (value: string) => void

MultiSelect

import { useState } from 'react';
import { MultiSelect } from '@willphan1712000/frontend';

const options = [
  { label: 'React', value: 'react' },
  { label: 'TypeScript', value: 'typescript' },
];

const [values, setValues] = useState<string[]>([]);

Props:

  • options: { label: string; value: string }[]
  • value: string[]
  • onChange: React.Dispatch<React.SetStateAction<string[]>>
  • width?: string

RangeSlider

Props:

  • value: string
  • onChange: (value: string) => void
  • min?: string
  • max?: string
  • color?: string
  • width?: string

OptionSlider

The package exports SliderOptions for this component.

Props:

  • value: string
  • onChange: (value: string) => void
  • options: { label: ReactNode; value: string }[]
  • width?: string
  • color?: string

ColorPickerSlider

Props:

  • value: string
  • onChange: (value: string) => void
  • width?: string

Button

Supports:

  • buttonType="normal"
  • buttonType="solid"
  • buttonType="gradient"

Additional styling props:

  • content?: string
  • main?: string
  • text?: string
  • first?: string
  • second?: string
  • isLoading?: boolean

Also accepts normal button props such as onClick, type, disabled, and style.

Avatar

Avatar combines image upload, preview, edit, and remove flows.

import { useState } from 'react';
import { Avatar } from '@willphan1712000/frontend';

const [src, setSrc] = useState<string | undefined>(undefined);

<Avatar
  src={src}
  setValue={setSrc}
  options={{ defaultImage: '/images/default-avatar.png' }}
/>;

Props:

  • src?: string
  • setValue: (src?: string) => void
  • options?: { defaultImage?: string }

Auth usage

The auth helpers are designed around an auth client object that implements AuthInterface.

import {
  SessionProvider,
  useAuthClient,
  type AuthInterface,
} from '@willphan1712000/frontend';

class AuthClient implements AuthInterface {
  getSignInUrl() {
    return '/signin';
  }

  async signin() {}

  async validate() {
    return {
      username: 'will',
      email: '[email protected]',
      role: 'admin',
    };
  }

  async signout() {}
}

const authClient = new AuthClient();

function AppProviders({ children }: { children: React.ReactNode }) {
  const session = useAuthClient(authClient);

  return (
    <SessionProvider value={session}>
      {children}
    </SessionProvider>
  );
}

useAuthClient returns:

  • isLoading
  • session
  • auth

Exported utilities

import {
  Canvas,
  ImageUtilities,
  Transform,
  tools,
  LinearAlgebra,
} from '@willphan1712000/frontend';

Included helpers:

  • tools.handleAsync(...)
  • tools.textPreprocessing(...)

Development

Install dependencies:

npm install

Build the package:

npm run build

Run in watch mode during development:

npm run dev

Local package testing with npm link

Inside this package:

npm link

Inside the app where you want to test it:

npm link @willphan1712000/frontend

If React reports multiple copies loaded, link the consumer app's React instance:

npm link <path_to_your_testing_project>/node_modules/react

Notes

  • The package is built with tsup.
  • It ships CommonJS, ESM, and TypeScript declaration files.
  • Source code is written in TypeScript and React.

Contributing

If you find a bug or want to improve the package, open an issue or submit a pull request.

Portfolio:

Contact: