Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to use as button #473

Open
dimaslz opened this issue Sep 28, 2024 · 0 comments
Open

Allow to use as button #473

dimaslz opened this issue Sep 28, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@dimaslz
Copy link
Owner

dimaslz commented Sep 28, 2024

I am thinking about to add the property to use the icons as buttons. What do you think? could be useful?

Idea:

Components icons
<academic-cap-outline-icon asButton (click)="yourFunction()" />

Dynamic component icon
<ng-heroicons icon="academic-cap" asButton (click)="yourFunction()" />

On this way, you should avoid to wrap the icons with a button if you want an interaction. And thanks to the new dynamic icon component, could be possible to switch between icons on click.

isActive = false;

toggleFunction() {
  this.isActive != this.isActive;
}

<ng-heroicons 
  icon="academic-cap"  
  [solid]="isActive" <!-- 👈 the icon is solid when the variable isActive is true -->
  [outline]="!isActive" <!-- 👈 the icon is outline when the variable isActive is false -->
  asButton (click)="toggleFunction()" 
/>
@dimaslz dimaslz added the enhancement New feature or request label Sep 28, 2024
@dimaslz dimaslz self-assigned this Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant