question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FloatingActionButton] Color prop of icon not used in FloatingActionButton

See original GitHub issue

The color prop for a SVG icon inside a FloatingActionButton is not used. In below example, the icon color is the default white color, not red as expected. This was working in version 0.14.4

import PlaceIcon from 'material-ui/lib/svg-icons/maps/place';

<FloatingActionButton>
  <PlaceIcon color="#ff0000" />
</FloatingActionButton>

Versions

  • Material-UI: 0.15.0-alpha.2
  • React: 0.14.7
  • Browser: at least Chrome & Firefox

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
mbrookescommented, Mar 30, 2016

@jkettmann - the color is controlled by <FloatingActionButton /> so it can set it for disabled etc.

You could create a custom theme, or update the theme on context with the muiThemefloatingActionButton.iconColor and floatingActionButton.disabledTextColor keys.

Or override the icon style with:

    <FloatingActionButton iconStyle={{fill: '#FF0000'}}>
      <PlaceIcon />
    </FloatingActionButton>
3reactions
brad-deckercommented, Mar 24, 2017

In my opinion the documents should be updated to reflect that FloatingActionButton is gonna eat the valid props documented in child components, or we should reopen this so that it can be tracked and some beautiful engineers can make this work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[FloatingActionButton] Color prop of icon not used in ... - GitHub
The color prop for a SVG icon inside a FloatingActionButton is not used. In below example, the icon color is the default white...
Read more >
Why is my FloatingActionButton icon black? - Stack Overflow
Following is the code I'm using. I'm using androidx. Every FAB has a black icon, even if it has a white color. mylayout.xml...
Read more >
Change Floating Action Button Color in Flutter - FlutterBeads
There is no straightforward way to change the floating action button border color. So the idea is to NOT use the floating action...
Read more >
Flutter FloatingActionButton: A complete tutorial with examples
Learn all about Flutter's FloatingActionButton widget, including how to customize the FloatingAppButton and how to add hero animations.
Read more >
FloatingActionButton class - material library - Dart API
This example shows how to display a FloatingActionButton in a Scaffold, with a pink backgroundColor and a thumbs up Icon. // Add your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found