Skip to content

Add Icon widget component with lucide-react integration#4

Merged
foreleven merged 2 commits intomainfrom
copilot/create-icon-widget-component
Nov 10, 2025
Merged

Add Icon widget component with lucide-react integration#4
foreleven merged 2 commits intomainfrom
copilot/create-icon-widget-component

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 10, 2025

Implements an Icon widget component that dynamically maps icon names to lucide-react library icons.

Changes

  • New icon.tsx component with props:

    • name: Icon name from lucide-react (supports PascalCase, kebab-case, snake_case)
    • color: CSS color value
    • size: Pixel size (default: 24)
  • Automatic name normalization: Converts various naming formats to lucide-react's PascalCase convention

  • Fallback rendering: Displays placeholder SVG for invalid icon names

  • Component registration: Added to widget component registry and definitions for Monaco editor IntelliSense

Usage

<Icon name="Home" size={32} color="#3b82f6" />
<Icon name="search" size={24} />
<Icon name="user-circle" color="red" />

Screenshot

Icon Component

Component appears in the Display category with full documentation and live preview showing customizable color and size properties.

Original prompt

Create a widget component Icon, supported props are name, color and size. Mapping the name to the Icon in lucide-react library.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: foreleven <4785594+foreleven@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Icon widget component with name, color and size props Add Icon widget component with lucide-react integration Nov 10, 2025
Copilot AI requested a review from foreleven November 10, 2025 05:20
@foreleven foreleven marked this pull request as ready for review November 10, 2025 05:26
@foreleven foreleven merged commit 060bf31 into main Nov 10, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants