
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-image-section-mapper
Advanced tools
react-image-section-mapper is a React component that enables users to create interactive, resizable, and draggable sections on images. It is useful for image annotation, mapping hot zones, or interactive UI elements on images.
A TypeScript React component for creating interactive, resizable, and draggable sections on images. Perfect for creating image maps, hotspots, or annotated areas on images.
Live Demo: https://react-image-section-mapper-demo.vercel.app/
Demo Repo: https://github.com/mdtanvirahamedshanto/react-image-section-mapper-demo
npm install react-image-section-mapper
# or
yarn add react-image-section-mapper
# or
pnpm add react-image-section-mapper
import { ImageSectionMapper } from 'react-image-section-mapper';
function App() {
const handleSave = (sections) => {
console.log('Sections:', sections);
// Save sections to your backend
};
return (
<ImageSectionMapper
imageUrl="/path/to/your/image.jpg"
onSave={handleSave}
/>
);
}
import { ImageSectionMapper, Section } from 'react-image-section-mapper';
function AdvancedExample() {
// Initial sections data
const initialSections: Section[] = [
{
id: '1',
x: 100,
y: 100,
width: 200,
height: 150,
title: 'Custom Section',
link: '/custom-link'
}
];
// Handlers
const handleSave = async (sections: Section[]) => {
try {
await saveToBackend(sections);
} catch (error) {
console.error('Failed to save sections:', error);
}
};
const handleSectionClick = (section: Section) => {
console.log('Clicked section:', section);
};
const handleSectionHover = (section: Section | null) => {
if (section) {
console.log('Hovering section:', section);
}
};
return (
<ImageSectionMapper
imageUrl="/path/to/your/image.jpg"
initialSections={initialSections}
onSave={handleSave}
onSectionClick={handleSectionClick}
onSectionHover={handleSectionHover}
sectionTitlePrefix="Area"
minSectionSize={50}
maxSections={10}
theme={{
primary: 'blue',
secondary: 'gray',
danger: 'red',
success: 'green'
}}
readOnly={false}
controls={true}
className="custom-mapper"
/>
);
}
| Prop | Type | Default | Description |
|---|---|---|---|
imageUrl | string | Required | URL of the image to map sections on |
onSave | (sections: Section[]) => void | Promise<void> | - | Callback when sections are saved |
initialSections | Section[] | [] | Initial sections to display |
sectionTitlePrefix | string | 'Section' | Prefix for auto-generated section titles |
className | string | '' | Additional CSS classes |
controls | boolean | true | Show/hide control buttons |
theme | Theme | defaultTheme | Custom theme colors |
minSectionSize | number | 20 | Minimum width/height of sections |
maxSections | number | - | Maximum number of sections allowed |
readOnly | boolean | false | Disable editing capabilities |
onSectionClick | (section: Section) => void | - | Callback when a section is clicked |
onSectionHover | (section: Section | null) => void | - | Callback when a section is hovered |
interface Section {
id?: string;
x: number;
y: number;
width: number;
height: number;
title: string;
link?: string;
}
interface Theme {
primary: string;
secondary: string;
danger: string;
success: string;
}
The component uses Tailwind CSS classes by default. You can customize the appearance by:
theme prop to change colorsclassName prop/* Example custom styles */
.custom-mapper .section-title {
font-weight: bold;
}
.custom-mapper .resize-handle:hover {
background-color: #4a90e2;
}
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)# Install dependencies
npm install
# Run type checking
npm run type-check
# Build the package
npm run build
# Run tests
npm test
MIT © Md Tanvir Ahamed Shanto
If you have any questions or need help, please:
Made with ❤️ by Md Tanvir Ahamed Shanto
FAQs
react-image-section-mapper is a React component that enables users to create interactive, resizable, and draggable sections on images. It is useful for image annotation, mapping hot zones, or interactive UI elements on images.
The npm package react-image-section-mapper receives a total of 0 weekly downloads. As such, react-image-section-mapper popularity was classified as not popular.
We found that react-image-section-mapper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.