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

lumi-feedback-widget

v1.0.2

Published

React feedback widget với screenshot, annotation tools và S3 upload

Readme

lumi-feedback-widget

React feedback widget với khả năng chụp màn hình, annotation tools, và tích hợp S3 upload.

✨ Tính năng

  • 📸 Chụp màn hình - Tự động capture trang web
  • ✏️ Annotation Tools - Vẽ, highlight, mũi tên, text
  • 🏷️ Tag System - Phân loại: Lỗi, Tính năng, Góp ý...
  • ☁️ S3 Upload - Tích hợp s3-upload-service để lưu trữ
  • 🎨 Customizable - Theme, position, tags tùy chỉnh
  • 🌙 Dark Mode - Hỗ trợ sẵn

📦 Cài đặt

# npm
npm install lumi-feedback-widget

# pnpm
pnpm add lumi-feedback-widget

# yarn
yarn add lumi-feedback-widget

🚀 Quick Start

1. Import CSS

// main.tsx hoặc App.tsx
import 'lumi-feedback-widget/styles.css'

2. Sử dụng Component

import { FeedbackWidget } from 'lumi-feedback-widget'

function App() {
  const handleSubmit = async (data) => {
    console.log('Feedback:', data)
    // Gửi tới API của bạn
    await fetch('/api/feedback', {
      method: 'POST',
      body: JSON.stringify(data)
    })
  }

  return (
    <div>
      <YourApp />
      
      <FeedbackWidget
        position="bottom-right"
        onSubmit={handleSubmit}
        metadata={{ version: '1.0.0', userId: 'user123' }}
      />
    </div>
  )
}

⚙️ Props

| Prop | Type | Default | Mô tả | |------|------|---------|-------| | position | 'bottom-right' \| 'bottom-left' \| 'top-right' \| 'top-left' | 'bottom-right' | Vị trí nút feedback | | tags | Tag[] | Built-in tags | Danh sách tags tùy chỉnh | | onSubmit | (data: FeedbackData) => Promise<void> | - | Callback khi submit | | metadata | object | {} | Metadata bổ sung (version, userId...) | | theme | 'light' \| 'dark' \| 'auto' | 'auto' | Theme | | s3Config | S3Config | - | Cấu hình S3 upload |

☁️ S3 Upload

Để lưu feedback lên S3, cần cài thêm s3-upload-service:

pnpm add s3-upload-service
<FeedbackWidget
  onSubmit={handleSubmit}
  s3Config={{
    apiKey: import.meta.env.VITE_S3_API_KEY,
    serviceUrl: import.meta.env.VITE_S3_SERVICE_URL,
    folderName: 'my-project-feedback',
  }}
/>

Khi bật S3:

  • Screenshot sẽ được upload lên S3 (URL thay vì base64)
  • Toàn bộ feedback list lưu trong feedback-list.json
  • CRUD tự động đồng bộ

📋 FeedbackData Structure

interface FeedbackData {
  id: string
  name: string
  content: string
  tags: string[]
  screenshot?: string  // Base64 hoặc S3 URL
  annotations: Annotation[]
  metadata: {
    url: string
    userAgent: string
    viewport: { width: number; height: number }
    timestamp: string
    version?: string
    userId?: string
  }
  createdAt: string
}

🎨 Custom Tags

const customTags = [
  { id: 'bug', label: 'Lỗi', emoji: '🐛', color: '#ef4444' },
  { id: 'feature', label: 'Tính năng', emoji: '✨', color: '#8b5cf6' },
  { id: 'improvement', label: 'Góp ý', emoji: '💡', color: '#f59e0b' },
  { id: 'question', label: 'Hỏi đáp', emoji: '❓', color: '#3b82f6' },
]

<FeedbackWidget tags={customTags} onSubmit={handleSubmit} />

🔧 Advanced: Components Export

Library cũng export các components riêng lẻ:

import {
  FeedbackWidget,
  FeedbackButton,
  FeedbackModal,
  FeedbackList,
  TagSelector,
  useFeedbackStore,
  captureScreenshot,
} from 'lumi-feedback-widget'

FeedbackList (Admin)

Hiển thị danh sách feedback cho admin:

import { FeedbackList } from 'lumi-feedback-widget'

function AdminPage() {
  const [feedbacks, setFeedbacks] = useState([])

  return (
    <FeedbackList
      feedbacks={feedbacks}
      onDelete={(id) => setFeedbacks(prev => prev.filter(f => f.id !== id))}
    />
  )
}

🛠️ Development

# Clone repo
git clone https://github.com/lumi/feedback-widget

# Install
pnpm install

# Dev mode (demo app)
pnpm dev

# Build library
pnpm build:lib

# Preview
pnpm preview

📁 Project Structure

feedback-widget/
├── src/
│   ├── lib/feedback-widget/     # Library source
│   │   ├── components/
│   │   │   ├── FeedbackButton.tsx
│   │   │   ├── FeedbackModal.tsx
│   │   │   ├── AnnotationCanvas.tsx
│   │   │   ├── TagSelector.tsx
│   │   │   ├── FeedbackList.tsx
│   │   │   └── Toast.tsx
│   │   ├── store/
│   │   │   └── useFeedbackStore.ts
│   │   ├── utils/
│   │   │   └── screenshot.ts
│   │   ├── types/
│   │   │   └── index.ts
│   │   └── index.tsx            # Main exports
│   ├── App.tsx                  # Demo app
│   └── main.tsx
├── package.json
├── vite.config.ts
└── README.md

📄 License

MIT © Lumi Team