Skip to content

Angular Lucide / Provide single icons for standalone components via providers #3402

Open
@michaelbe812

Description

@michaelbe812

Package

  • lucide
  • lucide-angular
  • lucide-flutter
  • lucide-preact
  • lucide-react
  • lucide-react-native
  • lucide-solid
  • lucide-svelte
  • lucide-vue
  • lucide-vue-next
  • lucide-astro
  • Figma plugin
  • all JS packages
  • site

Description

To pick singe icons in modern standalone Angular components we can not use the pick method of LucideAngularModule.
We can work around by assigning a Icon to a class variable.

In Tabler Icons it can be done via:

@Component({
  selector: 'app-standalone',
  imports: [TablerIconComponent],
  /**
   * Provide the icons which you want to use in this component.
   */
  providers: [
    provideTablerIcons({
      IconNumber123,
      IconAdOff,
      IconHeartFilled,
    }),
  ],
,
})
export class StandaloneComponent {}

A similar approach I could imagine also for Lucide.

Use cases

More convenient way of providing single icons to standalone components

Checklist

  • I have searched the existing issues to make sure this bug has not already been reported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions