angular / angular/components

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

Ouverte
#33,041 0 commentaires 4 réactions 0 personnes assignées Voir sur GitHub
area: material/button feature gemini-triaged P3
Langage dominant
TypeScript
Étoiles
25k
Forks
6.8k
Merge moyen
1 j 8 h
PR mergées (30 j)
91

Description

### 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.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par l’implémentation du FAB étendu d’Angular Material (`mat-fab`) et sa propriété `extended` existante. Vérifiez le comportement de rendu actuel de extended et collapsed, puis définissez l’achèvement comme un état `expanded` défini à true par défaut, qui effectue une transition entre la capsule contenant le texte et le FAB circulaire uniquement composé d’une icône, conformément au comportement de Material Design 3 décrit dans l’issue.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
angular, typescript
Domaine
frontend
Type d'issue
Fonctionnalité
Difficulté
3/5
Temps estimé
1-2 jours
Activité
Calme
Clarté
Plutôt claire
Accessibilité débutants
68/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.