Security News
Highlights from the 2024 Rails Community Survey
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
react-image-enlarger
Advanced tools
A medium.com style image zoom component with gesture dismissal similar to that found in the iOS Photos app. Originally built for use in Sancho-UI. Try the demo here.
Install react-image-enlarger
and react-gesture-responder
using yarn or npm.
yarn add react-image-enlarger react-gesture-responder
import Image from "react-image-enlarger";
function SingleSource() {
const [zoomed, setZoomed] = React.useState(false);
return (
<Image
style={{ width: "200px", height: "auto" }}
zoomed={zoomed}
src="my-image.jpg"
alt="The best dog ever"
onClick={() => setZoomed(true)}
onRequestClose={() => setZoomed(false)}
/>
);
}
Any additional props beyond the ones listed below are passed to the thumbnail image.
Name | Type | Default Value | Description |
---|---|---|---|
zoomed* | boolean | Whether the enlarged image is shown | |
onRequestClose* | () => void; | A callback for closing the zoomed image | |
renderLoading | React.ReactNode | Render a loading indicator | |
src* | String | The thumbnail image source (and enlarged, if not provided) | |
enlargedSrc | String | An optional larger image source |
MIT
FAQs
A medium.com style image zoom component with gesture dismissal
We found that react-image-enlarger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.