Skip to content

fix(splitbutton): add icon and item templates for custom icons - #19595

Open
leonidasdel wants to merge 3 commits into
primefaces:masterfrom
leonidasdel:fix/splitbutton-svg-icon-templates
Open

fix(splitbutton): add icon and item templates for custom icons#19595
leonidasdel wants to merge 3 commits into
primefaces:masterfrom
leonidasdel:fix/splitbutton-svg-icon-templates

Conversation

@leonidasdel

Copy link
Copy Markdown
Contributor

Summary

SplitButton now supports custom icons from any library (inline SVG, Font Awesome, Material Icons, images, etc.) via templates, consistent with other PrimeNG components and the custom icons documentation.

  • #icon — custom icon for the default action button when the icon property is not set
  • #dropdownicon — already supported; omit dropdownIcon when using the template
  • #item — custom menu item template forwarded to the overlay TieredMenu

Changes

  • packages/primeng/src/splitbutton/splitbutton.ts — icon template on default button; item template projected into p-tieredmenu
  • packages/primeng/src/types/splitbutton/splitbutton.types.tsSplitButtonTemplates updated
  • packages/primeng/src/splitbutton/splitbutton.spec.ts — unit tests for new templates
  • apps/showcase/doc/splitbutton/icons-doc.ts — showcase examples for class-based and template-based icons

Test plan

  • ng test primeng --include=src/splitbutton/splitbutton.spec.ts — 91/91 passing
  • Icons showcase: PrimeIcons example (existing)
  • Icons showcase: custom template example (button, dropdown, menu items)

Made with Cursor

leonidasdel and others added 3 commits May 21, 2026 22:23
Forward #item to the overlay TieredMenu and support #icon on the default
action button when icon is unset, matching other PrimeNG components.
Update the icons showcase with inline SVG examples.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
TieredMenu only accepts #item via content projection, not an input binding.

Co-authored-by: Cursor <cursoragent@cursor.com>
@leonidasdel

Copy link
Copy Markdown
Contributor Author

@mehmetcetin01140 could you please check it? According to docs we can safely add our own custom icons but it seems here it was not supported and it is blocking our migration

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