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.

how to custom style in `FAB.Group`

See original GitHub issue

Current behaviour

from L301-L313 we can see there is no prop set the root FAB’s style

https://github.com/callstack/react-native-paper/blob/3bcda083ba75673a9dd85bff6494f7aeb142152d/src/components/FAB/FABGroup.js#L301-L313

but in here

https://github.com/callstack/react-native-paper/blob/3bcda083ba75673a9dd85bff6494f7aeb142152d/src/components/FAB/FABGroup.js#L282

we can change the sub fab use style

Expected behaviour

let me change the root fab’s background color not use the theme provider

PS:

sorry, use theme also cannot change the backgroundColor, because there is no theme prop in parent FAB.Group, the FAB cannot get the theme.colors. accent.

https://github.com/callstack/react-native-paper/blob/3bcda083ba75673a9dd85bff6494f7aeb142152d/src/components/FAB/FAB.js#L111

Code sample

just copy from here: https://callstack.github.io/react-native-paper/fab-group.html

Your Environment

software version
react-native-paper 2.2.6

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

10reactions
satya164commented, Nov 26, 2018

To change the background color of the FAB you can pass the accent color in theme:

theme={{ colors: { accent: 'blue' } }}

Though it’ll be useful to add a fabStyle prop which passes the styles to the underlying fab.

6reactions
satya164commented, Feb 5, 2019

@lutakyn it’s an open source project. pull requests to documentation are welcome.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to change background color of FAB.Group from react ...
You almost had it, just change line below style={styles.fab}. for this other one fabStyle={styles.fab}.
Read more >
FAB.Group · React Native Paper
Style for the FAB. It allows to pass the FAB button styles, such as backgroundColor. variant. Available in v5.x with theme version 3....
Read more >
Building a floating action button (FAB) component - web.dev
Start with a .fabs class for CSS to hook into for style, then add role="group" and aria-label so it's not just a generic...
Read more >
How to create custom FAB(Floating Action Button) in React ...
Example: Open the FAB.js file and write the below code in that file. This file contains the code for the custom FAB component....
Read more >
FAB - React Native Elements
Props​ Includes all Button props. Change the color of the FAB. FAB placement at bottom, (optional) use style in case of custom placement....
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