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

@punkbit/react-hn-reader

v1.6.0

Published

An experimental React component for displaying Hacker News stories with beautiful parallax scrolling

Readme

Hacker News Reader

An experimental Hacker News reader built with React, TypeScript, and modern tooling. Features parallax scrolling effects and a polished UX.

Hacker News Reader React TypeScript Vite

⚠️ IMPORTANT: Installation Required

You MUST install via NPM. This package uses styled-components which requires proper bundling. CDN imports will NOT work correctly.

npm install @punkbit/react-hn-reader styled-components

Quick Start

Standard React Apps

import { HackerNewsReader, ThemeProvider, DefaultStyles } from '@punkbit/react-hn-reader'

function App() {
  return (
    <ThemeProvider>
      <DefaultStyles />
      <HackerNewsReader />
    </ThemeProvider>
  )
}

Astro.js / SSR Frameworks

⚠️ Use ScopedDefaultStyles and selfContained mode:

// src/components/HNReader.tsx
import { 
  HackerNewsReader, 
  ThemeProvider, 
  ScopedDefaultStyles 
} from '@punkbit/react-hn-reader'

export default function HNReader() {
  return (
    <ThemeProvider>
      <div data-react-hn-reader style={{ height: '100vh' }}>
        <ScopedDefaultStyles />
        <HackerNewsReader 
          selfContained={true}
          scrollContainerHeight="100vh"
        />
      </div>
    </ThemeProvider>
  )
}
---
// src/pages/hn.astro
import HNReader from '../components/HNReader';
---

<html>
  <head><title>HN Reader</title></head>
  <body style="margin: 0;">
    <HNReader client:load />
  </body>
</html>

Why this is needed for Astro.js:

  • Astro adds scoped styles with overflow: hidden that break window scrolling
  • selfContained={true} creates an internal scrollable container
  • ScopedDefaultStyles prevents CSS from leaking to other parts of your app

Features

  • Parallax scrolling - 3D depth effect with three viewport layers
  • 🖱️ Scroll indicator - Animated mouse icon in top-right (fades on scroll)
  • 🖤 Fixed black logo - Appears at bottom-right when scrolling down
  • ➡️ Arrow icons - Each story displays an arrow-out icon
  • 🎨 Customizable themes - Override all colors via ThemeProvider
  • 🔧 TypeScript - Full type support
  • 📦 SSR Compatible - Works with Astro.js, Next.js, etc.

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | apiUrl | string | HN Firebase API | Base URL for stories API | | initialCount | number | 30 | Initial stories to load | | enableLoadMore | boolean | true | Show load more button | | onStoryClick | (story) => void | - | Click handler | | selfContained | boolean | false | Enable for SSR/Astro.js | | scrollContainerHeight | string \| number | '100vh' | Scroll container height | | containerClassName | string | - | CSS class for scroll container |

Development

# Install dependencies
npm install

# Dev mode (normal)
npm run dev

# Build library
npm run build

# Build preview
npm run build:preview

# Test preview locally
npm run serve

License

MIT © Punkbit