UNPKG

react-image-section-mapper

Version:

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.

36 lines (32 loc) 883 B
import React from 'react'; interface Section { x: number; y: number; width: number; height: number; title: string; link?: string; id?: string; } interface Theme { primary: string; secondary: string; danger: string; success: string; } interface ImageSectionMapperProps { imageUrl: string; onSave?: (sections: Section[]) => void | Promise<void>; initialSections?: Section[]; sectionTitlePrefix?: string; className?: string; controls?: boolean; theme?: Partial<Theme>; minSectionSize?: number; maxSections?: number; readOnly?: boolean; onSectionClick?: (section: Section) => void; onSectionHover?: (section: Section | null) => void; } declare const ImageSectionMapper: React.FC<ImageSectionMapperProps>; export { ImageSectionMapper, type ImageSectionMapperProps, type Section, type Theme };