
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
scratchblocks-react
Advanced tools
Render scratchblocks in React!
npm install scratchblocks scratchblocks-react
# or
yarn add scratchblocks scratchblocks-react
Note that in addition to the scratchblocks-react package, you must have scratchblocks installed (and react).
import ScratchBlocks from "scratchblocks-react"
function MyComponent() {
return (
<ScratchBlocks blockStyle="scratch3">
{`
when green flag clicked
forever
move (10) steps
end
`}
</ScratchBlocks>
)
}
In this example, the user can edit the Scratch code.
import ScratchBlocks from "scratchblocks-react"
function MyComponent() {
const [code, setCode] = useState("move (10) steps")
return (
<div>
<textarea
value={code}
onChange={(event) => setCode(event.target.value)}
/>
<ScratchBlocks blockStyle="scratch3">{code}</ScratchBlocks>
</div>
)
}
import ScratchBlocks from "scratchblocks-react"
// Load some extra languages (English comes loaded by default)
import scratchblocks from "scratchblocks"
import es from "scratchblocks/locales/es.json" // Spanish
import de from "scratchblocks/locales/de.json" // German
// Register the language files with scratchblocks
scratchblocks.loadLanguages({ es, de })
function MyComponent() {
return (
<ScratchBlocks
blockStyle="scratch3"
languages={["en", "es", "de"]} // Choose which languages to allow
>
{`
when green flag clicked
por siempre
gehe (10) er Schritt
fin
`}
</ScratchBlocks>
)
}
| Name | Default | Valid Values | Description |
|---|---|---|---|
| blockStyle | "scratch2" | "scratch2" or "scratch3" | Changes the visual style of the rendered blocks. |
| languages | ["en"] | An array of language codes such as ["en", "de"] | Enables the use of non-english languages. Requires additional setup. |
| ... and more! | All other props (such as "className" and "style") will be passed directly to the div. |
FAQs
Render scratchblocks in React
We found that scratchblocks-react 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
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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.