
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
react-mask-editor
Advanced tools
A drop-in component to add simple image mask editing to your React application. Uses <canvas>
for rendering & interaction, with optional support for customizing how the mask is displayed & edited.
You give React Mask Editor an image, and it lets the user 'scribble' over that image to create a 1-bit (black or white) mask. Think Photoshop, Lightroom, or Aperture.
First, some setup:
yarn install react-mask-editor
import { MaskEditor, toMask } from "react-mask-editor";
node_modules/react-mask-editor/dist/style.css
somewhere in your bundle.Usage:
const MyComponent: React.FC<{}> = () => {
const canvas = React.useRef<HTMLCanvasElement>();
return <>
<MaskEditor
src="https://placekitten/256/256"
canvasRef={canvas}
/>
<button
onClick={() => console.log(toMask(canvas.current))}
>
Get Mask
</button>
</>
}
You can customize the editor using additional, optional props:
Prop | Description | Default |
---|---|---|
cursorSize | Radius (in pixels) of the brush for editing the mask | 10 |
onCursorSizeChange | Callback fired when the user changes the brush size via mousewheel. If not provided, mouse wheel events will be ignored. | undefined |
maskOpacity | CSS opacity, decimal between 0 – 1 | 0.75 |
maskColor | A hex color (with or without leading '#'). | #23272d |
maskBlendMode | The CSS blending mode for the mask layer. Doesn't affect the output mask, just how it renders on top of your source image. | normal |
FAQs
General-purpose mask editor for React image manipulation apps
The npm package react-mask-editor receives a total of 269 weekly downloads. As such, react-mask-editor popularity was classified as not popular.
We found that react-mask-editor 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
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.