Material-ui: Extended Fab enhancements?

Created on 30 Jun 2018  路  11Comments  路  Source: mui-org/material-ui

Hi @oliviertassinari and @mbrookes,

I just gave the extended fab a run. Thanks for adding it. However, I believe that the extended fab solution can be improved to enable the following behavior, part of the new Google guideline.

The following demo is based on the existing example on material-ui.com but modified on the fly from dev tools:

extended fab

Here's my observations from the current implementation:

  1. There's really no need for a new variant because switching between variants won't allow for the transition above. Instead, I suggest we keep the same Fab variant and allow for a label like we do with regular buttons. Introduce a property for hiding the label. hideLabel or hideText.
  2. The margin between the icon and text should be assigned to the text, because it should collapse when the label shrinks to leave the icon alone without a margin hanging to the right.
  3. I noticed that the extended fab height is smaller than the Fab button height, making the transition between the normal and extended fab difficult.
  4. Border radius should be a fixed value of (height / 2), not 50%, which gives you an oval factor form when text is present.

Thoughts?

Button Fab enhancement material design

Most helpful comment

I start to believe that we should move the floating action button into it's own component. This would allow to grow the number of feature without arming the canonical use case of the button. It would also allow to pick a different API tradeoff.

All 11 comments

I start to believe that we should move the floating action button into it's own component. This would allow to grow the number of feature without arming the canonical use case of the button. It would also allow to pick a different API tradeoff.

Good ideas @oliviertassinari . I'd just keep in mind that one type could morph to another. Today, it's Fab to Extended Fab. Tomorrow, it could be floating to non-floating. Changing apis on the fly could prevent such transitions. But then again, I'm not 100% sure what you have in mind.

@simoami The height of the extended fab is per the spec. If you look carefully at the transformation examples, it changes height between the extended and standard fab. (However the speed dial example keeps the extended height of 48px for both.)

@mbrookes Good observation. I think the speed dial is a separate feature we don't need to worry much about, since you control the css of the inner components.

The measurements are on the page as well: https://material.io/design/components/buttons-floating-action-button.html#specs

screen shot 2018-07-03 at 11 44 00 pm

Yup, I think you'll find the extended FAB meets those dimension.

@simoami Do you have the above example in a code pen or similar? I would love to see how you are making the smooth transition between showing and hiding text. Thanks!

@issuehuntfest has funded $20.00 to this issue. See it on IssueHunt

@issuehuntfest has funded $40.00 to this issue. See it on IssueHunt

Sorry, but could someone explain the interaction? From the image it looks like clicking triggers the normal click event but is to a drag to the right that reveals the label?

@anthonydillon I believe in @simoami's example, the Fab variant is being controlled programatically.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

amcasey picture amcasey  路  70Comments

tdkn picture tdkn  路  57Comments

tleunen picture tleunen  路  59Comments

aranw picture aranw  路  95Comments

kybarg picture kybarg  路  164Comments