Skip to content

feat(module:float-button): nzIcon support string type - #9302

Merged
Laffery merged 1 commit into
NG-ZORRO:masterfrom
Laffery:feat/float-button-icon-string-type
Aug 22, 2025
Merged

Laffery merged 1 commit into
NG-ZORRO:masterfrom
Laffery:feat/float-button-icon-string-type

Conversation

@Laffery

@Laffery Laffery commented Jul 29, 2025

Copy link
Copy Markdown
Collaborator

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Application (the showcase website) / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

nzIcon of nz-float-button supports string type

- @Input() nzIcon: TemplateRef<void> | null = null;
+ @Input() nzIcon: string | TemplateRef<void> | null = null;

In the past, you have to define a template to specify the icon of the float-button, now just passing a string which is nzType of nz-icon.

<!-- before -->
<nz-float-button [nzIcon]="icon"></nz-float-button>
<ng-template #icon>
  <nz-icon nzType="question-circle" nzTheme="outline" />
</ng-template>

<!-- now -->
<nz-float-button nzIcon="question-circle"></nz-float-button>

Note that the nzTheme of the icon is outline, which is the default value. If you wanna customize it, please use the old TemplateRef API

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@codecov

codecov Bot commented Jul 29, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.12%. Comparing base (2c83788) to head (76cf7e5).
⚠️ Report is 11 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9302      +/-   ##
==========================================
- Coverage   92.12%   92.12%   -0.01%     
==========================================
  Files         561      561              
  Lines       19631    19629       -2     
  Branches     3107     3107              
==========================================
- Hits        18086    18084       -2     
  Misses       1206     1206              
  Partials      339      339              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@OriginRing

Copy link
Copy Markdown
Collaborator

LGTM

@Nicoss54 Nicoss54 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Laffery
Laffery force-pushed the feat/float-button-icon-string-type branch 2 times, most recently from d5ab131 to cb71b2c Compare August 8, 2025 05:28
@Laffery
Laffery force-pushed the feat/float-button-icon-string-type branch from cb71b2c to 76cf7e5 Compare August 8, 2025 05:32
@Laffery
Laffery merged commit ce611e5 into NG-ZORRO:master Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants