Renders the input as chalk on a blackboard, with outlined edges and cross-hatched shading.
Also known as: Chalkboardchalk drawingblackboard effect
Moves in browsers that support WebGPU
This device could not render the demo — showing a still
Code reflects the control values
React
// Renders only in browsers with WebGPU.
// /samples/… are this site’s sample files — point them at your own image or video.
import { Shader, Chalkboard, ImageTexture } from 'shaders/react'
export default function ShaderEffect() {
return (
<Shader style={{ width: '100%', height: 320 }} disableTelemetry>
<ImageTexture
objectFit="cover"
url="/samples/still.jpg" />
<Chalkboard />
</Shader>
)
}
Vue
<!-- Renders only in browsers with WebGPU. -->
<!-- /samples/… are this site’s sample files — point them at your own image or video. -->
<script setup lang="ts">
import { Shader, Chalkboard, ImageTexture } from 'shaders/vue'
</script>
<template>
<Shader style="width: 100%; height: 320px" :disable-telemetry="true">
<ImageTexture
object-fit="cover"
url="/samples/still.jpg"/>
<Chalkboard/>
</Shader>
</template>
Svelte
<!-- Renders only in browsers with WebGPU. -->
<!-- /samples/… are this site’s sample files — point them at your own image or video. -->
<script>
import { Shader, Chalkboard, ImageTexture } from 'shaders/svelte'
</script>
<Shader style="width: 100%; height: 320px" disableTelemetry>
<ImageTexture
objectFit="cover"
url="/samples/still.jpg" />
<Chalkboard />
</Shader>
Solid
// Renders only in browsers with WebGPU.
// /samples/… are this site’s sample files — point them at your own image or video.
import { Shader, Chalkboard, ImageTexture } from 'shaders/solid'
export default function ShaderEffect() {
return (
<Shader style={{ width: '100%', height: '320px' }} disableTelemetry>
<ImageTexture
objectFit="cover"
url="/samples/still.jpg" />
<Chalkboard />
</Shader>
)
}
JavaScript
// Renders only in browsers with WebGPU.
// /samples/… are this site’s sample files — point them at your own image or video.
// expects <canvas id="canvas" style="width:100%;height:320px"></canvas> on the page
import { createShader } from 'shaders/js'
const shader = await createShader(document.getElementById("canvas"), {
components: [
{
type: 'ImageTexture',
props: {
objectFit: 'cover',
url: '/samples/still.jpg',
},
},
{
type: 'Chalkboard',
}
]
}, { disableTelemetry: true })
Props · Chalkboard
Changes apply to the demo above and to the code tabs. Descriptions come from the library registry (MIT).
Name
Value
Default
Range / options
Description
boardColorBoard
#000000
—
Background board color
chalkColorChalk
#eceadb
—
Chalk stroke color
edgeSensitivityEdge Sensitivity
0.5
0 – 1 (step 0.01)
How readily edges are detected and drawn as chalk strokes
edgeThicknessEdge Thickness
1.5
0.5 – 4 (step 0.1)
Thickness of the chalk outline strokes
shadingShading
0.05
0 – 1 (step 0.01)
Amount of cross-hatch shading filling darker regions
hatchScaleHatch Scale
16
3 – 24 (step 0.5)
Spacing of the cross-hatch lines in pixels
grainGrain
0.45
0 – 1 (step 0.01)
Chalk dustiness / grain that breaks up the strokes
Every component also takes blendMode · opacity · visible · maskSource/maskType · boundingBox · id
It makes an image look as if it were redrawn in chalk on a dark board. Chalk dust breaks up the outlines, while fine hatching fills darker areas.
The default `boardColor` is `#000000`, and the default `chalkColor` is `#eceadb`. `edgeSensitivity` defaults to 0.5 and ranges from 0 to 1 to set how readily outlines appear; `edgeThickness` defaults to 1.5 and ranges from 0.5 to 4 to set line width. `shading` defaults to 0.05 and ranges from 0 to 1 to control cross-hatched shading.
Put the image or content layer underneath it first. Pair it with `Engraving` or `Paper` for a handmade surface, but low contrast between the board and chalk can hide the outlines.
When to use
Use it for educational illustrations, menu boards, and hand-drawn posters. Avoid it for product photos that need accurate color or bright, clean UI.