svg-icon-pattern

Define SVG icon components using SvgProps and fontSize sizing.

19|21|Updated Jul 22, 2024
One-click install
npx skills add https://github.com/vultisig/vultisig-windows --skill svg-icon-pattern
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: svg-icon-pattern
Source: https://github.com/vultisig/vultisig-windows/tree/main/.cursor/skills/svg-icon-pattern
Command: npx skills add https://github.com/vultisig/vultisig-windows --skill svg-icon-pattern

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill establishes clear guidelines for creating and using SVG icons, ensuring consistency, maintainability, and flexibility across the project's UI.

Core Features & Use Cases

  • Consistent Icon Definition: Enforces the use of SvgProps for predictable icon behavior.
  • Flexible Sizing: Allows icons to scale using fontSize at the point of use, inheriting parent styles.
  • Use Case: When adding a new "user profile" icon, follow this pattern to ensure it seamlessly integrates with existing icons in terms of size and color theming.

Quick Start

Create a new SVG icon component by exporting a named component that receives SvgProps from @lib/ui/props and spreading them on the svg element.

Frequently Asked Questions about svg-icon-pattern

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I standardize SVG icon creation in a React component library?

To standardize SVG icon creation in a React component library, export a named component receiving SvgProps from @lib/ui/props and spread them on the svg element. This enforces consistent prop handling and UI theming across your scalable vector graphics.

What is the best way to handle SVG icon sizing in React?

The best way to handle SVG icon sizing in React is by using the style prop's fontSize at the usage site. This approach allows scalable vector graphics to flexibly inherit parent styles for consistent UI component behavior.

How do you ensure consistent SVG icon props for frontend development?

You ensure consistent SVG icon props for frontend development by enforcing the use of SvgProps for predictable icon behavior. This standardizes prop handling across all scalable vector graphics within your React design system.

When do I need to standardize SVG icons in my UI components?

You need to standardize SVG icons in your UI components when adding new scalable vector graphics to a project. Following a standardized pattern ensures they seamlessly integrate with existing icons in terms of size, color theming, and maintainability.

Does this SVG icon pattern support flexible color theming?

Yes, this SVG icon pattern supports flexible color theming by allowing scalable vector graphics to inherit parent styles. By utilizing SvgProps and spreading them on the svg element, the icons satisfy UI consistency and theming requirements.