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

image-context

v1.0.3

Published

An interactive React/Next.js micro-narrative component with structural hotspots, appearance modes, and contextual image blurring.

Readme

Image Context

Image Context is a React and Next.js component that lets you add interactive context to your images in react and nextJS.

---

## Installation

```bash
npm install image-context

or

pnpm add image-context

or

yarn add image-context

Basic Usage

import { ImageContext } from "image-context";

export default function Example() {
  return (
    <ImageContext
      alt = "An image of the ancient Karnak Temple in Luxor, Egypt."
      src="/temple.jpg"
      context="Sunlit columns with hieroglyphs at the ancient Karnak Temple in Luxor, Egypt."
    />
  );
}

Custom Context Content

The context prop can also receive a render function.

<ImageContext
  src="/friends.jpg"
  context={({ isVisible }) => (
    <div
      className={`transition-all duration-500 ${
        isVisible
          ? "opacity-100 translate-y-0"
          : "opacity-0 translate-y-4"
      }`}
    >
      <h3>Friends at the beach</h3>
      <p>A memorable summer trip.</p>
    </div>
  )}
/>

This allows you to build fully customized context panels with animations and rich content.


Hotspots

Attach contextual information to specific locations within an image.

<ImageContext
  src="/group-photo.jpg"
  showTrigger={false}
>
  <Hotspot
    x={25}
    y={60}
    context="John posing near the entrance."
  />

  <Hotspot
    x={70}
    y={40}
    context="Sarah enjoying the event."
  />
</ImageContext>

Example

<ImageContext
  src="/travel.jpg"
  context="A beautiful view of the city skyline during sunset."
>
  <Hotspot
    x={45}
    y={35}
    context="Historic cathedral built in the 18th century."
  />

  <Hotspot
    x={70}
    y={60}
    context="Popular local marketplace."
  />
</ImageContext>

Components

ImageContext

The main image container responsible for displaying contextual information.

Props

| Prop | Type | Description | |--------|--------|--------| | src | string | Image source | | context | string | ReactNode | Render Function | Content displayed when context is revealed | | triggerSize | "sm" | "md" | "lg" | Size of the context trigger | | showTrigger | boolean | Show or hide the main trigger | | children | ReactNode | Hotspots and custom content |


Hotspot

Attach contextual information to specific positions within an image.

Props

| Prop | Type | Description | |--------|--------|--------| | x | number | Horizontal position (%) | | y | number | Vertical position (%) | | context | string | ReactNode | Hotspot content | | triggerSize | "sm" | "md" | "lg" | Hotspot trigger size |


Accessibility

Image Context is designed to complement—not replace—proper image accessibility practices.

Always provide meaningful image descriptions and alt text where appropriate.


TypeScript Support

Image Context ships with full TypeScript support out of the box.


License

MIT