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 🙏

© 2025 – Pkg Stats / Ryan Hefner

oops-react-widget

v1.1.0

Published

React widget for Oops! feedback collection

Readme

@oops/react-widget

A React widget for collecting user feedback with screenshots, browser information, and seamless integration into any React application.

📖 Complete Documentation

View Live Demo | API Examples

Designed with Johnny Ive's principles in mind: Simple. Elegant. Functional.

Installation

npm install @oops/react-widget

Quick Start

1. Basic Floating Widget

import { FeedbackWidget } from '@oops/react-widget';

function App() {
  return (
    <div>
      <h1>My App</h1>
      <FeedbackWidget
        projectId="proj_abc123"
        publicKey="pk_live_xyz789"
        position="bottom-right"
        theme="auto"  // Auto-detect light/dark mode
      />
    </div>
  );
}

2. Custom Trigger Button

<FeedbackWidget
  projectId="proj_abc123"
  publicKey="pk_live_xyz789"
  position="none"
  renderTrigger={({ onClick, isLoading }) => (
    <button onClick={onClick} disabled={isLoading}>
      🐛 Report Issue
    </button>
  )}
/>

3. Controlled Modal

import { FeedbackModal } from '@oops/react-widget';

function MyComponent() {
  const [showFeedback, setShowFeedback] = useState(false);

  return (
    <div>
      <button onClick={() => setShowFeedback(true)}>
        Give Feedback
      </button>

      <FeedbackModal
        projectId="proj_abc123"
        publicKey="pk_live_xyz789"
        isOpen={showFeedback}
        onClose={() => setShowFeedback(false)}
      />
    </div>
  );
}

4. Hook Pattern (Maximum Flexibility)

import { FeedbackProvider, useFeedback } from '@oops/react-widget';

// App root
function App() {
  return (
    <FeedbackProvider projectId="proj_abc123" publicKey="pk_live_xyz789">
      <MyApp />
    </FeedbackProvider>
  );
}

// Anywhere in your component tree
function CustomFeedbackComponent() {
  const { submitFeedback, isSubmitting, error } = useFeedback();

  const handleSubmit = async () => {
    await submitFeedback({
      text: "Custom feedback",
      userInfo: { email: "[email protected]" }
    });
  };

  return (
    <button onClick={handleSubmit} disabled={isSubmitting}>
      {isSubmitting ? "Sending..." : "Send Feedback"}
    </button>
  );
}

Theme Configuration

The widget supports automatic dark mode detection and manual theme control with a beautiful orange accent color (#FF6B4A).

Theme Options

// Auto-detect system theme (default)
<FeedbackWidget
  projectId="proj_abc123"
  publicKey="pk_live_xyz789"
  theme="auto"  // Follows user's system preference
/>

// Force light mode
<FeedbackWidget
  projectId="proj_abc123"
  publicKey="pk_live_xyz789"
  theme="light"
/>

// Force dark mode
<FeedbackWidget
  projectId="proj_abc123"
  publicKey="pk_live_xyz789"
  theme="dark"
/>

Visual Design

Light Mode:

  • Frosted white glass backgrounds with subtle transparency
  • Dark text (#1d1d1f) for optimal readability
  • Orange accents (#FF6B4A) for interactive elements
  • Soft shadows for depth

Dark Mode:

  • Frosted dark glass backgrounds (rgba(30-50, 30-50, 30-50))
  • White text (#ffffff) with high contrast
  • Same vibrant orange accents (#FF6B4A)
  • Deeper shadows for dramatic depth
  • Your logo remains in original colors

Orange Accent Color (#FF6B4A) Used For:

  • Submit button background and hover states
  • Input/textarea focus borders and glow
  • Checkbox checked state
  • All interactive states and highlights

Theme with Modal

<FeedbackModal
  projectId="proj_abc123"
  publicKey="pk_live_xyz789"
  isOpen={showFeedback}
  onClose={() => setShowFeedback(false)}
  theme="auto"  // Auto-detect or use 'light' / 'dark'
/>

The theme automatically applies to all components:

  • Floating feedback button
  • Modal container and overlays
  • Category selection cards
  • Form inputs, textareas, and buttons
  • Checkboxes and interactive elements

Props

FeedbackWidget

| Prop | Type | Default | Description | |------|------|---------|-------------| | projectId | string | - | Your Oops! project ID | | publicKey | string | - | Your public API key (pk_live_* or pk_test_*) | | position | 'bottom-right' \| 'bottom-left' \| 'top-right' \| 'top-left' \| 'none' | 'bottom-right' | Widget position | | theme | 'light' \| 'dark' \| 'auto' | 'auto' | Color theme - 'auto' detects system preference | | enableScreenshot | boolean | true | Enable screenshot capture | | enableBrowserInfo | boolean | true | Include browser information | | userInfo | object | - | Pre-fill user information | | onSubmit | function | - | Callback when feedback is submitted | | onError | function | - | Callback when an error occurs |

Features

  • 📸 Screenshot Capture - Let users capture and include screenshots
  • 🌐 Browser Info - Automatically collect browser and viewport information
  • 🎨 Themeable - Light, dark, and auto themes with beautiful orange accents
  • 🌓 Auto Dark Mode - Automatically detects and follows system theme preference
  • 📱 Mobile Friendly - Responsive design for all devices
  • 🔒 Secure - Domain validation and API key security
  • Lightweight - Minimal bundle size with tree-shaking support
  • 🎯 Flexible - Multiple integration patterns
  • Jony Ive Inspired - Frosted glass effects, refined shadows, and minimal design

Requirements

  • React 16.8+ (hooks support)
  • Modern browser with ES6+ support

License

MIT