Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#33,041 0 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
冷清
领域
frontend

调研方向

从 Angular Material 扩展 FAB(mat-fab)的实现及其现有的 extended 属性开始。验证当前 extended 和 collapsed 的渲染行为,然后将完成定义为默认值为 true 的 expanded 状态,该状态根据 issue 中描述的 Material Design 3 行为,在包含文本的胶囊形控件与仅包含图标的圆形 FAB 之间进行转换。

由索引模型根据 Issue 内容生成。

描述

area: material/button feature 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.

主要语言
TypeScript
星标
25k
派生
6.8k
平均合并
1 天 12 小时
30 天内合并 PR
102

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

angular/components 的其他 Issue

查看 angular/components 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。