sensitive-image-review
v0.1.1
Published
React components for safer sensitive image review.
Readme
sensitive-image-review
Summary
Content moderation can be challenging, especially when reviewing graphic images. This NPM package empowers reviewers with tools to minimize psychological strain by applying layers such as blurred and grayscale over content.
Spotlight controls allow reviewers to focus on specific areas of an image with precision. Other safety features, including a "Panic Button" and keyboard shortcuts, ensure a streamlined and secure workflow for handling sensitive content.
While we truly believe that using this package in any content moderation tool is a wise decision, we make no specific claims regarding health benefits or safety, and we provide no warranty either. Give it a try and reach your own conclusions.
Technical Features
- Canvas-based rendering with blurred baseline view
- Circular feathered spotlight reveal around mouse/keyboard focus
- Blur strength slider with support for
0blur - Safety actions:
Unblur All/Blur Alltoggle andPanicre-blur - Keyboard support with built-in mappings (
arrows,wasd) and custom key maps - Inline control tooltips showing relevant shortcut hints
- Exposure event stream (
blur-change,spotlight-active,spotlight-off,grayscale-toggle,panic) - Debounced logging for continuous interactions
- Composable API layers:
SensitiveViewer,SensitiveCard, andSensitiveFullView - ESM/CJS library output with TypeScript declarations
Implementation Overview
SensitiveVieweris the core canvas renderer and interaction engine.SensitiveCardis a compact wrapper for gallery contexts.SensitiveFullViewis a larger wrapper for focused review tasks.Toolbargroups controls by function:- Image controls: blur slider, grayscale toggle
- Spotlight controls: on/off toggle, radius slider, movement hint
- Safety controls: unblur/blur toggle, panic button
Default keyboard mappings:
arrows: arrows move spotlight,+/-adjust radius,Stoggles spotlight,Gtoggles grayscale,Escapepanicwasd:W/A/S/Dmove spotlight,[/]adjust radius,Etoggles spotlight,Qtoggles grayscale,Escapepanic
Install
npm install sensitive-image-reviewQuick Start
import { SensitiveCard, SensitiveFullView, SensitiveViewer } from "sensitive-image-review";
export function Example() {
return (
<div style={{ display: "grid", gap: 16 }}>
<SensitiveCard src="/sample.jpg" alt="Reported content thumbnail" />
<SensitiveFullView src="/sample.jpg" alt="Reported content detailed review" />
<SensitiveViewer src="/sample.jpg" alt="Composable core" showControls minBlur={0} />
</div>
);
}Core Props (SensitiveViewer)
src,altinitialBlur,initialGrayscale,minBlur,maxBlurspotlightRadius,minSpotlightRadius,maxSpotlightRadiuskeyMap,spotlightSpeedshowControls,compactControls,controlsPositionviewportAspectRatio,minViewportHeight,maxViewportHeightonExposure
Public Components
SensitiveViewer: composable base componentSensitiveCard: compact wrapper for grid/card presentationSensitiveFullView: full-size wrapper for dedicated review views
Exposure Logging
Use onExposure to receive events:
blur-changespotlight-activespotlight-offgrayscale-togglepanic
Continuous events are debounced by the internal useExposureLog hook.
Development
npm run storybook
npm run typecheck
npm run build
npm run lintPublishing
The package exports ESM/CJS builds and .d.ts files from dist/.
License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

