Guides & Documentation
Best Practices
Scalable Vector Icons for Modern Interfaces

A practical, opinionated guide to integrating IconFlow SVG icons into your product — covering design system architecture, accessibility compliance, and performance optimization. Written by our design engineering team after shipping icons to 2,400+ teams.

2,400+
Teams using IconFlow
12,800
Optimized SVG icons
98.6%
Avg. Lighthouse score
<14kb
Gzipped full pack
Section 01
Design Systems

Icons are not decorative afterthoughts — they are core tokens in your design system. Treat them with the same rigor as color palettes, type scales, and spacing grids. Here is how leading teams structure icon usage across products.

Standardize Grid & Stroke Rules
IconFlow icons are built on a 24×24 viewBox with a 2px stroke and rounded caps. Enforce these constraints in your system. If your design language calls for 16px or 32px displays, scale via CSS — never re-author icons on different grids. Consistency across sizes is what makes an icon set feel cohesive.
Define Usage Tiers
Not every icon deserves equal prominence. Categorize icons into tiers: primary (navigation, actions), secondary (status, metadata), and tertiary (decorative, illustrative). At Figma, primary icons are always paired with labels in dense layouts. Secondary icons can stand alone in spacious contexts. Tertiary icons should never carry interactive meaning.
Pro tip from the team: When onboarding a new designer to your system, give them a Figma library with IconFlow's icon set pre-loaded. Set the default stroke weight to 2px and disable auto-layout overrides on icon components. This alone eliminates 80% of icon inconsistency issues we see in audits.

Icon Naming Conventions

Adopt a consistent naming pattern across your system. IconFlow uses kebab-case with semantic names: arrow-narrow-up, shield-check, folder-open. Avoid names like icon-42 or button-icon. When creating custom icons, follow the pattern <object>-<modifier>. This makes autocomplete in your component library predictable and reduces cognitive load for developers hunting for the right icon.

Pattern Example Use Case
<object> search Simple, unmodified icon
<object>-<modifier> search-plus Object with action or state
<object>-<direction> arrow-left Directional variants
<object>-<size> image-large Size-differentiated variants
Section 02
Accessibility

Icons convey meaning. When they are the only visual cue for an action or state, screen reader users are left in the dark. Accessibility is not a checkbox — it is a design requirement. Follow these patterns to ensure every user can understand and interact with your icons.

Contrast matters: Icon stroke color must meet WCAG AA contrast ratios against its background. A 2px stroke at 3:1 ratio is the minimum for graphical objects. At IconFlow, we test every icon variant against light (#FFFFFF) and dark (#0F172A) backgrounds. Icons rendered at 16px or smaller should use a minimum 4.5:1 ratio. Use the WebAIM Contrast Checker or your browser's DevTools accessibility panel to verify.

Icon-Only Navigation: A Common Pitfall

Bottom navigation bars and toolbars often use icon-only buttons. This is where accessibility breaks down most frequently. Every icon-only button must have an aria-label that describes the action, not the visual. Label a magnifying glass icon "Search" not "Magnifying glass". Label a house icon "Home" not "House". The label should describe what happens when the user activates it.

Testing workflow: Run every page with VoiceOver (macOS), NVDA (Windows), or TalkBack (Android). Navigate to icon-only buttons and verify each one announces a meaningful action. If you hear "button, magnifying glass" — that is a failure. If you hear "Search, button" — that is a pass.
Search
Favorite
Inbox
Settings
Notifications
Profile
Section 03
Performance

SVG icons should add zero perceptible latency to your page. When implemented correctly, an icon library loads in under 50ms and paints before the first frame. Here is how to achieve that.

Use an SVG Sprite Sheet
Bundle all icons into a single <svg> sprite file served via HTTP/2 multiplexing. Reference icons with <use href="#icon-name">. This eliminates N HTTP requests for N icons. IconFlow's sprite pack for the full 12,800-icon library is 14.2kb gzipped. For most projects, a curated subset of 50–100 icons weighs under 2kb gzipped.
Inline Critical Icons
For icons visible above the fold — logo, primary CTAs, navigation — inline the SVG directly in your HTML. This removes the network request entirely and guarantees zero-flicker rendering. At Shopify, the storefront header icons are inlined in the critical HTML path, resulting in a 0ms icon load time measured in Chrome DevTools.
Remove Metadata & Bloat
Exported SVGs from Figma or Illustrator contain editor metadata, font definitions, and redundant transform groups. Run every icon through SVGO with the cleanAttrs, removeDimensions, removeUselessDefs, and minifyStyles plugins. IconFlow ships pre-optimized icons — a typical icon goes from 1.8kb (raw Figma export) to 420 bytes (optimized). That is a 77% reduction per icon.

Icon Loading Strategies Compared

Choose the right strategy based on your application's icon count and rendering requirements. There is no single best approach — only the best approach for your constraints.

Strategy Bundle Size HTTP Requests Best For
SVG Sprite (external) 2–14kb gzipped 1 Large icon sets, SPAs, design systems
Inlined SVG 0 (part of HTML) 0 Critical icons, small pages, static sites
Icon Font 8–20kb 1–2 Legacy projects, dynamic icon switching
Individual SVG files ~500 bytes each N (one per icon) Not recommended for production
Real-world benchmark: We audited 48 production sites using IconFlow. The median First Contentful Paint improved by 120ms when teams switched from icon fonts to SVG sprites. Sites using individual SVG files saw a 340ms improvement after consolidating into a sprite. The largest gain (580ms) came from a dashboard app that replaced 230 individual icon requests with a single 8kb sprite file.

Code-Splitting Your Icon Pack

If you are using IconFlow with a bundler like Vite or Webpack, you can tree-shake icons to include only what your application uses. Import icons individually from the npm package:

// ✅ Tree-shakeable — only used icons enter your bundle
import { IconSearch, IconHome, IconSettings } from '@iconflow/icons';

// ❌ Not tree-shakeable — entire library loaded
import * as AllIcons from '@iconflow/icons';

For a typical SaaS dashboard using 67 icons, tree-shaking reduces the icon payload from 14.2kb to 1.1kb — a 92% reduction. Combine this with gzip or Brotli compression on your CDN, and the actual transfer size drops to approximately 480 bytes for your entire icon set.

Build-time optimization: Add a post-build script that scans your HTML/JSX output for <use href="#icon-" references, then generates a minimal sprite containing only those icons. This automated approach guarantees your production sprite never includes unused icons. Our team uses this pipeline and maintains a sprite under 1.5kb for our marketing site despite the full library containing 12,800 icons.
Next Steps
Apply These Principles

Start with one section. Audit your current icon implementation against the accessibility checklist, then measure your icon payload and optimize. Small improvements compound — teams that follow all three sections typically see faster pages, fewer support tickets, and more consistent interfaces.

Icon Accessibility Checklist
  • Every icon-only button has an aria-label
  • Decorative icons have aria-hidden="true"
  • Stroke color meets 3:1 contrast minimum
  • Icon state changes (active, disabled) are announced
  • No icon relies on color alone to convey meaning
Performance Audit Commands
  • Run npx svgo --folder ./icons to optimize all SVGs
  • Check Lighthouse "Eliminate render-blocking resources"
  • Measure icon payload with Chrome DevTools Network panel
  • Verify sprite loads in under 50ms with WebPageTest
  • Confirm zero icon requests in Lighthouse audit

Trusted by design teams at companies that ship to millions of users daily.