cpn-basic-icon

Attach native props to the outer element of UDesign Icon components.

1|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/UCloud-FE/udesign-cli --skill cpn-basic-icon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cpn-basic-icon
Source: https://github.com/UCloud-FE/udesign-cli/tree/main/skills/cpn-basic-icon
Command: npx skills add https://github.com/UCloud-FE/udesign-cli --skill cpn-basic-icon

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

AI often misuses or fails to attach extra native props when rendering icons. This Skill ensures props like style or className are correctly applied to the Icon component's outer element, preventing styling inconsistencies.

Core Features & Use Cases

  • Ensures that non-icon props are passed to the Icon's outer element, enabling consistent styling and behavior.
  • Demonstrates how to import and render the Icon from the UDesign component library, and how to adapt to custom prefixes via ConfigProvider.

Quick Start

Import the Icon component from the UDesign library and render it with a type prop to verify correct usage.

Frequently Asked Questions about cpn-basic-icon

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

FAQPage Schema
How do I pass native props like style and className to a UI icon component correctly?

To pass native props like style and className to a UI icon component correctly, attach them to the outer element to ensure consistent styling and prevent rendering inconsistencies.

Why does my icon styling break when rendering components in AI-generated code?

Icon styling breaks because AI often fails to attach extra native props to the outer element, causing styling inconsistencies that require ensuring non-icon props are passed correctly.

How do I import and render an icon from the UDesign component library?

To import and render an icon from the UDesign component library, import the Icon component and render it with a type prop to verify correct usage and ensure the icon font CSS is loaded.

Can I use a custom prefix for icon fonts with ConfigProvider?

Yes, you can use a custom prefix for icon fonts with ConfigProvider by adapting the configuration to ensure the UDesign components render correctly with your custom prefixes.

Do I need external libraries to render UDesign icons?

No, you do not need external libraries to render UDesign icons, as this approach satisfies requirements to use only UDesign components and import the icon font CSS directly.

What is the best way to ensure consistent behavior when rendering UI icons?

The best way to ensure consistent behavior when rendering UI icons is to ensure non-icon props are passed to the component's outer element, enabling consistent styling without external libraries.