Installation
Choose your framework. The registry installs one component file and its PixiJS dependency.
Installation unavailable
The preview is public, but its installable release is still being prepared.
The registry command writes the component to src/lib/components/ui/PencilLogo.svelte and installs its dependencies.
The registry command writes the component to src/components/ui/PencilLogo.tsx and installs its dependencies.
The registry command writes the component to src/components/ui/PencilLogo.vue and installs its dependencies.
The generated component builds its SVG distance field locally and renders the intermediate luminance pass on the GPU.
PixiJS provides the render texture pipeline for both WebGPU and WebGL.
Overview
Pencil Logo is a true two-pass shader. The first pass renders the SVG distance field as a grayscale subject; the second derives noisy luminance gradients and directional graphite texture from that image.
The paper covers the entire canvas. Procedural noise replaces the reference noise texture while preserving its distorted sampling, paper grain, and tonal strokes.
Basic usage
The shader fills its parent. Your layout decides whether that parent is a card, hero, or viewport.
- The effect is intentionally monochrome by default. Paper and graphite colors can be tinted without changing the sketch response.
- Subject tone changes the source-pass luminance and therefore the density of the pencil texture, not a separate overlay.
- The generated drawing is static and rerenders only after an input, control, size, or quality change.
Component API
Types below match the selected Svelte component.
Additional classes for the parent-sized root element.
- Type
string
Inline SVG markup, an SVG URL, or a data URL used as the pencil-sketch subject.
- Type
string- Range / values
Inline SVG, URL, or data URL
Size of the SVG subject within the paper canvas.
- Type
number- Default
1- Range / values
0.2–2
Horizontal position in normalized canvas units.
- Type
number- Default
0- Range / values
-0.5–0.5
Vertical position in normalized canvas units.
- Type
number- Default
0- Range / values
-0.5–0.5
Clockwise rotation of the SVG subject in degrees.
- Type
number- Default
0- Range / values
-180–180
Base color of the full-canvas paper background.
- Type
string- Default
"#FFFFFF"
Color of the pencil contours and tonal strokes.
- Type
string- Default
"#171717"
Scale of the noisy graphite marks relative to the canvas.
- Type
number- Default
1- Range / values
0.35–3
Strength of the luminance-driven directional pencil texture.
- Type
number- Default
1- Range / values
0–2
Distortion and irregularity of the detected pencil contours.
- Type
number- Default
1- Range / values
0–2
Darkness of the source logo before the pencil pass is applied.
- Type
number- Default
1- Range / values
0–2
Stops the render loop while keeping the current frame visible.
- Type
boolean- Default
false
Enables pointer-driven effects when the shader supports them.
- Type
boolean- Default
false
Caps render resolution independently from the element size.
- Type
number- Default
2- Range / values
1–3
Scales GPU resolution without changing layout dimensions.
- Type
number- Default
1- Range / values
0.25–1
Runs after the shader is mounted successfully, including a WebGL fallback.
- Type
(backend: ShaderBackend) => void- Range / values
webgpu, webgl
Runs when automatic initialization changes the requested WebGPU backend to WebGL.
- Type
(backend: ShaderBackend, reason: string) => void- Range / values
webgl
Reports source-loading or renderer failures so the host application can decide how to recover.
- Type
(error: Error) => void
Exposes the imperative component lifecycle methods.
- Type
Component public instance- Range / values
pause, resume, reset, resize, destroy
Types below match the selected React component.
Additional classes for the parent-sized root element.
- Type
string
Inline SVG markup, an SVG URL, or a data URL used as the pencil-sketch subject.
- Type
string- Range / values
Inline SVG, URL, or data URL
Size of the SVG subject within the paper canvas.
- Type
number- Default
1- Range / values
0.2–2
Horizontal position in normalized canvas units.
- Type
number- Default
0- Range / values
-0.5–0.5
Vertical position in normalized canvas units.
- Type
number- Default
0- Range / values
-0.5–0.5
Clockwise rotation of the SVG subject in degrees.
- Type
number- Default
0- Range / values
-180–180
Base color of the full-canvas paper background.
- Type
string- Default
"#FFFFFF"
Color of the pencil contours and tonal strokes.
- Type
string- Default
"#171717"
Scale of the noisy graphite marks relative to the canvas.
- Type
number- Default
1- Range / values
0.35–3
Strength of the luminance-driven directional pencil texture.
- Type
number- Default
1- Range / values
0–2
Distortion and irregularity of the detected pencil contours.
- Type
number- Default
1- Range / values
0–2
Darkness of the source logo before the pencil pass is applied.
- Type
number- Default
1- Range / values
0–2
Stops the render loop while keeping the current frame visible.
- Type
boolean- Default
false
Enables pointer-driven effects when the shader supports them.
- Type
boolean- Default
false
Caps render resolution independently from the element size.
- Type
number- Default
2- Range / values
1–3
Scales GPU resolution without changing layout dimensions.
- Type
number- Default
1- Range / values
0.25–1
Runs after the shader is mounted successfully, including a WebGL fallback.
- Type
(backend: ShaderBackend) => void- Range / values
webgpu, webgl
Runs when automatic initialization changes the requested WebGPU backend to WebGL.
- Type
(backend: ShaderBackend, reason: string) => void- Range / values
webgl
Reports source-loading or renderer failures so the host application can decide how to recover.
- Type
(error: Error) => void
Exposes the imperative component lifecycle methods.
- Type
PencilLogoHandle- Range / values
pause, resume, reset, resize, destroy
Types below match the selected Vue component.
Additional classes for the parent-sized root element.
- Type
string
Inline SVG markup, an SVG URL, or a data URL used as the pencil-sketch subject.
- Type
string- Range / values
Inline SVG, URL, or data URL
Size of the SVG subject within the paper canvas.
- Type
number- Default
1- Range / values
0.2–2
Horizontal position in normalized canvas units.
- Type
number- Default
0- Range / values
-0.5–0.5
Vertical position in normalized canvas units.
- Type
number- Default
0- Range / values
-0.5–0.5
Clockwise rotation of the SVG subject in degrees.
- Type
number- Default
0- Range / values
-180–180
Base color of the full-canvas paper background.
- Type
string- Default
"#FFFFFF"
Color of the pencil contours and tonal strokes.
- Type
string- Default
"#171717"
Scale of the noisy graphite marks relative to the canvas.
- Type
number- Default
1- Range / values
0.35–3
Strength of the luminance-driven directional pencil texture.
- Type
number- Default
1- Range / values
0–2
Distortion and irregularity of the detected pencil contours.
- Type
number- Default
1- Range / values
0–2
Darkness of the source logo before the pencil pass is applied.
- Type
number- Default
1- Range / values
0–2
Stops the render loop while keeping the current frame visible.
- Type
boolean- Default
false
Enables pointer-driven effects when the shader supports them.
- Type
boolean- Default
false
Caps render resolution independently from the element size.
- Type
number- Default
2- Range / values
1–3
Scales GPU resolution without changing layout dimensions.
- Type
number- Default
1- Range / values
0.25–1
Runs after the shader is mounted successfully, including a WebGL fallback.
- Type
(backend: ShaderBackend) => void- Range / values
webgpu, webgl
Runs when automatic initialization changes the requested WebGPU backend to WebGL.
- Type
(backend: ShaderBackend, reason: string) => void- Range / values
webgl
Reports source-loading or renderer failures so the host application can decide how to recover.
- Type
(error: Error) => void
Exposes the imperative component lifecycle methods.
- Type
Component public instance- Range / values
pause, resume, reset, resize, destroy