Giter Site home page Giter Site logo

nobitagit / react-material-floating-button Goto Github PK

View Code? Open in Web Editor NEW
207.0 8.0 70.0 239 KB

Material floating action button implemented as a React component

Home Page: http://nobitagit.github.io/react-material-floating-button/

License: MIT License

JavaScript 17.09% CSS 73.74% HTML 9.16%

react-material-floating-button's Introduction

React Material Floating Button

Material design floating action button implemented as a React component.

Made to be fast and easy to customize. Shamelessly inspired by action buttons from Google Inbox, Evernote and Path.

Clone/download the repo from Github or just use npm:

npm install react-mfb --save

Docs are still to come (but hopefully will be there soon). In the meantime if you want to play with it check the project homepage source code for hints on how to use the component.

Demo

See the project page or just look at this awesome gif:

Other versions

Demo icons courtesy of Ionicons

react-material-floating-button's People

Contributors

edcolcode avatar hugoabonizio avatar koozi avatar lezuse avatar nobitagit avatar phated avatar stephenlacy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-material-floating-button's Issues

Accept inline styles

Hi,

I'm using your awesome component in a project. I tried to pass inline styles to the main and child buttons but I realized that them are not taking that in count the style property. I made some changes in the component and now is taking the style property too. I think that this functionality can help others so is a good idea to include this on master branch.

Thanks & regards.

Add overlay/obfuscator

An overlay (like behind drawers) could add two benefices:

  • handle the click on it to close the mfb or whatever
  • add a custom background color with opacity (like 0.1)

I imagine this new props:

overlay: bool (default: false)

closeOnOverlayClick: bool (default: true)

overlayClick: func (optional)

overlayBackgroundColor: string (default: 'transparent')

overlayBackgroundOpacity: numb (default: 0')


How do you feel with this ideas?
Thanks

mfb.scss unsuable without _/_slidein.scss in distribution

Problem
The mfb.scss file included in the npm distribution references _/_slidein.scss which is not included.
That makes mfb.scss almost unusable. That is

@import '~react-mfb/mfb.scss'; 

causes

ERROR in ./node_modules/css-loader!./node_modules/sass-loader/lib/loader.js?{}!./src/app/mfb.scss
Module build failed: 
@import "_/_slidein";
^
      File to import not found or unreadable: _/_slidein.

Solution
Include mfb/src/_ folder in the npm distribution.

Workaround
When using webpack with sass-loader

  1. Include a copy of mfb/src/_ in your project's sources, e.g in src/_ folder
  2. In webpack.config.js include:
    module: {
        rules: [
           /*...*/
            {
                test: /\.scss$/,
                use: [
                    'style-loader',
                    'css-loader',
                    {
                        loader: 'sass-loader',
                        options: {
                           /* or other directory where you've placed the copy of _*/
                            includePaths: ["src"] 
                        }
                    }
                ]
            }
        ]
    },

write dead line-height of icon

.mfb-component__icon{
  position: absolute;
  font-size: 18px;
  text-align: center;
  line-height: 56px; // $main_button_size or $child_button_size?
  width: 100%;
}

Replace deprecated React.createClass

Due to the deprecation of React.createClass this warning is raised:

Warning: MainButton: React.createClass is deprecated and will be removed in version 16. Use plain JavaScript classes instead. If you're not yet ready to migrate, create-react-class is available on npm as a drop-in replacement.

I'm opening this issue to suggest to follow one of this plans: change the definitions of the components (Menu, MainButton and ChildButton) using plain JS classes, or use the create-react-class module. The most straightforward solution is just use the create-react-class module.

WDYT @nobitagit?

(related #24)

React implementation

How do I implement this into my react project. Having trouble using this.

Referenced the project example folder index.js to do this but failing to render the component correctly.

Warning: MainButton: React.createClass is deprecated and will be removed in version 16. Use plain JavaScript classes instead. If you're not yet ready to migrate, create-react-class is available on npm as a drop-in replacement.

Include SCSS in npm install

It would be good to also include the SCSS file when we do npm install react-mfb.
This would allow us to do an @import in our own application scss, and at the same time tweak the variables.

Close menu after select (click) any child

Hi,

Thanks for this awesome component.
I'm using it to trigger some actions but I want to close the menu after the user clicks in some child element.

¿Any ideas?
Regards.

Is this repo is active?

I see issues without responses, usefull pull requests not merged, so I just ask to be sure to not loose time.
Thanks

Can I fork this repository in order to activate it again?

Hi there,

I ve seen that in a long time that repo hasn't been updated, and so many helpful pull requests have fallen into oblivion. So, I' m gonna do another repository in order to satisfy all the people who wants background overlay, good behaviour of the onClick methods, etc....

React 16 support

The project is not working with react 16 at the moment. Is there an update planned?

[email protected] requires a peer of react@^15.3.1

Best regards :-)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.