SVG Logo Reveal: Masks, clipPath, and Stroke Animation
For a clean SVG logo reveal, use a clipPath for hard-edged wipes, a mask for soft or textured reveals, and stroke animation only for logos genuinely drawn as lines. Keep the finished logo visible by default, add motion as an enhancement, and provide a reduced-motion path.
For a clean SVG logo reveal, use a clipPath for hard-edged wipes, a mask for soft or textured reveals, and stroke animation only for logos genuinely drawn as lines. Keep the finished logo visible by default, add motion as an enhancement, and provide a reduced-motion path.
Choose the reveal method from the logo, not the trend
The best technique depends on the artwork you already have. A reveal should reinforce the brand mark instead of forcing it into an effect that does not fit.
- Use clipPath for a crisp wipe. It is a strong default for filled symbols and wordmarks when the reveal edge should be hard and geometric.
- Use a mask for a soft, feathered, textured, or partially transparent reveal. A mask can express intermediate visibility, so it can do more than an on-or-off crop.
- Use stroke animation for real strokes. Signature marks, monoline symbols, and outlined lettering can look natural when drawn with stroke-dasharray and stroke-dashoffset.
- Use staged timing for multi-part marks. Reveal the symbol, then the wordmark, then stop. If the choreography becomes difficult to maintain with CSS delays, use the decision framework in CSS vs GSAP for SVG.
Do not trace a filled wordmark just to manufacture a drawing effect. That often changes its visual weight and weakens brand recognition. For a solid logo, a short wipe is usually clearer.
Prepare the SVG before animating it
A polished reveal starts with a clean asset. Export the final approved logo, not an earlier design file, and preserve the official proportions, spacing, and colors. If the wordmark depends on a commercial typeface, use the approved outlined artwork rather than live SVG text. The accessible name will carry the textual meaning, while the paths preserve the exact brand appearance.
Organize the file around parts that need independent timing. A practical structure is one group for the symbol and one for the wordmark. Remove invisible editor layers, duplicate shapes, metadata, and unnecessary points, but compare the optimized result with the source before shipping. Optimization must not alter the mark.
Keep a useful viewBox, include intrinsic width and height attributes, and make the displayed size responsive in CSS. The intrinsic dimensions help the browser reserve the correct aspect ratio, reducing the chance of layout movement while the page loads.
Finally, make every mask and clipping ID unique on the page. Two inline SVG instances that both use id="logo-mask" can resolve the wrong reference. Use a component-generated suffix when the logo appears more than once.
Build a static-first mask reveal
The following example keeps the artwork in its completed state by default. Motion is added only when the user has not requested reduced motion. The mask uses explicit user-space bounds and mask-type="alpha", so opacity determines visibility. MDN documents both the SVG mask element and the difference between alpha and luminance masks.
<svg
class="logo-reveal"
viewBox="0 0 320 96"
width="320"
height="96"
role="img"
aria-labelledby="northstar-logo-title"
>
<title id="northstar-logo-title">Northstar</title>
<defs>
<mask
id="northstar-logo-mask"
x="0"
y="0"
width="320"
height="96"
maskUnits="userSpaceOnUse"
maskContentUnits="userSpaceOnUse"
mask-type="alpha"
>
<rect
class="logo-reveal__mask"
x="0"
y="0"
width="320"
height="96"
fill="white"
></rect>
</mask>
</defs>
<g mask="url(#northstar-logo-mask)" fill="currentColor">
<path d="M48 16 62 40 88 48 62 56 48 80 34 56 8 48 34 40Z"></path>
<path d="M112 29h124v14H112zM112 53h176v14H112z"></path>
</g>
</svg>.logo-reveal {
display: block;
width: min(20rem, 100%);
height: auto;
}
.logo-reveal__mask {
transform: scaleX(1);
transform-box: fill-box;
transform-origin: left center;
}
@media (prefers-reduced-motion: no-preference) {
.logo-reveal__mask {
transform: scaleX(0);
animation: logo-mask-reveal 900ms cubic-bezier(0.22, 1, 0.36, 1) 150ms both;
}
}
@keyframes logo-mask-reveal {
from {
transform: scaleX(0);
}
to {
transform: scaleX(1);
}
}The base rule shows the entire logo. If animation CSS does not run, the final brand mark remains visible. Under no-preference, the white mask rectangle starts collapsed and expands from the left. transform-box: fill-box makes the origin relative to the rectangle instead of the full SVG viewport; MDN explains this reference-box behavior in its transform-box reference.
This mask has a hard edge, but the same architecture can support a gradient or texture later. If the final design will always use a crisp rectangle, a clipping path is simpler.
Use clipPath for the cleanest hard-edged wipe
A clipping path restricts the region where paint can appear. Content outside that region is not drawn, as described in MDN’s clipPath reference. Unlike a mask, a clip does not provide partially visible pixels. That makes it a good match for straight wipes, circles, angled polygons, and other precise silhouettes.
<svg
class="logo-clip"
viewBox="0 0 320 96"
width="320"
height="96"
role="img"
aria-labelledby="logo-clip-title"
>
<title id="logo-clip-title">Northstar</title>
<defs>
<clipPath id="northstar-logo-clip" clipPathUnits="userSpaceOnUse">
<rect
class="logo-clip__shape"
x="0"
y="0"
width="320"
height="96"
></rect>
</clipPath>
</defs>
<g clip-path="url(#northstar-logo-clip)" fill="currentColor">
<path d="M48 16 62 40 88 48 62 56 48 80 34 56 8 48 34 40Z"></path>
<path d="M112 29h124v14H112zM112 53h176v14H112z"></path>
</g>
</svg>.logo-clip__shape {
transform: scaleX(1);
transform-box: fill-box;
transform-origin: left center;
}
@media (prefers-reduced-motion: no-preference) {
.logo-clip__shape {
animation: logo-clip-reveal 800ms cubic-bezier(0.22, 1, 0.36, 1) 120ms both;
}
}
@keyframes logo-clip-reveal {
from {
transform: scaleX(0);
}
to {
transform: scaleX(1);
}
}Use explicit clipPathUnits when coordinate assumptions need to be obvious. userSpaceOnUse lets the clip geometry use the same 320 by 96 coordinate system as the example. If a clip appears offset or strangely scaled, a units mismatch is one of the first things to inspect.
Use stroke drawing only when the mark is actually stroked
A stroke reveal works by making the path look like one long dash, then moving that dash into view. The most maintainable version normalizes each path with pathLength="1". MDN explains that pathLength calibrates distance calculations, including stroke dash operations.
<svg
class="stroke-logo"
viewBox="0 0 320 96"
width="320"
height="96"
role="img"
aria-labelledby="stroke-logo-title"
>
<title id="stroke-logo-title">Northstar signature logo</title>
<path
class="stroke-logo__path"
pathLength="1"
d="M20 63 C72 13 105 82 154 39 S238 18 300 57"
fill="none"
stroke="currentColor"
stroke-width="7"
stroke-linecap="round"
stroke-linejoin="round"
></path>
</svg>.stroke-logo__path {
stroke-dasharray: 1;
stroke-dashoffset: 0;
}
@media (prefers-reduced-motion: no-preference) {
.stroke-logo__path {
animation: draw-logo-stroke 1000ms ease-out 120ms both;
}
}
@keyframes draw-logo-stroke {
from {
stroke-dashoffset: 1;
}
to {
stroke-dashoffset: 0;
}
}For a logo with several paths, normalize each path and tune the timing deliberately. Do not assume every path should draw at the same speed: a short dot and a long signature stroke need different durations. When normalization is not suitable, getTotalLength() returns the browser’s computed path length in user units. The deeper SVG line drawing guide covers path measurement and common dash problems.
Make the logo accessible before adding motion
A meaningful inline logo should have a stable accessible name whether it is visible, clipped, masked, or animating. In the examples, role="img" asks assistive technology to treat the SVG as one image, while aria-labelledby points to a concise title. W3C’s SVG accessibility test rule recommends an explicit image role with a non-empty name because support for implicit SVG semantics is not fully consistent. See the site’s accessible SVG guide for the complete decision process.
- If the SVG conveys the brand name, give it an accessible name.
- If visible text already names the logo, reference that text with aria-labelledby when practical.
- If the SVG is decorative and repeats nearby text, use aria-hidden="true" and ensure the surrounding link or control still has its own accessible name.
- Add desc only when a longer explanation is genuinely useful. A simple company logo rarely needs a visual inventory of every shape.
- Never rely on the reveal itself to communicate information. The final static mark and surrounding content must carry the meaning.
Masks and clipping paths change painting, not the logo’s accessible name. That separation is useful: screen reader users do not have to wait for the visual sequence to finish before the graphic can be understood.
Respect reduced motion and avoid blocking the page
The examples use a static-first pattern and place animation inside prefers-reduced-motion: no-preference. People who request reduced motion immediately see the completed logo. MDN defines prefers-reduced-motion as a way to detect a request to remove, reduce, or replace non-essential motion. W3C technique C39 shows the same CSS media-query approach.
Keep a brand reveal brief, usually well under a second, and play it once. It should not hold navigation, delay a headline, or act as a splash-screen gate. Replaying on every route change or scroll can turn a polished moment into friction. If motion lasts more than five seconds and runs beside other content, W3C’s pause, stop, or hide guidance becomes especially relevant.
For a broader implementation strategy, review how to respect reduced motion in SVG and UI animation.
Keep the animation efficient
SVG is scalable, but an SVG animation is not automatically cheap. A complex mask, a large blur, or hundreds of animated paths can consume considerable paint and CPU time. A practical logo reveal should use the smallest visual system that preserves the brand.
- Prefer one simple clip or mask shape over nested masks and filters.
- Animate a transform on the reveal shape instead of changing its width on every frame.
- Keep the path count and point count reasonable, especially for large hero marks.
- Reserve the logo’s aspect ratio with intrinsic dimensions so the reveal does not cause layout shift.
- Do not add will-change everywhere. Layer promotion uses memory and should follow measurement, not habit.
- Stop after the entrance. A logo does not need an idle loop to remain recognizable.
Transforms and opacity are generally the best properties to start with, but masking and clipping can still require painting. Test the real page instead of promising that an effect is automatically GPU-accelerated. The web.dev animation performance guide explains the rendering trade-offs, and Chrome’s official Performance panel guide shows how to inspect frames, CPU work, and rendering activity.
Design fallbacks as part of the component
A robust logo reveal fails to the finished logo, not to an empty rectangle. The static-first CSS above gives you that behavior when animations are unavailable or reduced motion is active. It also works without JavaScript.
Test the component with CSS disabled to confirm the SVG artwork itself remains meaningful. If a browser ignores an animation rule, the base state should still display the complete mark. If your product requires an older or embedded browser, test its support for the chosen masking feature and provide a normal image fallback when necessary.
Keep animation rules in a stylesheet rather than embedding executable code in the SVG. This is easier to audit, works better with restrictive content-security policies, and prevents a logo asset from becoming an unexpected script surface.
Debug the failures that happen most often
The logo is completely invisible
Check the URL reference first. The value in mask="url(#northstar-logo-mask)" or clip-path="url(#northstar-logo-clip)" must match an ID in the same document. Then inspect the mask fill, bounds, and final transform. An alpha mask needs opaque content in the areas that should show. Also look for duplicate IDs from repeated components.
The reveal starts from the wrong place
SVG transforms use a reference box. Confirm transform-box: fill-box and the intended transform-origin. For a left-to-right wipe, use left center. Also verify that the SVG viewBox and the mask or clip coordinate system describe the same region.
The wipe crops the top or bottom
Inspect explicit mask bounds and the artwork’s actual extent. Effects such as wide strokes can extend beyond the path geometry. Give the effect enough room, but do not use enormous bounds that increase rendering work without a visual reason.
The stroke reveal has gaps or finishes early
Confirm that the animated artwork is a stroke, not only a fill. Normalize the path with pathLength="1", or measure it with getTotalLength(). Closed paths, multiple subpaths, line caps, and exported compound shapes can change how the draw appears. Split genuinely separate visual strokes when their timing should differ.
The reduced-motion version still animates
Search for animation applied to a parent group, a second stylesheet, JavaScript, or a framework transition. The media query must cover every motion source, not just the first class you remember. Test with the operating-system preference enabled, then reload the page.
Test the reveal like a production component
- Brand review: compare the final frame with the approved static logo at several sizes.
- Responsive review: test narrow mobile widths, desktop widths, zoom, and high-density screens.
- Motion review: confirm the first frame, final frame, duration, delay, and one-time playback.
- Reduced-motion review: enable the system preference and verify that the complete logo appears immediately.
- Accessibility review: inspect the accessibility tree, check the name, and test any surrounding home link with a keyboard and screen reader.
- Resilience review: disable JavaScript, test slow stylesheet delivery, and check the static SVG without animation.
- Performance review: record the reveal in DevTools, look for dropped frames and excessive paint, and repeat on a representative mobile device.
- Browser review: test current Chrome, Safari, and Firefox, including the mobile browsers your audience uses.
- Reuse review: render two instances on one page and confirm that their mask or clip IDs do not collide.
SVG logo reveal shipping checklist
- The technique matches the artwork: clip, mask, or real stroke.
- The finished logo is the default state.
- The SVG has a correct viewBox and intrinsic dimensions.
- All IDs are unique when the component repeats.
- The logo has an accessible name, or is correctly hidden as decoration.
- Reduced motion shows the completed logo immediately.
- The reveal is short, one-shot, and does not block content.
- The final frame exactly matches the approved brand asset.
- The animation has been profiled on the real page.
- No mask, filter, or extra path remains without a clear purpose.
Frequently asked questions
What is the best technique for an SVG logo reveal?
Use clipPath for a crisp wipe on a filled logo, a mask for soft or partially transparent edges, and stroke dash animation for artwork that is genuinely built from strokes. There is no single best effect independent of the logo.
What is the difference between an SVG mask and clipPath?
A clipping path defines a hard visible region. A mask can use alpha or luminance values, so parts of the logo can be fully visible, partially visible, or hidden. Choose the simplest feature that produces the approved design.
Can I create a line-drawing reveal for a filled wordmark?
You can trace an outline, but that usually changes the character of the mark and can look artificial. A clip or mask reveal normally preserves a filled wordmark more faithfully. Use line drawing when strokes are part of the original design.
How do I make an animated SVG logo accessible?
Give a meaningful inline SVG a stable accessible name, commonly with role="img", aria-labelledby, and a concise title. Hide it only when it is decorative and redundant. The animation must not be the sole source of meaning.
Should a logo reveal respect prefers-reduced-motion?
Yes. Show the completed logo without the entrance sequence when the user requests reduced motion. A static-first design makes this straightforward and also improves failure behavior.
Should an SVG logo reveal loop?
Usually not. A one-time entrance establishes the brand without competing with the page. Continuous logo motion can distract users, consume resources, and make the interface feel less settled.
Does a mask make SVG animation slow?
Not by definition, but complex masks, filters, and large painted areas can be expensive. Use simple geometry, animate briefly, and measure the real implementation with browser performance tools.
A practical default
For most filled logos, begin with a static, accessible inline SVG and a short clipPath wipe. Move to an alpha mask only when the design needs softness or partial transparency. Use stroke drawing only for authentic line work. Whichever technique you choose, make the final logo the default, honor reduced motion, preserve brand geometry, and verify the result on the real page.
Sources and further reading
Related articles
SVG Icon Sprites in Production: Accessibility, IDs, and Animation
Build production SVG icon sprites with symbol and use. Prevent ID collisions, style and animate safely, handle accessibility, caching, CORS, and testing.