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

Aperta
#33,041 0 commenti 4 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
angular, typescript
Ambito
frontend

Direzione di ricerca

Inizia dall’implementazione dell’extended FAB di Angular Material (mat-fab) e dalla sua proprietà extended esistente. Verifica il comportamento attuale di rendering di extended e collapsed, quindi definisci il completamento come uno stato expanded impostato su true per impostazione predefinita, che transiziona tra la capsula contenente testo e il FAB circolare con la sola icona, secondo il comportamento di Material Design 3 descritto nell’issue.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area: material/button feature gemini-triaged P3
Feature Description

According to the Material Design 3 specs, 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.

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.

Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 2h
PR unite (30g)
81

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di angular/components

Tutte le issue di angular/components

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.