svgCreate and optimize SVG graphics with proper viewBox, accessibility, and CSS styling.
Install via ClawdBot CLI:
clawdbot install ivangdavila/svg<svg viewBox="min-x min-y width height">
viewBox defines the internal coordinate systemwidth/height on define the display size<!-- ✅ Scales to any size -->
<svg viewBox="0 0 24 24">
<circle cx="12" cy="12" r="10"/>
</svg>
<!-- ❌ Fixed 24x24, won't scale -->
<svg width="24" height="24">
<circle cx="12" cy="12" r="10"/>
</svg>
Always include viewBox. Remove fixed width/height for responsive SVGs.
Elements outside the viewBox are invisible:
<!-- ❌ Circle at 500,500 but viewBox only covers 0-100 -->
<svg viewBox="0 0 100 100">
<circle cx="500" cy="500" r="40"/> <!-- invisible -->
</svg>
<!-- ✅ Circle within viewBox range -->
<svg viewBox="0 0 100 100">
<circle cx="50" cy="50" r="40"/>
</svg>
Informative SVGs (convey meaning):
<svg role="img" aria-labelledby="chart-title">
<title id="chart-title">Sales increased 25% in Q4</title>
<desc id="chart-desc">Bar chart showing quarterly revenue...</desc>
<!-- paths -->
</svg>
Decorative SVGs (purely visual):
<svg aria-hidden="true" focusable="false">
<!-- paths -->
</svg>
Key rules:
role="img" ensures assistive tech treats it as an image must be the first child of aria-labelledby is more reliable than aria-label for SVGfocusable="false" prevents tab stops in IE/EdgecurrentColor inheritance:
<svg fill="currentColor">
<path d="..."/>
</svg>
.icon { color: blue; }
.icon:hover { color: red; } /* SVG changes too */
CSS custom properties inside SVG:
<svg>
<style>
.primary { fill: var(--icon-primary, currentColor); }
.secondary { fill: var(--icon-secondary, #ccc); }
</style>
<path class="primary" d="..."/>
<path class="secondary" d="..."/>
</svg>
Limitations:

cannot be styled with CSSbackground-image: url(icon.svg) cannot be styledCritical config to preserve functionality:
// svgo.config.mjs
export default {
plugins: [{
name: 'preset-default',
params: {
overrides: {
removeViewBox: false, // NEVER remove
removeTitle: false, // Keep for accessibility
removeDesc: false, // Keep for accessibility
cleanupIds: false, // Keep if CSS/JS references IDs
}
}
}]
};
Safe to remove: metadata, comments, empty groups, editor cruft.
Typical reduction: 50-80% for Illustrator/Figma exports.
| Method | CSS Styling | Caching | Best for |
|--------|-------------|---------|----------|
| Inline | ✅ Full | ❌ No | Dynamic styling, animation |
| | ❌ No | ✅ Yes | Static images |
| Symbol sprite | ✅ Partial | ✅ Yes | Icon systems |
| CSS background | ❌ No | ✅ Yes | Decorative patterns |
Benchmark (1000 icons):
![]()
data URI: 67ms (fastest)For many repeated icons, use symbol sprites. For few icons, inline is fine.
External .svg files require xmlns:
<!-- ✅ Works as external file -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<!-- ❌ May fail when loaded externally -->
<svg viewBox="0 0 24 24">
Inline SVG in HTML5 doesn't require xmlns, but including it doesn't hurt.
fill="#000"—can't theme with CSS![]()
when styling is needed—no CSS accesspreserveAspectRatio="none" without understanding—causes distortionviewBox="0 0 100px 100px"—viewBox uses unitless valuesGenerated Mar 1, 2026
Developers use this skill to create scalable icon sets for websites and applications, ensuring icons adapt to different screen sizes without distortion. By implementing viewBox and inline SVG embedding, they enable dynamic CSS styling for themes and interactions, improving user experience across devices.
Data analysts and designers leverage the skill to build accessible charts and graphs with proper ARIA labels and descriptions. This ensures compliance with accessibility standards, making visual data interpretable by screen readers for users with disabilities in corporate or educational reports.
Online retailers integrate inline SVGs to allow customers to customize product visuals, such as changing colors or adding personal text. The skill's CSS styling capabilities enable real-time updates without reloading pages, enhancing engagement and sales conversion on e-commerce platforms.
Marketing teams use the skill to optimize and standardize logos and graphics across digital campaigns. By applying SVGO configurations, they reduce file sizes for faster load times while preserving accessibility features, ensuring consistent branding on websites and social media.
Educators and e-learning platforms create interactive diagrams and illustrations with inline SVGs that respond to user interactions. The skill's focus on viewBox and coordinates ensures elements remain visible and scalable, facilitating engaging learning experiences in online courses.
Offer a cloud-based service that automatically optimizes SVG files using SVGO configurations from this skill, targeting web developers and designers. Revenue is generated through subscription tiers based on usage volume and advanced features like batch processing and API access.
Provide custom SVG creation and optimization services for clients in industries like web design and marketing, leveraging the skill's best practices for accessibility and performance. Revenue comes from project-based fees or hourly rates for tasks such as converting designs to responsive SVGs.
Sell curated sets of optimized SVG icons with built-in accessibility and styling features, targeting businesses and developers. Revenue is earned through one-time purchases or licensing models, with upsells for customizations and support based on the skill's embedding and performance guidelines.
💬 Integration Tip
Start by embedding SVGs inline in HTML to enable full CSS control, and always test with SVGO to avoid removing critical attributes like viewBox.
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
Expert frontend design guidelines for creating beautiful, modern UIs. Use when building landing pages, dashboards, or any user interface.
Use when building UI with shadcn/ui components, Tailwind CSS layouts, form patterns with react-hook-form and zod, theming, dark mode, sidebar layouts, mobile navigation, or any shadcn component question.
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when building web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
Create distinctive, production-grade static sites with React, Tailwind CSS, and shadcn/ui — no mockups needed. Generates bold, memorable designs from plain text requirements with anti-AI-slop aesthetics, mobile-first responsive patterns, and single-file bundling. Use when building landing pages, marketing sites, portfolios, dashboards, or any static web UI. Supports both Vite (pure static) and Next.js (Vercel deploy) workflows.
AI skill for automated UI audits. Evaluate interfaces against proven UX principles for visual hierarchy, accessibility, cognitive load, navigation, and more. Based on Making UX Decisions by Tommy Geoco.