angular / angular/components

feat(button): add `expanded` state to extended FAB for smooth collapse/expand transitions

Offen
#33,041 0 Kommentare 4 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area: material/button feature gemini-triaged P3
Vorherrschende Sprache
TypeScript
Sterne
25k
Forks
6.8k
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
91

Beschreibung

### Feature Description

According to the [Material Design 3 specs](https://m3.material.io/components/extended-fab/guidelines), an extended FAB should be able to smoothly transition between an extended state (capsule shape with text) and a collapsed state (circular shape with icon only) depending on scroll interactions or limited screen space.

I propose adding a new `[expanded]="boolean"` (default `true`) property specifically for the Extended FAB.

* The `extended` property defines the `mat-fab` as an Extended FAB rather than a standard FAB.
* The `expanded` property defines its visual **state** (expanded capsule vs. collapsed circle).

This would apply the necessary CSS transitions when the text label visually disappears in the collapsed state.

### Use Case

I want to implement an expandable/collapsible [Navigation Rail](https://m3.material.io/components/navigation-rail/overview).

When a user interacts with a Navigation Rail to expand/collapse it, the top FAB within that rail should smoothly animate between a collapsed regular FAB and an extended FAB with a text label. Currently, because `mat-fab` lacks an animatable `expanded` state, developers cannot easily recreate this fluid interaction without writing complex custom CSS overrides to hack the fab-label.

Having a native `[expanded]` property would allow developers to seamlessly bind the FAB's state to the Navigation Rail's drawer state, providing a polished and spec-compliant Material 3 experience out of the box.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne bei der Implementierung des erweiterten Angular Material FAB (`mat-fab`) und seiner vorhandenen `extended`-Eigenschaft. Überprüfe das aktuelle Rendering-Verhalten für extended und collapsed und definiere den Abschluss als einen standardmäßig auf true gesetzten `expanded`-Zustand, der gemäß dem im Issue beschriebenen Verhalten von Material Design 3 zwischen der Text enthaltenden Kapsel und dem kreisförmigen Icon-only-FAB wechselt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
angular, typescript
Bereich
frontend
Issue-Typ
Feature
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
68/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.