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

instincthub-react-ui

v0.0.1

Published

InstinctHub React UI components and assets in TypeScript

Readme

InstinctHub UI

A comprehensive React component library with built-in assets and utilities for building modern web applications.

npm version license

Overview

InstinctHub UI provides a collection of reusable React components, styling assets, and utility functions that make it easy to build consistent user interfaces. Originally developed for InstinctHub's internal projects, this package is now available for anyone to use in their React and Next.js projects.

Installation

npm install instincthub-react-ui

or

yarn add instincthub-react-ui

Core Features

  • Form Components: A comprehensive set of form elements including text fields, date pickers, phone inputs, and more
  • UI Components: Action dropdowns, modals, tooltips, and other interactive UI elements
  • Styling Assets: Pre-built CSS files for consistent styling including dark mode support
  • Utility Functions: API helpers, form validation, and other common utilities

Usage

Importing Components

import { TextField, PasswordField, NewSubmitBtn } from "instincthub-react-ui";

function LoginForm() {
  const [formData, setFormData] = useState({
    email: "",
    password: "",
  });

  const handleChange = (e) => {
    setFormData({
      ...formData,
      [e.target.name]: e.target.value,
    });
  };

  return (
    <form>
      <TextField
        label="Email Address"
        name="email"
        value={formData.email}
        onChange={handleChange}
        required
      />

      <PasswordField
        label="Password"
        name="password"
        value={formData.password}
        onChange={handleChange}
        required
      />

      <NewSubmitBtn text="Login" />
    </form>
  );
}

Using Utility Functions

import { openToast, fetchAPI } from "instincthub-react-ui";

// Display a toast notification
openToast("Operation successful!", "success");

// Make an API call
const fetchData = async () => {
  try {
    const response = await fetchAPI("/api/users", "GET");
    return response.data;
  } catch (error) {
    openToast("Failed to fetch data", "error");
  }
};

Component Documentation

Form Components

TextField

Standard text input field with label.

<TextField
  label="Username"
  name="username"
  value={username}
  onChange={handleChange}
  required={true}
  placeholder="Enter your username"
  disabled={false}
/>

PasswordField

Secure password input with optional visibility toggle.

<PasswordField
  label="Password"
  name="password"
  value={password}
  onChange={handleChange}
  required={true}
  showToggle={true}
/>

DateInput

Date picker component.

<DateInput
  label="Birth Date"
  name="birthDate"
  value={birthDate}
  onChange={handleChange}
  required={true}
/>

PhoneNumberInput

International phone number input with country code selection.

<PhoneNumberInput
  label="Phone Number"
  name="phone"
  value={phone}
  onChange={handleChange}
  required={true}
/>

NewSubmitBtn

Form submission button with loading state support.

<NewSubmitBtn
  text="Submit"
  loading={isSubmitting}
  disabled={!isValid}
  onClick={handleSubmit}
/>

FormError

Display form validation errors.

<FormError error={errors.username} />

FilterObjects

Filter and sort collections of objects.

<FilterObjects data={users} filterKey="role" onChange={handleFilterChange} />

UI Components

ActionDropdown

Dropdown menu for actions.

<ActionDropdown
  type="email"
  names="assigned_email"
  labels="School Assigned Email"
  requireds={true}
/>

Utility Functions

openToast

Display toast notifications.

openToast("Message sent successfully!", "success");
openToast("Operation failed", "error");
openToast("Please wait", "info");

openConfirmModal

Show a confirmation dialog.

openConfirmModal({
  title: "Delete Item",
  message: "Are you sure you want to delete this item?",
  onConfirm: handleDelete,
  onCancel: () => console.log("Cancelled"),
});

handleFormErrors

Process and display form validation errors.

try {
  // Form submission logic
} catch (error) {
  const errors = handleFormErrors(error);
  setFormErrors(errors);
}

fetchAPI

Make API requests with consistent error handling.

const fetchData = async () => {
  const response = await fetchAPI("/api/data", "GET");
  return response.data;
};

const createItem = async (item) => {
  const response = await fetchAPI("/api/items", "POST", item);
  return response.data;
};

Next.js Integration

This package works seamlessly with Next.js applications. For optimal performance, consider these best practices:

// In your _app.js or layout.js
import "instincthub-react-ui/dist/styles.css"; // Import styles once at the application root

TypeScript Support

InstinctHub UI is built with TypeScript and includes full type definitions for all components and utilities.

import { TextField, TextFieldProps } from "instincthub-react-ui";

// Types are available for all props
const CustomTextField: React.FC<TextFieldProps> = (props) => {
  return <TextField {...props} className="custom-field" />;
};

Browser Support

InstinctHub UI is compatible with all modern browsers including:

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add some amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Credits

Developed and maintained by InstinctHub.