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

opineeo-widget

v1.2.2

Published

The simplest survey widget for Devs and Founders.

Readme

Opineeo Widget

npm version License

The simplest survey widget for Devs and Founders. Collect user feedback seamlessly with a beautiful, customizable React component that wraps the Opineeo web component.

Features

Easy Integration - Add to any React app in minutes
🎨 Fully Customizable - Match your brand colors and style with CSS variables
📱 Mobile First - Responsive design for all devices
📍 Flexible Positioning - Inline embedded or fixed corner positions (top-right, bottom-left, etc.)
🔒 TypeScript - Full type safety included
Accessible - ARIA compliant with keyboard navigation
🪶 Lightweight - Minimal bundle size impact
🎯 Event Callbacks - Track open, close, and submit events

Installation

npm install opineeo-widget

or

yarn add opineeo-widget

or

pnpm add opineeo-widget

Quick Start

import { OpineeoWidget } from 'opineeo-widget';

function App() {
  return (
    <div>
      <h1>Your App</h1>
      
      {/* Inline placement */}
      <OpineeoWidget
        token="your-api-key-here"
        surveyId="your-survey-id"
        position="inline"
        customCSS=".sv { --primary: #3B82F6; }"
      />
      
      {/* Or use fixed corner position */}
      <OpineeoWidget
        token="your-api-key-here"
        surveyId="your-survey-id"
        position="bottom-right"
        feedbackLabel="Give Feedback"
      />
    </div>
  );
}

export default App;

Note: Get your API token and survey ID from Opineeo Dashboard.

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | token | string | required | Your Opineeo API token from opineeo.com | | surveyId | string | undefined | Specific survey ID to display | | customCSS | string | undefined | Custom CSS to style the widget (e.g., CSS variables) | | hidden | boolean | false | Hide the widget initially | | className | string | '' | Custom CSS class for the widget container | | userId | string | undefined | User ID to associate with the response | | extraInfo | string | undefined | Extra information to include with the response | | autoClose | number | 0 | Auto-close delay in milliseconds after submission (0 = no auto-close) | | position | 'inline' \| 'top-right' \| 'top-left' \| 'bottom-right' \| 'bottom-left' | 'inline' | Position of the widget on screen | | feedbackLabel | string | 'Give Feedback' | Label for the feedback button (only used when position is not 'inline') | | onOpen | (containerId: string) => void | undefined | Callback when widget is opened (receives container ID) | | onClose | () => void | undefined | Callback when widget is closed | | onSubmit | (data: any) => void | undefined | Callback when survey is submitted |

Examples

Basic Usage (Inline)

import { OpineeoWidget } from 'opineeo-widget';

function App() {
  return (
    <div>
      <h1>My App</h1>
      <div className="survey-container">
        <OpineeoWidget token="your-api-token" surveyId="survey-id" />
      </div>
    </div>
  );
}

Custom Styling with CSS Variables

<OpineeoWidget
  token="your-api-token"
  surveyId="survey-id"
  customCSS={`
    .sv {
      --primary: #8B5CF6;
      --primary-foreground: #ffffff;
      --border-radius: 12px;
    }
  `}
/>

With Event Handlers

function App() {
  const handleOpen = (containerId: string) => {
    console.log('Widget opened with container:', containerId);
  };

  const handleClose = () => {
    console.log('Widget closed');
  };

  const handleSubmit = (data: any) => {
    console.log('Feedback submitted:', data);
    // Send to your analytics
    analytics.track('survey_completed', data);
  };

  return (
    <OpineeoWidget
      token="your-api-token"
      surveyId="survey-id"
      onOpen={handleOpen}
      onClose={handleClose}
      onSubmit={handleSubmit}
    />
  );
}

Controlled Visibility

function App() {
  const [showWidget, setShowWidget] = useState(false);

  useEffect(() => {
    // Show widget after 5 seconds
    const timer = setTimeout(() => setShowWidget(true), 5000);
    return () => clearTimeout(timer);
  }, []);

  return (
    <OpineeoWidget
      token="your-api-token"
      surveyId="survey-id"
      hidden={!showWidget}
    />
  );
}

Manual Widget Control (Reset/Remount)

function App() {
  const [showWidget, setShowWidget] = useState(true);

  const handleReset = () => {
    // Hide widget
    setShowWidget(false);
    // Remount after 100ms
    setTimeout(() => setShowWidget(true), 100);
  };

  return (
    <>
      <button onClick={handleReset}>Reset Survey</button>
      {showWidget && (
        <OpineeoWidget
          token="your-api-token"
          surveyId="survey-123"
        />
      )}
    </>
  );
}

TypeScript

The package includes full TypeScript definitions. Import types as needed:

import { OpineeoWidget, OpineeoWidgetProps, WidgetPosition } from 'opineeo-widget';

const MyComponent: React.FC = () => {
  const position: WidgetPosition = 'bottom-right';
  
  const widgetProps: OpineeoWidgetProps = {
    token: 'your-api-token',
    surveyId: 'survey-123',
    position: position,
    feedbackLabel: 'Feedback',
    customCSS: '.sv { --primary: #3B82F6; }',
    onSubmit: (data) => console.log(data),
  };

  return <OpineeoWidget {...widgetProps} />;
};

Widget Positioning

The widget supports multiple positioning modes to fit your needs:

Inline (Default)

The widget is embedded directly in your page where you place it:

<div className="my-container">
  <h2>Please share your feedback</h2>
  <OpineeoWidget 
    token="your-token" 
    surveyId="survey-id"
    position="inline"
  />
</div>

Fixed Corner Positions

Display the widget as a fixed button in any corner of the screen. Clicking the button opens the survey in a modal overlay:

// Bottom-right corner (popular for feedback buttons)
<OpineeoWidget 
  token="your-token" 
  surveyId="survey-id"
  position="bottom-right"
  feedbackLabel="Share Feedback"
/>

// Bottom-left corner
<OpineeoWidget 
  token="your-token" 
  surveyId="survey-id"
  position="bottom-left"
  feedbackLabel="Give Feedback"
/>

// Top-right corner
<OpineeoWidget 
  token="your-token" 
  surveyId="survey-id"
  position="top-right"
  feedbackLabel="Help Us Improve"
/>

// Top-left corner
<OpineeoWidget 
  token="your-token" 
  surveyId="survey-id"
  position="top-left"
  feedbackLabel="Feedback"
/>

Available positions:

  • inline - Embedded in page (default)
  • bottom-right - Fixed button in bottom-right corner
  • bottom-left - Fixed button in bottom-left corner
  • top-right - Fixed button in top-right corner
  • top-left - Fixed button in top-left corner

Modal/Custom Container (Inline)

You can also wrap an inline widget in your own modal or custom container:

<Modal isOpen={showSurvey}>
  <OpineeoWidget 
    token="your-token" 
    surveyId="survey-id" 
    position="inline"
  />
</Modal>

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)
  • Mobile browsers (iOS Safari, Chrome Mobile)

License

This project is licensed under a proprietary license. See LICENSE.txt for details.

Copyright (c) 2025 OBRA GURU SERVIÇOS DIGITAIS LTDA. All rights reserved.

Support


Made with ❤️ by Rafael Messias