-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Component] Improved Button (now supports icon)
- Loading branch information
louiiuol
committed
Oct 17, 2024
1 parent
4a2baf8
commit 2886294
Showing
9 changed files
with
111 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/app/components/atoms/button/demos/demo-button.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { ChangeDetectionStrategy, Component } from '@angular/core'; | ||
import { IconMaterialComponent } from '../../icon-material/icon-material.component'; | ||
import { ButtonComponent } from '../button.component'; | ||
|
||
@Component({ | ||
selector: 'lib-button-demo', | ||
template: ` | ||
<div class="p-6"> | ||
<p>Simple button</p> | ||
<lib-button (click)="notify()">My button</lib-button> | ||
<hr /> | ||
<p>Button with text and icon</p> | ||
<lib-button (click)="notify()"> | ||
<lib-icon-material name="favorite" /> | ||
My button | ||
</lib-button> | ||
<hr /> | ||
<p>Button with icon</p> | ||
<lib-button appearance="fab"> | ||
<lib-icon-material name="favorite" /> | ||
</lib-button> | ||
<lib-button appearance="icon" color="accent"> | ||
<lib-icon-material name="favorite" /> | ||
</lib-button> | ||
<lib-button appearance="icon-stroked"> | ||
<lib-icon-material name="favorite" /> | ||
</lib-button> | ||
</div> | ||
`, | ||
standalone: true, | ||
imports: [ButtonComponent, IconMaterialComponent], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class ButtonDemoComponent { | ||
notify(): void { | ||
alert('Hello!'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,19 @@ | ||
> A button is an interface element that allows the user to perform a specific action when clicked. | ||
|
||
{{ NgDocActions.demo("ButtonDemoComponent") }} | ||
|
||
|
||
## Playground 🕹️ | ||
|
||
{{ NgDocActions.playground("ButtonPlayground") }} | ||
|
||
<div id="end"></div> | ||
|
||
## Sources | ||
|
||
```typescript file="./button.component.ts" | ||
|
||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters