Skip to content

tool: enable custom icons#401

Open
bendrucker wants to merge 3 commits intovercel:mainfrom
bendrucker:tool-icon
Open

tool: enable custom icons#401
bendrucker wants to merge 3 commits intovercel:mainfrom
bendrucker:tool-icon

Conversation

@bendrucker
Copy link
Contributor

@bendrucker bendrucker commented Mar 15, 2026

Adds a customizable icon prop to ToolHeader, allowing users to replace the default wrench icon with custom icons — either statically or dynamically based on tool name and state.

Changes

  • Adds icon prop to ToolHeaderProps accepting a ReactNode or a render function (props: ToolIconProps) => ReactNode
  • The render function receives { type, state, toolName, className } — providing full tool context and default sizing/color styles via className
  • Extracts ToolPartProps as a shared base type for both ToolHeaderProps and ToolIconProps
  • Exports ToolIconProps so consumers can type their icon render functions
  • Falls back to the default WrenchIcon when icon is not provided or returns null
  • Adds shrink-0 to the default icon className to prevent flex shrinking

Testing

Verified rendering in the docs dev server with custom SVG icons, name-based icon mapping, and fallback to default:

Screenshot 2026-03-15 at 12 26 00

@vercel
Copy link
Contributor

vercel bot commented Mar 15, 2026

@bendrucker is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

@bendrucker bendrucker changed the title feat: add customizable icon prop to ToolHeader tool: enable custom icons Mar 15, 2026
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.

1 participant