ivy-interactive/ivy-framework/ivy-create-external-widget
Claude Code and agent skill by ivy-interactive/ivy-framework
- community
Checking that the SKILL.md file is still in the repository.
Create a new Ivy External Widget backed by React npm packages. Use when the user asks to create a widget, external widget, React widget, custom component, or wrap an npm package as an Ivy widget. Scaffolds a C# + React project, installs npm dependencies, implements the widget class and React component, and verifies the build.
Install
npx vskill@latest install ivy-interactive/ivy-framework/ivy-create-external-widgetSKILL.md
ivy-create-external-widget
Create a new Ivy External Widget that wraps React npm packages with C# bindings.
Pre-flight: Read Learnings
If the file .ivy/learnings/ivy-create-external-widget.md exists in the project directory, read it first and apply any lessons learned from previous runs of this skill.
Reference Files
Read before implementing:
- references/AGENTS.md -- Ivy framework API reference (widgets, hooks, layouts, inputs, colors)
Reference Files
Before implementing, fetch the external widgets documentation using ivy docs with the query: "external widgets".
Workflow
- Understand the widget purpose -- Ask the user what widget they need if it is not already clear from context.
- Research npm packages -- Search the web for the best React npm package(s) for the use case. Packages MUST be open-source with a copyleft-compatible license (MIT, Apache-2.0, BSD, ISC, MPL-2.0, etc.). Look for packages that are well-maintained, popular, and have good TypeScript support.
- Present options -- Show the user 2-4 npm package options. Include the package name, description, license, and weekly downloads if available. Ask the user to pick one.
- Ask for a widget name -- Suggest a name similar to the chosen React package but without the word "React" in it. Names must be in PascalCase. Ask the user to confirm.
- Determine the namespace -- If the working directory already has a
.csprojfile, extract the namespace from it. Otherwise, suggestIvy.Widgets.<WidgetName>as a default namespace and ask the user to confirm.
- Scaffold the widget project -- Create the widget project structure with:
[WidgetName].cs-- the C# widget classfrontend/-- the React frontend project
If the project already has a Widgets folder, move the new widget there and adjust the namespace accordingly.
- Install npm dependencies -- Run in the
frontend/directory:
`` cd [WorkingDirectory]/frontend && npm install [NpmPackages] ``
- Implement the widget -- Follow the Ivy External Widget Guide below to create:
- The C# widget class (
[WidgetName].cs) -- define props, events, and extension methods that map to the npm package's API - The React component (
frontend/src/[WidgetName].tsx) -- wrap the npm package component with Ivy's event system, using the conditional event firing pattern - The export file (
frontend/src/index.ts) -- export the new component - A sample app (
.samples/Apps/[WidgetName]App.cs) - Update README.md to document the widget, its props, events, and which npm packages it uses
- Verify the build -- Run
dotnet buildto make sure the project compiles. Fix any errors.
Ivy External Widget Guide
Architecture
- C# Widget Class: Defines props, events, and the widget's API surface
- React Component: The frontend implementation loaded at runtime
- IIFE Bundle: The React component is bundled as an IIFE and exposed on
window.{GlobalName}
C# Widget Definition
Create a .cs file with a record that inherits from WidgetBase<T>:
React Component
Create a .tsx file in frontend/src/:
Export the Component
Add the export to frontend/src/index.ts:
Sample App
The .samples/ folder contains a runnable Ivy project. Create or update the app in .samples/Apps/[WidgetName]App.cs:
Key Concepts
ExternalWidget Attribute
- First parameter: Path to the bundled JS file (embedded resource)
ExportName: The name of the React component in the bundle's exports
Props vs Events
[Prop]: Data passed from C# to React. PascalCase in C#, auto-converted to camelCase in React.[Event]: Callbacks from React to C#. Name withOnprefix (e.g.,OnClick,OnChange).
Event Handler Signature
In React, call onIvyEvent(eventName, widgetId, args):
eventName: PascalCase with 'On' prefix (e.g., 'OnClick', 'OnChange')widgetId: Always passidargs: Array of arguments to pass to the C# handler
Conditional Event Firing
Always check the events array before firing:
Event Types
Event<TWidget>-- event with no value. Properties:.Id(the widget ID)Event<TWidget, TValue>-- event with a value. Properties:.Id(the widget ID),.Value(the value of typeTValuepassed from React)
Use Event<TWidget> for simple notifications (e.g., button clicks) and Event<TWidget, TValue> when React needs to pass data back to C# (e.g., input changes, selections).
Key Namespaces
Ivy--WidgetBase<T>,ViewBase,Layout,Text,Icons,Size,Colors,ChromeSettingsIvy.Core--PropAttribute,EventAttribute,Event<TWidget>,Event<TWidget, TValue>Ivy.Core.ExternalWidgets--ExternalWidgetAttribute
Size Props
Use helper functions for sizing:
Smooth Input Handling Pattern
For input widgets, use local state with server sync to prevent laggy typing:
Important Guidelines
- Never use
<summary>XML documentation blocks - Update README.md when making changes
- Create app files for each widget in
.samples/Apps/[WidgetName]App.cs - Use react-icons/lucide for icons
- Prefer shadcn building blocks when UI components are needed
- Default to full width and height (
Width = Size.Full(),Height = Size.Full()) - Always include a default constructor (use
internal) - Default prop values must be specified both in C# and React
Post-run: Evaluate and Improve
After completing the task:
- Evaluate: Did the build succeed? Were there compilation errors, unexpected behavior, or manual corrections needed during this run?
- Update learnings: If anything required correction or was surprising, append a concise entry to
.ivy/learnings/ivy-create-external-widget.md(create the file and.ivy/learnings/directory if they don't exist). Each entry should note: the date, what went wrong, why, and what to do differently next time. - Skip if clean: If everything succeeded without issues, do not update the learnings file.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsrc/claude-plugin/skills/ivy-create-external-widget/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ivy-interactive/ivy-framework/ivy-create-external-widget)