The PatternFly React icon generation system automates the process of creating and managing icon components, including generation, Figma connections, and consistent integration.
Defines the metadata for each icon in the library.
npm run figma:icons:fetch FIGMA_ACCESS_TOKEN
[
{
"iconName": "angle-down",
"fileName": "angle-down-icon",
"reactName": "AngleDownIcon",
"url": "Optional Figma design URL",
"svgPath": "SVG path data for the icon"
}
]Manages global settings for icon generation.
figmaBaseUrl: Base URL for Figma design referencesdefaultNodeId: Fallback Figma node identifier
Provides a consistent template for generating individual icon components.
Generates Figma connection files for icons.
Create or update iconsData.json with icon specifications.
Customize config.json with project-specific settings.
# Generate icon components and Figma connections
npm run figma:icons- Keep
iconsData.jsonupdated with the latest icon information - Ensure SVG paths are clean and optimized
- Maintain consistent naming conventions
- Validate icon designs in Figma before generation
- Missing Configuration: Verify
config.jsonexists and is correctly formatted - SVG Path Errors: Check SVG path syntax and completeness
- Naming Conflicts: Ensure unique
reactNamefor each icon
The system uses a comprehensive logging utility that provides:
- Timestamped logs
- Contextual information
- Color-coded output for different log levels
The modular design allows easy extension:
- Add new icons by updating
iconsData.json - Customize icon templates
- Modify configuration as project needs evolve
- Update
iconsData.jsonwith new icon specifications - Validate SVG paths and icon designs
- Run generation scripts
- Review generated components
- Commit changes
- Node.js
- Figma Code Connect
- PatternFly React ecosystem
[Insert appropriate license information]
For issues or questions, please file a GitHub issue in the PatternFly React repository.