feat(packages/angular): add new @lucide/angular package#3897
feat(packages/angular): add new @lucide/angular package#3897ericfennis merged 42 commits intonextfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a new modern Angular package @lucide/angular that replaces the legacy lucide-angular package with a standalone-first, signal-based implementation optimized for Angular 17+.
Key changes:
- Adds a new
@lucide/angularpackage with standalone components, dependency injection providers, and signal-based reactive architecture - Introduces per-icon components for better tree-shaking alongside a dynamic
LucideIconcomponent - Updates build tooling to support non-default exports and Angular-specific configuration needs
Reviewed changes
Copilot reviewed 53 out of 56 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
packages/angular/* |
New Angular package with standalone components, types, utilities, tests, and documentation |
tools/build-icons/** |
Enhanced build tooling to support Angular's export requirements and alias handling |
packages/lucide-react-native/** |
Refactored exports and added icons entry point for better module organization |
docs/guide/packages/angular.md |
New comprehensive documentation for @lucide/angular |
docs/guide/packages/lucide-angular.md |
Updated legacy package docs with deprecation notice |
icons/toolbox.* |
New toolbox icon addition |
icons/paint-bucket.svg |
Updated paint-bucket icon paths |
.github/workflows/angular.yml |
New CI workflow for Angular package testing |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ericfennis
left a comment
There was a problem hiding this comment.
Suggestions and ideas, I've checked the type naming with other libraries. Would be nice if we could make it consistent.
…rom separate node+name – no more toKebabCase hackery feat(packages/angular): renamed LucideIconComponentType => LucideIcon, and LucideIcon => LucideDynamicIcon feat(packages/angular): added backwards compatible CSS class support feat(packages/angular): switched to vector-effect: non-scaling-stroke implementation from computed stroke width feat(packages/angular): rewrote icon provider to only accept a list of self-described icons – no more toKebabCase hackery & as an added bonus automatic backwards compatible alias support 🚀 feat(packages/angular): added legacy icon node helper function for passing legacy icons to providers test(packages/angular): added unit tests on LUCIDE_CONFIG provider usage
|
@ericfennis: added some extensive rewrites:
|
|
@karsa-mistmere Awesome work! |
# Conflicts: # .github/ISSUE_TEMPLATE/02_bug_report.yml # .github/ISSUE_TEMPLATE/04_feature_request.yml # pnpm-lock.yaml # tools/build-icons/building/generateIconFiles.ts # tools/build-icons/types.ts
…nction, refactor export template to use the iconData object as defined in ExportTemplate
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 53 out of 54 changed files in this pull request and generated 11 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /** | ||
| * Provide Lucide icons by name. | ||
| * | ||
| * @remarks | ||
| * Warning! This provider will convert dictionary keys to lower-kebab-case. | ||
| * | ||
| * @param icons Either a dictionary of icons or a list of Angular icon components. | ||
| * | ||
| * @usage | ||
| * ```ts | ||
| * import { provideLucideIcons, SquareCheck } from '@lucide/angular'; | ||
| * import { MyCustomIcon } from './custom-icons/my-custom-icon'; | ||
| * | ||
| * providers: [ | ||
| * provideLucideIcons({ | ||
| * SquareCheck, | ||
| * MyCustomIcon, // LucideIconData | ||
| * }), | ||
| * ] | ||
| * ``` | ||
| * | ||
| * ```html | ||
| * <svg lucideIcon="my-custom-icon" /> | ||
| * ``` | ||
| */ | ||
| export function provideLucideIcons(...icons: Array<LucideIcon | LucideIconData>): Provider { | ||
| return { |
There was a problem hiding this comment.
The provideLucideIcons JSDoc is inconsistent with the actual API: it claims it accepts a dictionary and converts keys to lower-kebab-case, but the function signature is variadic and the implementation only uses iconData.name/aliases as-is. Either update the docs/examples to call provideLucideIcons(icon1, icon2, ...) (or ...array) and remove the kebab-case warning, or change the function to actually accept a dictionary/array as documented.
| @Component({ | ||
| templateUrl: './foobar.html', | ||
| // For using by name via provider: | ||
| providers: [provideLucideIcons({ coconut })], |
There was a problem hiding this comment.
This snippet uses providers: [provideLucideIcons({ coconut })], but provideLucideIcons does not accept an object map in the current implementation (it expects LucideIcon | LucideIconData arguments). Either change the example to pass the icon data directly (and/or spread an array), or update provideLucideIcons to support object maps as documented.
| providers: [provideLucideIcons({ coconut })], | |
| providers: [provideLucideIcons(coconut)], |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Description
Adds new standalone-first Angular package that better matches the ecosystem established by
lucide-react:lucide/@lucide/iconspackagesprovideLucideIconsvia dependency injectionprovideLucideConfigvia dependency injection<svg:title>element. Unless this accessible label is provided, the SVGs will automatically addaria-hidden="true"TODO
lucide-angularTODO, but requires #3881
@lucide/angular/dynamicentry point for dynamic icon imports using@lucide/icons@lucide/angular/materialentry point for registering icon data viaMatIconRegistryBefore Submitting